The patch titled Subject: autofs: fix possible inode leak in autofs_fill_super() has been added to the -mm tree. Its filename is autofs-fix-possible-inode-leak-in-autofs_fill_super.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/autofs-fix-possible-inode-leak-in-autofs_fill_super.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/autofs-fix-possible-inode-leak-in-autofs_fill_super.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Ian Kent <raven@xxxxxxxxxx> Subject: autofs: fix possible inode leak in autofs_fill_super() There is no check at all for a failure to allocate the root inode in autofs_fill_super(), handle it. Link: http://lkml.kernel.org/r/154296971705.9889.9822861969081020188.stgit@pluto-themaw-net Signed-off-by: Ian Kent <raven@xxxxxxxxxx> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- --- a/fs/autofs/inode.c~autofs-fix-possible-inode-leak-in-autofs_fill_super +++ a/fs/autofs/inode.c @@ -254,9 +254,13 @@ int autofs_fill_super(struct super_block goto fail_free; } root_inode = autofs_get_inode(s, S_IFDIR | 0755); + if (!root_inode) { + ret = -ENOMEM; + goto fail_ino; + } root = d_make_root(root_inode); if (!root) - goto fail_ino; + goto fail_iput; pipe = NULL; root->d_fsdata = ino; @@ -304,8 +308,8 @@ int autofs_fill_super(struct super_block root_inode->i_op = &autofs_dir_inode_operations; pr_debug("pipe fd = %d, pgrp = %u\n", pipefd, pid_nr(sbi->oz_pgrp)); - pipe = fget(pipefd); + pipe = fget(pipefd); if (!pipe) { pr_err("could not open pipe file descriptor\n"); goto fail_put_pid; @@ -334,6 +338,8 @@ fail_put_pid: fail_dput: dput(root); goto fail_free; +fail_iput: + iput(root_inode); fail_ino: autofs_free_ino(ino); fail_free: _ Patches currently in -mm which might be from raven@xxxxxxxxxx are autofs-improve-ioctl-sbi-checks.patch autofs-fix-possible-inode-leak-in-autofs_fill_super.patch autofs-simplify-parse_options-function-call.patch autofs-change-catatonic-setting-to-a-bit-flag.patch autofs-add-strictexpire-mount-option.patch