Files
kernel_arpi/include/linux
Alexey Dobriyan b202ac9c73 proc: fix lookup in /proc/net subdirectories after setns(2)
[ Upstream commit c6c75deda8 ]

Commit 1fde6f21d9 ("proc: fix /proc/net/* after setns(2)") only forced
revalidation of regular files under /proc/net/

However, /proc/net/ is unusual in the sense of /proc/net/foo handlers
take netns pointer from parent directory which is old netns.

Steps to reproduce:

	(void)open("/proc/net/sctp/snmp", O_RDONLY);
	unshare(CLONE_NEWNET);

	int fd = open("/proc/net/sctp/snmp", O_RDONLY);
	read(fd, &c, 1);

Read will read wrong data from original netns.

Patch forces lookup on every directory under /proc/net .

Link: https://lkml.kernel.org/r/20201205160916.GA109739@localhost.localdomain
Fixes: 1da4d377f9 ("proc: revalidate misc dentries")
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Reported-by: "Rantala, Tommi T. (Nokia - FI/Espoo)" <tommi.t.rantala@nokia.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-12-30 11:53:56 +01:00
..
2020-10-28 13:18:56 +01:00
2020-10-02 14:59:25 -07:00
2020-10-02 15:00:49 -07:00
2020-10-16 17:21:51 +02:00
2020-12-11 14:02:14 -08:00
2020-10-27 16:22:43 +01:00
2020-12-26 16:02:43 +01:00
2020-09-30 22:44:26 +02:00
2020-11-19 22:38:29 -05:00
2020-10-13 18:38:32 -07:00
2020-09-23 18:02:49 -07:00
2020-10-07 14:28:39 -04:00
2020-09-24 19:49:36 -07:00
2020-10-28 11:41:15 -06:00
2020-10-18 09:27:10 -07:00
2020-12-30 11:53:55 +01:00
2020-11-06 10:05:18 -08:00
2020-09-26 22:55:05 -04:00
2020-12-04 17:39:58 +01:00
2020-10-18 09:27:10 -07:00
2020-10-05 13:21:49 +02:00