linux-stable/fs/proc
Aleksa Sarai 0337bb53cb procfs: block chmod on /proc/thread-self/comm
commit ccf61486fe upstream.

Due to an oversight in commit 1b3044e39a ("procfs: fix pthread
cross-thread naming if !PR_DUMPABLE") in switching from REG to NOD,
chmod operations on /proc/thread-self/comm were no longer blocked as
they are on almost all other procfs files.

A very similar situation with /proc/self/environ was used to as a root
exploit a long time ago, but procfs has SB_I_NOEXEC so this is simply a
correctness issue.

Ref: https://lwn.net/Articles/191954/
Ref: 6d76fa58b0 ("Don't allow chmod() on the /proc/<pid>/ files")
Fixes: 1b3044e39a ("procfs: fix pthread cross-thread naming if !PR_DUMPABLE")
Cc: stable@vger.kernel.org # v4.7+
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Message-Id: <20230713141001.27046-1-cyphar@cyphar.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-09-23 10:59:55 +02:00
..
Kconfig
Makefile
array.c
base.c procfs: block chmod on /proc/thread-self/comm 2023-09-23 10:59:55 +02:00
cmdline.c
consoles.c
cpuinfo.c
devices.c
fd.c
fd.h
generic.c proc: fix dentry/inode overinstantiating under /proc/${pid}/net 2022-06-14 18:11:41 +02: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
kcore.c arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL 2022-05-15 19:54:46 +02:00
kmsg.c
loadavg.c
meminfo.c proc/meminfo: fix output alignment 2019-10-19 06:32:32 -04:00
namespaces.c
nommu.c
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 dentry/inode overinstantiating under /proc/${pid}/net 2022-06-14 18:11:41 +02:00
proc_sysctl.c sysctl: add a new register_sysctl_init() interface 2023-02-06 07:52:48 +01:00
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 mm: hugetlb: proc: check for hugetlb shared PMD in /proc/PID/smaps 2023-02-22 12:50:28 +01:00
task_nommu.c
thread_self.c proc: Use new_inode not new_inode_pseudo 2020-06-17 16:40:33 +02:00
uptime.c
util.c
version.c
vmcore.c proc/vmcore: fix clearing user buffer by properly using clear_user() 2021-12-01 09:23:31 +01:00