]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Fix a race condition in FASYNC handling
authorJonathan Corbet <corbet@lwn.net>
Fri, 5 Dec 2008 23:12:48 +0000 (16:12 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 13 Dec 2008 23:29:14 +0000 (15:29 -0800)
commit21b7c0e824f0e98242e625a15bea368ea72ebcbb
treebb5883ca3e3fd82d9216f686c7a7aee9a9f1a191
parent5c7c64831c51516034a7099ba25718f7aaed19e4
Fix a race condition in FASYNC handling

commit 218d11a8b071b23b76c484fd5f72a4fe3306801e upstream.

Changeset a238b790d5f99c7832f9b73ac8847025815b85f7 (Call fasync()
functions without the BKL) introduced a race which could leave
file->f_flags in a state inconsistent with what the underlying
driver/filesystem believes.  Revert that change, and also fix the same
races in ioctl_fioasync() and ioctl_fionbio().

This is a minimal, short-term fix; the real fix will not involve the
BKL.

Reported-by: Oleg Nesterov <oleg@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/fcntl.c
fs/ioctl.c