Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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 <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric W. Biederman and committed by
David S. Miller
ceaa79c4 2b008b0a

+1 -1
+1 -1
net/core/rtnetlink.c
··· 742 742 /* Lookup the network namespace */ 743 743 net = ERR_PTR(-ESRCH); 744 744 rcu_read_lock(); 745 - tsk = find_task_by_pid(pid); 745 + tsk = find_task_by_vpid(pid); 746 746 if (tsk) { 747 747 struct nsproxy *nsproxy; 748 748 nsproxy = task_nsproxy(tsk);