summaryrefslogtreecommitdiff
path: root/units/systemd-modules-load.service.in
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-06-23 11:46:41 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-07-20 18:02:00 +0200
commitb00674347337b7531c92fdb65590ab253bb57538 (patch)
tree3b45aad61216195c958bf50323e4883f2db04936 /units/systemd-modules-load.service.in
parent55f79382622187834113dcbce9166b778da3d62c (diff)
downloadsystemd-b00674347337b7531c92fdb65590ab253bb57538.tar.gz
basic/unit-name: do not use strdupa() on a pathv247.8
The path may have unbounded length, for example through a fuse mount. CVE-2021-33910: attacked controlled alloca() leads to crash in systemd and ultimately a kernel panic. Systemd parses the content of /proc/self/mountinfo and each mountpoint is passed to mount_setup_unit(), which calls unit_name_path_escape() underneath. A local attacker who is able to mount a filesystem with a very long path can crash systemd and the whole system. https://bugzilla.redhat.com/show_bug.cgi?id=1970887 The resulting string length is bounded by UNIT_NAME_MAX, which is 256. But we can't easily check the length after simplification before doing the simplification, which in turns uses a copy of the string we can write to. So we can't reject paths that are too long before doing the duplication. Hence the most obvious solution is to switch back to strdup(), as before 7410616cd9dbbec97cf98d75324da5cda2b2f7a2. (cherry picked from commit 441e0115646d54f080e5c3bb0ba477c892861ab9) (cherry picked from commit 764b74113e36ac5219a4b82a05f311b5a92136ce) (cherry picked from commit 4a1c5f34bd3e1daed4490e9d97918e504d19733b)
Diffstat (limited to 'units/systemd-modules-load.service.in')
0 files changed, 0 insertions, 0 deletions