linux-stable/fs/proc
Kalesh Singh 1927e498ae procfs: prevent unprivileged processes accessing fdinfo dir
The file permissions on the fdinfo dir from were changed from
S_IRUSR|S_IXUSR to S_IRUGO|S_IXUGO, and a PTRACE_MODE_READ check was added
for opening the fdinfo files [1].  However, the ptrace permission check
was not added to the directory, allowing anyone to get the open FD numbers
by reading the fdinfo directory.

Add the missing ptrace permission check for opening the fdinfo directory.

[1] https://lkml.kernel.org/r/20210308170651.919148-1-kaleshsingh@google.com

Link: https://lkml.kernel.org/r/20210713162008.1056986-1-kaleshsingh@google.com
Fixes: 7bc3fa0172 ("procfs: allow reading fdinfo with PTRACE_MODE_READ")
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Hridya Valsaraju <hridya@google.com>
Cc: Jann Horn <jannh@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-05-09 17:34:28 -07:00
..
array.c tracehook: Remove tracehook.h 2022-03-10 16:51:51 -06:00
base.c ptrace: Cleanups for v5.18 2022-03-28 17:29:53 -07:00
bootconfig.c proc: bootconfig: Add null pointer check 2022-04-02 08:40:09 -04:00
cmdline.c
consoles.c
cpuinfo.c
devices.c
fd.c procfs: prevent unprivileged processes accessing fdinfo dir 2022-05-09 17:34:28 -07:00
fd.h
generic.c fs: proc: store PDE()->data into inode->i_private 2022-01-22 08:33:37 +02:00
inode.c fs: allocate inode by using alloc_inode_sb() 2022-03-22 15:57:03 -07:00
internal.h fs: proc: store PDE()->data into inode->i_private 2022-01-22 08:33:37 +02:00
interrupts.c
Kconfig
kcore.c
kmsg.c
loadavg.c
Makefile
meminfo.c
namespaces.c
nommu.c
page.c mm: don't include <linux/memremap.h> in <linux/mm.h> 2022-03-03 12:47:33 -05:00
proc_net.c proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
proc_sysctl.c kernel/sysctl.c: rename sysctl_init() to sysctl_init_bases() 2022-01-22 08:33:36 +02:00
proc_tty.c
root.c
self.c
softirqs.c
stat.c fs/proc/uptime.c: Fix idle time reporting in /proc/uptime 2021-10-05 15:51:35 +02:00
task_mmu.c proc: fix documentation and description of pagemap 2022-03-05 11:08:33 -08:00
task_nommu.c
thread_self.c
uptime.c fs/proc/uptime.c: Fix idle time reporting in /proc/uptime 2021-10-05 15:51:35 +02:00
util.c
version.c
vmcore.c proc/vmcore: fix vmcore_alloc_buf() kernel-doc comment 2022-03-23 19:00:33 -07:00