linux-stable/fs/proc
Kees Cook 60d171c477 proc: Check /proc/$pid/attr/ writes against file opener
commit bfb819ea20 upstream.

Fix another "confused deputy" weakness[1]. Writes to /proc/$pid/attr/
files need to check the opener credentials, since these fds do not
transition state across execve(). Without this, it is possible to
trick another process (which may have different credentials) to write
to its own /proc/$pid/attr/ files, leading to unexpected and possibly
exploitable behaviors.

[1] https://www.kernel.org/doc/html/latest/security/credentials.html?highlight=confused#open-file-credentials

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
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-03 08:59:01 +02:00
..
array.c Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-07-08 16:39:53 -07:00
base.c proc: Check /proc/$pid/attr/ writes against file opener 2021-06-03 08:59:01 +02:00
cmdline.c
consoles.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 191 2019-05-30 11:29:21 -07:00
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 proc: Use new_inode not new_inode_pseudo 2020-06-17 16:40:33 +02:00
internal.h proc: fix lookup in /proc/net subdirectories after setns(2) 2021-01-12 20:16:10 +01:00
interrupts.c
Kconfig Merge branch 'akpm' (patches from Andrew) 2019-07-17 08:58:04 -07:00
kcore.c lockdown: Print current->comm in restriction messages 2019-08-19 21:54:17 -07:00
kmsg.c
loadavg.c sched: loadavg: consolidate LOAD_INT, LOAD_FRAC, CALC_LOAD 2018-10-26 16:26:32 -07:00
Makefile
meminfo.c proc/meminfo: fix output alignment 2019-10-19 06:32:32 -04:00
namespaces.c
nommu.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
page.c fs/proc/page.c: don't access uninitialized memmaps in fs/proc/page.c 2019-10-19 06:32:31 -04:00
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/sysctl: add shared variables for range check 2019-07-18 17:08:07 -07:00
proc_tty.c
root.c new helper: get_tree_keyed() 2019-09-05 14:34:22 -04:00
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 Merge branch 'akpm' (patches from Andrew) 2019-03-06 10:31:36 -08:00
task_mmu.c proc: use untagged_addr() for pagemap_read addresses 2020-12-16 10:56:58 +01:00
task_nommu.c proc: use down_read_killable mmap_sem for /proc/pid/maps 2019-07-12 11:05:46 -07:00
thread_self.c proc: Use new_inode not new_inode_pseudo 2020-06-17 16:40:33 +02:00
uptime.c fs/proc/uptime.c: use ktime_get_boottime_ts64 2018-08-22 10:52:45 -07:00
util.c fs/proc/util.c: include fs/proc/internal.h for name_to_int() 2019-01-04 13:13:45 -08:00
version.c
vmcore.c vmalloc: fix remap_vmalloc_range() bounds checks 2020-04-29 16:33:14 +02:00