From: Luca Boccassi Date: Fri, 15 Aug 2025 09:42:39 +0000 (+0100) Subject: pidfd-util: force alignment of file_handle union to avoid assert on 32bit X-Git-Tag: v258-rc3~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd51a7d8b5b1c710c3b59e877bc35b2739dcc350;p=thirdparty%2Fsystemd.git pidfd-util: force alignment of file_handle union to avoid assert on 32bit On 32bit the union won't be aligned automatically, needs to be enforced: Assertion '((uintptr_t) _p) % alignof(uint64_t) == 0' failed at src/basic/pidfd-util.c:251, function pidfd_get_inode_id_impl(). Aborting. Follow-up for 9c039ef5ff7f683aa9f7a36cb39bac94a12964b2 --- diff --git a/src/basic/pidfd-util.c b/src/basic/pidfd-util.c index 965f0b86da4..328ed70d529 100644 --- a/src/basic/pidfd-util.c +++ b/src/basic/pidfd-util.c @@ -239,7 +239,7 @@ int pidfd_get_inode_id_impl(int fd, uint64_t *ret) { union { struct file_handle file_handle; uint8_t space[offsetof(struct file_handle, f_handle) + sizeof(uint64_t)]; - } fh = { + } _alignas_(uint64_t) fh = { .file_handle.handle_bytes = sizeof(uint64_t), .file_handle.handle_type = FILEID_KERNFS, };