coredump filter: fix stack overflow with =all
authorLuca Boccassi <bluca@debian.org>
Wed, 26 Apr 2023 13:18:04 +0000 (14:18 +0100)
committerLuca Boccassi <bluca@debian.org>
Wed, 26 Apr 2023 14:04:06 +0000 (15:04 +0100)
commit37232d55a7bcace37280e28b207c85f5ca9b3f6b
tree3a8c9118a9782e70e273fc1ac865b4e1e96b50c3
parent947579e5e253c08592d30494e980db6d7211b7a9
coredump filter: fix stack overflow with =all

We translate 'all' to UNIT64_MAX, which has a lot more 'f's. Use the
helper macro, since a decimal uint64_t will always be >> than a hex
representation.

root@image:~# systemd-run -t --property CoredumpFilter=all ls /tmp
Running as unit: run-u13.service
Press ^] three times within 1s to disconnect TTY.
*** stack smashing detected ***: terminated
[137256.320511] systemd[1]: run-u13.service: Main process exited, code=dumped, status=6/ABRT
[137256.320850] systemd[1]: run-u13.service: Failed with result 'core-dump'.
src/basic/macro.h
src/shared/coredump-util.c