OrangePi_CM5/fs/proc
Kees Cook f70102cb36 proc: Track /proc/$pid/attr/ opener mm_struct
commit 591a22c14d3f45cc38bd1931c593c221df2f1881 upstream.

Commit bfb819ea20ce ("proc: Check /proc/$pid/attr/ writes against file opener")
tried to make sure that there could not be a confusion between the opener of
a /proc/$pid/attr/ file and the writer. It used struct cred to make sure
the privileges didn't change. However, there were existing cases where a more
privileged thread was passing the opened fd to a differently privileged thread
(during container setup). Instead, use mm_struct to track whether the opener
and writer are still the same process. (This is what several other proc files
already do, though for different reasons.)

Reported-by: Christian Brauner <christian.brauner@ubuntu.com>
Reported-by: Andrea Righi <andrea.righi@canonical.com>
Tested-by: Andrea Righi <andrea.righi@canonical.com>
Fixes: bfb819ea20ce ("proc: Check /proc/$pid/attr/ writes against file opener")
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-16 12:01:34 +02:00
..
Kconfig
…
Makefile
…
array.c seccomp: Fix CONFIG tests for Seccomp_filters 2021-05-14 09:50:24 +02:00
base.c proc: Track /proc/$pid/attr/ opener mm_struct 2021-06-16 12:01:34 +02:00
bootconfig.c
…
cmdline.c
…
consoles.c
…
cpuinfo.c
…
devices.c
…
fd.c
…
fd.h
…
generic.c fs/proc/generic.c: fix incorrect pde_is_permanent check 2021-05-19 10:13:09 +02:00
inode.c
…
internal.h proc: fix lookup in /proc/net subdirectories after setns(2) 2020-12-30 11:53:56 +01:00
interrupts.c
…
kcore.c
…
kmsg.c
…
loadavg.c
…
meminfo.c
…
namespaces.c
…
nommu.c
…
page.c
…
proc_net.c proc: fix lookup in /proc/net subdirectories after setns(2) 2020-12-30 11:53:56 +01:00
proc_sysctl.c proc: use kvzalloc for our kernel buffer 2021-03-04 11:38:21 +01:00
proc_tty.c
…
root.c
…
self.c proc: don't allow async path resolution of /proc/thread-self components 2021-03-04 11:38:42 +01:00
softirqs.c
…
stat.c
…
task_mmu.c mm: proc: Invalidate TLB after clearing soft-dirty page state 2021-03-04 11:37:45 +01:00
task_nommu.c
…
thread_self.c proc: don't allow async path resolution of /proc/thread-self components 2021-03-04 11:38:42 +01:00
uptime.c
…
util.c
…
version.c
…
vmcore.c
…