+ net-9p-fix-potential-refcnt-problem-of-trans-module.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: net/9p/client.c: fix potential refcnt problem of trans module
has been added to the -mm tree.  Its filename is
     net-9p-fix-potential-refcnt-problem-of-trans-module.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/net-9p-fix-potential-refcnt-problem-of-trans-module.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/net-9p-fix-potential-refcnt-problem-of-trans-module.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: Chengguang Xu <cgxu519@xxxxxxx>
Subject: net/9p/client.c: fix potential refcnt problem of trans module

When specifying trans_mod multiple times in a mount, it will cause an
inaccurate refcount of the trans module.  Also, in the error case of
option parsing, we should put the trans module if we have already got it.

Link: http://lkml.kernel.org/r/1522154942-57339-1-git-send-email-cgxu519@xxxxxxx
Signed-off-by: Chengguang Xu <cgxu519@xxxxxxx>
Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: David Miller <davem@xxxxxxxxxxxxx>
Cc: Eric Van Hensbergen <ericvh@xxxxxxxxx>
Cc: Ron Minnich <rminnich@xxxxxxxxxx>
Cc: Latchesar Ionkov <lucho@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 net/9p/client.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff -puN net/9p/client.c~net-9p-fix-potential-refcnt-problem-of-trans-module net/9p/client.c
--- a/net/9p/client.c~net-9p-fix-potential-refcnt-problem-of-trans-module
+++ a/net/9p/client.c
@@ -190,7 +190,9 @@ static int parse_opts(char *opts, struct
 				p9_debug(P9_DEBUG_ERROR,
 					 "problem allocating copy of trans arg\n");
 				goto free_and_return;
-			 }
+			}
+
+			v9fs_put_trans(clnt->trans_mod);
 			clnt->trans_mod = v9fs_get_trans_by_name(s);
 			if (clnt->trans_mod == NULL) {
 				pr_info("Could not find request transport: %s\n",
@@ -226,6 +228,7 @@ static int parse_opts(char *opts, struct
 	}
 
 free_and_return:
+	v9fs_put_trans(clnt->trans_mod);
 	kfree(tmp_options);
 	return ret;
 }
_

Patches currently in -mm which might be from cgxu519@xxxxxxx are

9p-check-memory-allocation-result-for-cachetag.patch
net-9p-fix-potential-refcnt-problem-of-trans-module.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux