]> git.ipfire.org Git - thirdparty/systemd.git/commit
coredump: use unaligned_read_ne{32,64}() to parse auxv
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 21 Mar 2023 23:49:49 +0000 (08:49 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 22 Mar 2023 15:17:13 +0000 (16:17 +0100)
commit9b032f932c4172fac379234d9d42cf2b266ccaea
tree9f6da6c886284f2aef1f72af346f5a963d8fa811
parentbf9f07a62966043c0f1fd7ac4a249790643d1f9a
coredump: use unaligned_read_ne{32,64}() to parse auxv

Fixes a bug introduced by 3e4d0f6cf99f8677edd6a237382a65bfe758de03.

The auxv metadata is unaligned, as the length of the prefix
"COREDUMP_PROC_AUXV=" is 19. Hence, parse_auxv{32,64}() may triger
an undefined behavior (or at least cause slow down), which can be
detected when running on an undefined behavior sanitizer.

This also introduces a macro to define `parse_auxv{32,64}()`.

Fixes #26912.
src/coredump/coredump.c