]> git.ipfire.org Git - thirdparty/systemd.git/commit
tree-wide: don't play games with alignment around file_handle
authorLennart Poettering <lennart@poettering.net>
Mon, 18 Aug 2025 07:09:59 +0000 (09:09 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 18 Aug 2025 12:50:55 +0000 (21:50 +0900)
commitc24f405aceb37104c663da332ba9d66d19c0d72b
tree6cc45f03aa447b2e1e30565de66bb676a3fbd8e8
parent73c4350fdae90a0f2988d0733c10f30b74cadf5b
tree-wide: don't play games with alignment around file_handle

The payload of a file_handle structure is not 64bit aligned. So far used
_alignas_() to align it to 64bit as a whole, which by accident has the
side-effect that the payload ends up being aligned to 64bit too, but
this is ugly, because it's really just an accident...

Let's do this properly, and just use proper unaligned 64bit reads to
access the field, and do not assume aligning the structure as a whole
also aligns the payload part of it.

Follow-up for: fd51a7d8b5b1c710c3b59e877bc35b2739dcc350
src/basic/cgroup-util.c
src/basic/pidfd-util.c