• Al Viro's avatar
    fix cgroup_do_mount() handling of failure exits · 781bcac5
    Al Viro authored
    commit 399504e2 upstream.
    
    same story as with last May fixes in sysfs (7b745a4e
    "unfuck sysfs_mount()"); new_sb is left uninitialized
    in case of early errors in kernfs_mount_ns() and papering
    over it by treating any error from kernfs_mount_ns() as
    equivalent to !new_ns ends up conflating the cases when
    objects had never been transferred to a superblock with
    ones when that has happened and resulting new superblock
    had been dropped.  Easily fixed (same way as in sysfs
    case).  Additionally, there's a superblock leak on
    kernfs_node_dentry() failure *and* a dentry leak inside
    kernfs_node_dentry() itself - the latter on probably
    impossible errors, but the former not impossible to trigger
    (as the matter of fact, injecting allocation failures
    at that point *does* trigger it).
    
    Cc: stable@kernel.org
    Signed-off-by: 's avatarAl Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    781bcac5
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
dir.c Loading commit data...
file.c Loading commit data...
inode.c Loading commit data...
kernfs-internal.h Loading commit data...
mount.c Loading commit data...
symlink.c Loading commit data...