]> git.ipfire.org Git - thirdparty/systemd.git/commit
base-filesystem: create /proc, /sys, /dev mount points as 0555
authorLennart Poettering <lennart@poettering.net>
Tue, 2 May 2023 08:44:14 +0000 (10:44 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 2 May 2023 10:06:03 +0000 (12:06 +0200)
commit7243cefec10ecab1248a26f443b797a8655fc14d
tree95b2aa55fd095bb2916e7590031c7b264cced260
parentab13274a19ee310ed8569612a862b977d054ed6c
base-filesystem: create /proc, /sys, /dev mount points as 0555

These inodes are going to be overmounted anyway, hence let's create them
with access mode 555, so that they are as close to being immutable as
regular UNIX access modes allow them to be. In other words: this takes
the "w" mode away for root. This of course usually has little effect --
unless CAP_DAC_OVERRIDE is dropped. But at the very least it makes the
point clear that inodes should be considered immutable.

(I intended to make this 0000 originally, but that doesn't work, as many
tools – including our own – have fallback paths that when they see
ENOENT in /proc/ they can handle this gracefully. But changing the mode
to 000 would turn this to EACCES - something they usually have no
fallback path for)
src/shared/base-filesystem.c