Commit 9257ade3 authored by Kalesh Singh's avatar Kalesh Singh Committed by Treehugger Robot
Browse files

UPSTREAM: 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

Bug: 254441685
Link: https://lkml.kernel.org/r/20210713162008.1056986-1-kaleshsingh@google.com


Fixes: 7bc3fa01 ("procfs: allow reading fdinfo with PTRACE_MODE_READ")
Signed-off-by: default avatarKalesh 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: default avatarAndrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 1927e498)
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: Idaeffb84ce297c0a393652325c74ddd533ffcfbf
parent ae1f81f7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment