linux_dsm_epyc7002/fs/proc
Linus Torvalds ef9a0d224b proc: only require mm_struct for writing
commit 94f0b2d4a1d0c52035aef425da5e022bd2cb1c71 upstream.

Commit 591a22c14d3f ("proc: Track /proc/$pid/attr/ opener mm_struct") we
started using __mem_open() to track the mm_struct at open-time, so that
we could then check it for writes.

But that also ended up making the permission checks at open time much
stricter - and not just for writes, but for reads too.  And that in turn
caused a regression for at least Fedora 29, where NIC interfaces fail to
start when using NetworkManager.

Since only the write side wanted the mm_struct test, ignore any failures
by __mem_open() at open time, leaving reads unaffected.  The write()
time verification of the mm_struct pointer will then catch the failure
case because a NULL pointer will not match a valid 'current->mm'.

Link: https://lore.kernel.org/netdev/YMjTlp2FSJYvoyFa@unreal/
Fixes: 591a22c14d3f ("proc: Track /proc/$pid/attr/ opener mm_struct")
Reported-and-tested-by: Leon Romanovsky <leon@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-16 12:01:47 +02:00
..
array.c seccomp: Fix CONFIG tests for Seccomp_filters 2021-05-14 09:50:24 +02:00
base.c proc: only require mm_struct for writing 2021-06-16 12:01:47 +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
Kconfig
kcore.c
kmsg.c
loadavg.c
Makefile
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