]> git.ipfire.org Git - thirdparty/systemd.git/commit
bpf-restrict-fs: use a 32-bit magic key on big-endian too 42840/head
authorLuca Boccassi <luca.boccassi@gmail.com>
Wed, 1 Jul 2026 16:03:06 +0000 (17:03 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 1 Jul 2026 21:46:45 +0000 (22:46 +0100)
commitf738dcb3b77bf113014b14069796c25667c04980
treeb4cfb639c5c1ce738a6f63a00e352dd50cc9d5d8
parent62c182f0d5c2ec6cbdfaf808d143a8a4c7e01f29
bpf-restrict-fs: use a 32-bit magic key on big-endian too

The inner map is created with a uint32_t key, but the update passed
&magic[i] where magic is a (possibly 64-bit) statfs_f_type_t. On
little-endian the low 32 bits happen to be read; on big-endian 64-bit
(s390x, ppc64 BE) the zero high word is read instead, so every
filesystem collides on key 0 (the allow/deny selector) and
RestrictFileSystems= is silently broken. Pass a truncated copy.

Follow-up for 184b4f78cfbded54a6e06bbe1152256c204a7a73
src/core/bpf-restrict-fs.c