ALSA: seq: oss: Don't drain at closing a client
authorTakashi Iwai <tiwai@suse.de>
Tue, 1 Mar 2016 17:30:18 +0000 (18:30 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 1 Apr 2016 00:54:36 +0000 (01:54 +0100)
commitc7f2c4c4c6d4776db352e3994e61b3d92fee0420
tree8a5b8dde7988f228b8bf0ce10026e8d59214f3df
parent768015972d5580f5cd742a43bd975a27dcee8588
ALSA: seq: oss: Don't drain at closing a client

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>
[bwh: Backported to 3.2: snd_seq_oss_drain_write() has an extra log statement
 to be deleted]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
sound/core/seq/oss/seq_oss.c
sound/core/seq/oss/seq_oss_device.h
sound/core/seq/oss/seq_oss_init.c