Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1352275

[PATCH 3.10 15/24] ALSA: seq: oss: Dont drain at closing a client

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 3.10 15/24] ALSA: seq: oss: Dont drain at closing a client
Date 2016-03-08 00:50 +0100
Message-ID <rad4y-1cJ-93@gated-at.bofh.it> (permalink)
References <rad4t-1cJ-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


3.10-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Takashi Iwai <tiwai@suse.de>

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.

BugLink: http://lkml.kernel.org/r/CACT4Y+Y4kD-aBGj37rf-xBw9bH3GMU6P+MYg4W1e-s-paVD2pg@mail.gmail.com
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 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(-)

--- a/sound/core/seq/oss/seq_oss.c
+++ b/sound/core/seq/oss/seq_oss.c
@@ -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);
--- a/sound/core/seq/oss/seq_oss_device.h
+++ b/sound/core/seq/oss/seq_oss_device.h
@@ -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);
--- a/sound/core/seq/oss/seq_oss_init.c
+++ b/sound/core/seq/oss/seq_oss_init.c
@@ -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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 3.10 00/24] 3.10.100-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-08 00:50 +0100
  [PATCH 3.10 12/24] ALSA: ctl: Fix ioctls for X32 ABI Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-08 00:50 +0100
  [PATCH 3.10 09/24] Revert "jffs2: Fix lock acquisition order bug in jffs2_write_begin" Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-08 00:50 +0100
  [PATCH 3.10 22/24] USB: serial: option: add support for Quectel UC20 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-08 00:50 +0100
  [PATCH 3.10 21/24] USB: serial: option: add support for Telit LE922 PID 0x1045 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-08 00:50 +0100
  [PATCH 3.10 15/24] ALSA: seq: oss: Dont drain at closing a client Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-08 00:50 +0100
  [PATCH 3.10 23/24] ubi: Fix out of bounds write in volume update code Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-08 01:00 +0100
  [PATCH 3.10 07/24] libata: Align ata_devices id on a cacheline Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-08 01:10 +0100
  [PATCH 3.10 04/24] x86/entry/compat: Add missing CLAC to entry_INT80_32 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-08 01:10 +0100
  [PATCH 3.10 08/24] PM / sleep / x86: Fix crash on graph trace through x86 suspend Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-08 01:10 +0100
  [PATCH 3.10 03/24] CIFS: Fix SMB2+ interim response processing for read requests Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-08 01:10 +0100
  [PATCH 3.10 02/24] EDAC, mc_sysfs: Fix freeing bus name Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-08 01:10 +0100
  [PATCH 3.10 13/24] ALSA: rawmidi: Fix ioctls X32 ABI Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-08 01:10 +0100
  [PATCH 3.10 06/24] libata: fix HDIO_GET_32BIT ioctl Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-08 01:10 +0100
  Re: [PATCH 3.10 00/24] 3.10.100-stable review Guenter Roeck <linux@roeck-us.net> - 2016-03-08 12:50 +0100
  Re: [PATCH 3.10 00/24] 3.10.100-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2016-03-08 17:30 +0100

csiph-web