android_kernel_motorola_sm6375/fs/proc
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Linus Torvalds 0f88370701 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 <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Christian Brauner <[email protected]>
Cc: Andrea Righi <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-06-16 11:59:46 +02:00
..
array.c
base.c proc: only require mm_struct for writing 2021-06-16 11:59:46 +02:00
cmdline.c
consoles.c
cpuinfo.c
devices.c
fd.c
fd.h
generic.c proc: fix lookup in /proc/net subdirectories after setns(2) 2021-01-12 20:16:10 +01:00
inode.c
internal.h proc: fix lookup in /proc/net subdirectories after setns(2) 2021-01-12 20:16:10 +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) 2021-01-12 20:16:10 +01:00
proc_sysctl.c
proc_tty.c
root.c
self.c proc: don't allow async path resolution of /proc/self components 2020-12-02 08:49:48 +01:00
softirqs.c
stat.c
task_mmu.c proc: use untagged_addr() for pagemap_read addresses 2020-12-16 10:56:58 +01:00
task_nommu.c
thread_self.c
uptime.c
util.c
version.c
vmcore.c