mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + autofs-remove-ino-free-in-autofs4_dir_symlink.patch added to -mm tree
@ 2016-08-12  3:07 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2016-08-12  3:07 UTC (permalink / raw)
  To: raven, kusumi.tomohiro, mm-commits


The patch titled
     Subject: autofs: remove ino free in autofs4_dir_symlink()
has been added to the -mm tree.  Its filename is
     autofs-remove-ino-free-in-autofs4_dir_symlink.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/autofs-remove-ino-free-in-autofs4_dir_symlink.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/autofs-remove-ino-free-in-autofs4_dir_symlink.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/SubmitChecklist 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@themaw.net>
Subject: autofs: remove ino free in autofs4_dir_symlink()

The inode allocation failure case in autofs4_dir_symlink() frees the
autofs dentry info of the dentry without setting ->d_fsdata to NULL.

That could lead to a double free so just get rid of the free and leave it
to ->d_release().

Link: http://lkml.kernel.org/r/20160812024759.12352.10653.stgit@pluto.themaw.net
Signed-off-by: Ian Kent <raven@themaw.net>
Cc: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/autofs4/root.c |    2 --
 1 file changed, 2 deletions(-)

diff -puN fs/autofs4/root.c~autofs-remove-ino-free-in-autofs4_dir_symlink fs/autofs4/root.c
--- a/fs/autofs4/root.c~autofs-remove-ino-free-in-autofs4_dir_symlink
+++ a/fs/autofs4/root.c
@@ -577,8 +577,6 @@ static int autofs4_dir_symlink(struct in
 	inode = autofs4_get_inode(dir->i_sb, S_IFLNK | 0555);
 	if (!inode) {
 		kfree(cp);
-		if (!dentry->d_fsdata)
-			kfree(ino);
 		return -ENOMEM;
 	}
 	inode->i_private = cp;
_

Patches currently in -mm which might be from raven@themaw.net are

autofs-fix-autofs4_fill_super-error-exit-handling.patch
autofs-remove-ino-free-in-autofs4_dir_symlink.patch
autofs-fix-dev-ioctl-number-range-check.patch
autofs-add-autofs_dev_ioctl_version-for-autofs_dev_ioctl_version_cmd.patch
autofs4-move-linux-auto_dev-ioctlh-to-uapi-linux.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-12  3:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-12  3:07 + autofs-remove-ino-free-in-autofs4_dir_symlink.patch added to -mm tree akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).