diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2021-06-15 09:26:19 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-06-16 11:55:02 +0200 |
| commit | 2bc534caba6a9650123e7ddb89b3e34845df9c7b (patch) | |
| tree | 215ff305f2e904c1adf02526429e30df44885eef /scripts/gcc-plugins/cyc_complexity_plugin.c | |
| parent | 31ceae385556c37e4d286cb6378696448f566883 (diff) | |
| download | linux-2bc534caba6a9650123e7ddb89b3e34845df9c7b.tar.gz linux-2bc534caba6a9650123e7ddb89b3e34845df9c7b.tar.bz2 linux-2bc534caba6a9650123e7ddb89b3e34845df9c7b.zip | |
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>
Diffstat (limited to 'scripts/gcc-plugins/cyc_complexity_plugin.c')
0 files changed, 0 insertions, 0 deletions
