]> git.hungrycats.org Git - linux/commit
[PATCH] Fix cramfs metadata races
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
Fri, 7 Nov 2003 01:53:45 +0000 (17:53 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Fri, 7 Nov 2003 01:53:45 +0000 (17:53 -0800)
commit0aef2868d85721a36e127721004d1eac9f7f48f4
tree212afffb8c3694d3b684a2845a3431b3aa50fadb
parentd6594193265f10fc5df50601c25efb7cb6e48ba6
[PATCH] Fix cramfs metadata races

There's a few places that use incorrect exclusion for the cramfs raw
data access buffers.  The proper lock is "read_mutex" (and BKL does
nothing).

 - fix mount-time read and block number initialization without the mutex
   held.
 - cramfs_readdir() needs to copy the name and inode information into a
   separate buffer since it can't hold the semaphore over the
   (potentially blocking) user mode access
 - cramfs_lookup() needs to hold the access lock over the whole
   function, not just the read itself
 - use generic_file_llseek on directories to get i_sem exclusion on
   readdir/lseek
fs/cramfs/inode.c