From: Eric W. Biederman Date: Sat, 27 Oct 2007 05:56:12 +0000 (-0700) Subject: [NETNS]: Fix get_net_ns_by_pid X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ceaa79c434044e40031585a65a4e45dc09322e8f;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [NETNS]: Fix get_net_ns_by_pid The pid namespace patches changed the semantics of find_task_by_pid without breaking the compile resulting in get_net_ns_by_pid doing the wrong thing. So switch to using the intended find_task_by_vpid. Combined with Denis' earlier patch to make netlink traffic fully synchronous the inadvertent race I introduced with accessing current is actually removed. Signed-off-by: Eric W. Biederman Signed-off-by: David S. Miller --- diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 4a2640d38261..e1ba26fb4bf2 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -742,7 +742,7 @@ static struct net *get_net_ns_by_pid(pid_t pid) /* Lookup the network namespace */ net = ERR_PTR(-ESRCH); rcu_read_lock(); - tsk = find_task_by_pid(pid); + tsk = find_task_by_vpid(pid); if (tsk) { struct nsproxy *nsproxy; nsproxy = task_nsproxy(tsk);