• Alexander Viro's avatar
    [PATCH] Fix cramfs metadata races · 0aef2868
    Alexander Viro authored
    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
    0aef2868
inode.c 12.5 KB