android_kernel_google_msm/fs/proc
Oleg Nesterov 01fb6f509c UPSTREAM: proc: actually make proc_fd_permission() thread-friendly
(cherry pick from commit 54708d2858e79a2bdda10bf8a20c80eb96c20613)

The commit 96d0df79f2 ("proc: make proc_fd_permission() thread-friendly")
fixed the access to /proc/self/fd from sub-threads, but introduced another
problem: a sub-thread can't access /proc/<tid>/fd/ or /proc/thread-self/fd
if generic_permission() fails.

Change proc_fd_permission() to check same_thread_group(pid_task(), current).

Fixes: 96d0df79f2 ("proc: make proc_fd_permission() thread-friendly")
Reported-by: "Jin, Yihua" <yihua.jin@intel.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Bug: 26016905
Change-Id: Id91ef67770ab09fb2023338f4d0ace5fd3a60b1f
2016-10-29 23:12:14 +08:00
..
array.c procfs: fix /proc/statm 2012-03-28 17:14:35 -07:00
base.c UPSTREAM: proc: actually make proc_fd_permission() thread-friendly 2016-10-29 23:12:14 +08:00
cmdline.c
consoles.c
cpuinfo.c
devices.c
generic.c proc: Allow proc_free_inum to be called from any context 2015-07-13 11:21:13 -07:00
inode.c proc: Fix the namespace inode permission checks. 2015-07-13 11:18:00 -07:00
internal.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/sysctl 2012-03-23 18:08:58 -07:00
interrupts.c
Kconfig
kcore.c fs/proc/kcore.c: make get_sparsemem_vmemmap_info() static 2012-03-23 16:58:42 -07:00
kmsg.c
loadavg.c
Makefile
meminfo.c
mmu.c
namespaces.c proc: Usable inode numbers for the namespace file descriptors. 2015-07-13 11:18:01 -07:00
nommu.c
page.c pagemap: export KPF_THP 2012-03-21 17:54:57 -07:00
proc_devtree.c
proc_net.c
proc_sysctl.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/sysctl 2012-03-23 18:08:58 -07:00
proc_tty.c
root.c proc: fix mount -t proc -o AAA 2012-04-05 15:25:50 -07:00
softirqs.c
stat.c nohz: Fix idle ticks in cpu summary line of /proc/stat 2013-03-04 12:48:24 -08:00
task_mmu.c BACKPORT: pagemap: do not leak physical addresses to non-privileged userspace 2016-01-12 17:15:28 -05:00
task_nommu.c procfs: mark thread stack correctly in proc/<pid>/maps 2012-03-21 17:54:58 -07:00
uptime.c
version.c
vmcore.c fadump: Introduce cleanup routine to invalidate /proc/vmcore. 2012-02-23 10:50:02 +11:00