Skip to content
  • Al Viro's avatar
    [PATCH] namei fixes (15/19) · d9d29a29
    Al Viro authored
    
    
    Getting rid of sloppy logics:
    
    a) in do_follow_link() we have the wrong vfsmount dropped if our symlink
    had been mounted on something.  Currently it worls only because we never
    get such situation (modulo filesystem playing dirty tricks on us).  And
    it obfuscates already convoluted logics...
    
    b) same goes for open_namei().
    
    c) in __link_path_walk() we have another "it should never happen" sloppiness -
    out_dput: there does double-free on underlying vfsmount and leaks the covering
    one if we hit it just after crossing a mountpoint.  Again, wrong vfsmount
    getting dropped.
    
    d) another too-early-mntput() race - in do_follow_mount() we need to postpone
    conditional mntput(path->mnt) until after dput(path->dentry).  Again, this one
    happens only in it-currently-never-happens-unless-some-fs-plays-dirty
    scenario...
    
    Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    d9d29a29