]> git.karo-electronics.de Git - linux-beck.git/commitdiff
VFS: AF_UNIX sockets should call mknod on the top layer only
authorDavid Howells <dhowells@redhat.com>
Fri, 6 Mar 2015 14:05:26 +0000 (14:05 +0000)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 15 Apr 2015 19:06:54 +0000 (15:06 -0400)
AF_UNIX sockets should call mknod on the top layer only and should not attempt
to modify the lower layer in a layered filesystem such as overlayfs.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
net/unix/af_unix.c

index 433f287ee548391183c63d80b4db3736454a7f28..8b8f5e6d20bce2a9c4c21efe1f83c5a35a92746d 100644 (file)
@@ -839,7 +839,7 @@ static int unix_mknod(const char *sun_path, umode_t mode, struct path *res)
         */
        err = security_path_mknod(&path, dentry, mode, 0);
        if (!err) {
-               err = vfs_mknod(path.dentry->d_inode, dentry, mode, 0);
+               err = vfs_mknod(d_inode(path.dentry), dentry, mode, 0);
                if (!err) {
                        res->mnt = mntget(path.mnt);
                        res->dentry = dget(dentry);