summaryrefslogtreecommitdiffstats
path: root/fs/ntfs/Kconfig
diff options
context:
space:
mode:
authorVegard Nossum2009-01-22 15:29:45 +0100
committerLinus Torvalds2009-01-26 19:08:05 +0100
commit3632dee2f8b8a9720329f29eeaa4ec4669a3aff8 (patch)
tree602fc5cc96145472210a4254680d539c81cb02e7 /fs/ntfs/Kconfig
parentFix annoying DRM_ERROR() string warning (diff)
downloadkernel-qcow2-linux-3632dee2f8b8a9720329f29eeaa4ec4669a3aff8.tar.gz
kernel-qcow2-linux-3632dee2f8b8a9720329f29eeaa4ec4669a3aff8.tar.xz
kernel-qcow2-linux-3632dee2f8b8a9720329f29eeaa4ec4669a3aff8.zip
inotify: clean up inotify_read and fix locking problems
If userspace supplies an invalid pointer to a read() of an inotify instance, the inotify device's event list mutex is unlocked twice. This causes an unbalance which effectively leaves the data structure unprotected, and we can trigger oopses by accessing the inotify instance from different tasks concurrently. The best fix (contributed largely by Linus) is a total rewrite of the function in question: On Thu, Jan 22, 2009 at 7:05 AM, Linus Torvalds wrote: > The thing to notice is that: > > - locking is done in just one place, and there is no question about it > not having an unlock. > > - that whole double-while(1)-loop thing is gone. > > - use multiple functions to make nesting and error handling sane > > - do error testing after doing the things you always need to do, ie do > this: > > mutex_lock(..) > ret = function_call(); > mutex_unlock(..) > > .. test ret here .. > > instead of doing conditional exits with unlocking or freeing. > > So if the code is written in this way, it may still be buggy, but at least > it's not buggy because of subtle "forgot to unlock" or "forgot to free" > issues. > > This _always_ unlocks if it locked, and it always frees if it got a > non-error kevent. Cc: John McCutchan <ttb@tentacle.dhs.org> Cc: Robert Love <rlove@google.com> Cc: <stable@kernel.org> Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ntfs/Kconfig')
0 files changed, 0 insertions, 0 deletions