]> git.baikalelectronics.ru Git - kernel.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)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 5 Dec 2008 23:35:10 +0000 (15:35 -0800)
commit91db9e3e46810b37e6d6e2befc697d869c27e067
tree6656f841973496b0717117f8031d22bea019fd00
parent2f09b1a6f429845eae6b3dbe5f3b220c1e81e3f5
Fix a race condition in FASYNC handling

Changeset 73dc549ca0b1dcb0253e8eecee61279617c8fff9 (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>
Cc: stable@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/fcntl.c
fs/ioctl.c