Skip to contentSkip to conversation

Patch "ALSA: seq: oss: Don't drain at closing a client" has been added to the 3.14-stable tree

PATCH [email protected] 1 participant 1 message Mar 5, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

ALSA: seq: oss: Don't drain at closing a client

to the 3.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
alsa-seq-oss-don-t-drain-at-closing-a-client.patch
and it can be found in the queue-3.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 197b958c1e76a575d77038cc98b4bebc2134279f Mon Sep 17 00:00:00 2001

From: Takashi Iwai <[email protected]>
Date: Tue, 1 Mar 2016 18:30:18 +0100
Subject: ALSA: seq: oss: Don't drain at closing a client

From: Takashi Iwai <[email protected]>

commit 197b958c1e76a575d77038cc98b4bebc2134279f upstream.

The OSS sequencer client tries to drain the pending events at releasing. Unfortunately, as spotted by syzkaller fuzzer, this may lead to an unkillable process state when the event has been queued at the far future. Since the process being released can't be signaled any longer, it remains and waits for the echo-back event in that far future.

Back to history, the draining feature was implemented at the time we misinterpreted POSIX definition for blocking file operation. Actually, such a behavior is superfluous at release, and we should just release the device as is instead of keeping it up forever.

This patch just removes the draining call that may block the release for too long time unexpectedly.

---
 sound/core/seq/oss/seq_oss.c        |    2 --
 sound/core/seq/oss/seq_oss_device.h |    1 -
 sound/core/seq/oss/seq_oss_init.c   |   17 -----------------
 3 files changed, 20 deletions(-)
sound/core/seq/oss/seq_oss.c +0 -2
@@ -150,8 +150,6 @@ odev_release(struct inode *inode, struct
 	if ((dp = file->private_data) == NULL)
 		return 0;
 
-	snd_seq_oss_drain_write(dp);
-
 	mutex_lock(&register_mutex);
 	snd_seq_oss_release(dp);
 	mutex_unlock(&register_mutex);
sound/core/seq/oss/seq_oss_device.h +0 -1
@@ -131,7 +131,6 @@ int snd_seq_oss_write(struct seq_oss_dev
 unsigned int snd_seq_oss_poll(struct seq_oss_devinfo *dp, struct file *file, poll_table * wait);
 
 void snd_seq_oss_reset(struct seq_oss_devinfo *dp);
-void snd_seq_oss_drain_write(struct seq_oss_devinfo *dp);
 
 /* */
 void snd_seq_oss_process_queue(struct seq_oss_devinfo *dp, abstime_t time);
sound/core/seq/oss/seq_oss_init.c +0 -17
@@ -457,23 +457,6 @@ snd_seq_oss_release(struct seq_oss_devin
 
 
 /*
- * Wait until the queue is empty (if we don't have nonblock)
- */
-void
-snd_seq_oss_drain_write(struct seq_oss_devinfo *dp)
-{
-	if (! dp->timer->running)
-		return;
-	if (is_write_mode(dp->file_mode) && !is_nonblock_mode(dp->file_mode) &&
-	    dp->writeq) {
-		debug_printk(("syncing..\n"));
-		while (snd_seq_oss_writeq_sync(dp->writeq))
-			;
-	}
-}
-
-
-/*
  * reset sequencer devices
  */
 void

Patches currently in stable-queue which might be from [email protected] are

queue-3.14/alsa-hdspm-fix-zero-division.patch queue-3.14/alsa-ctl-fix-ioctls-for-x32-abi.patch queue-3.14/alsa-hdspm-fix-wrong-boolean-ctl-value-accesses.patch queue-3.14/alsa-hdsp-fix-wrong-boolean-ctl-value-accesses.patch queue-3.14/alsa-seq-oss-don-t-drain-at-closing-a-client.patch queue-3.14/alsa-timer-fix-ioctls-for-x32-abi.patch queue-3.14/alsa-timer-fix-broken-compat-timer-user-status-ioctl.patch queue-3.14/alsa-rawmidi-fix-ioctls-x32-abi.patch