• G
    9pfs: local: lgetxattr: don't follow symlinks · 56ad3e54
    Greg Kurz 提交于
    The local_lgetxattr() callback is vulnerable to symlink attacks because
    it calls lgetxattr() which follows symbolic links in all path elements but
    the rightmost one.
    
    This patch introduces a helper to emulate the non-existing fgetxattrat()
    function: it is implemented with /proc/self/fd which provides a trusted
    path that can be safely passed to lgetxattr().
    
    local_lgetxattr() is converted to use this helper and opendir_nofollow().
    
    This partly fixes CVE-2016-9602.
    Signed-off-by: NGreg Kurz <groug@kaod.org>
    Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
    56ad3e54
9p-util.c 1.5 KB