]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/portable/portable.c
tree-wide: make sure our control buffers are properly aligned 15623/head
authorLennart Poettering <lennart@poettering.net>
Fri, 24 Apr 2020 21:54:25 +0000 (23:54 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 7 May 2020 12:39:44 +0000 (14:39 +0200)
commitfb29cdbef21f1d66e2ebe600601897b6578d3959
treeb0e0b17b4259ea901f706f8e365ed3b3817f12dd
parent0d9d333672167f7c4586c1708eee53066ce8f55d
tree-wide: make sure our control buffers are properly aligned

We always need to make them unions with a "struct cmsghdr" in them, so
that things properly aligned. Otherwise we might end up at an unaligned
address and the counting goes all wrong, possibly making the kernel
refuse our buffers.

Also, let's make sure we initialize the control buffers to zero when
sending, but leave them uninitialized when reading.

Both the alignment and the initialization thing is mentioned in the
cmsg(3) man page.
22 files changed:
src/basic/socket-util.c
src/basic/socket-util.h
src/core/manager.c
src/coredump/coredump.c
src/home/homed-manager.c
src/import/importd.c
src/journal/journald-server.c
src/journal/journald-stream.c
src/journal/journald-syslog.c
src/libsystemd-network/icmp6-util.c
src/libsystemd-network/sd-dhcp-client.c
src/libsystemd-network/sd-dhcp-server.c
src/libsystemd/sd-bus/bus-socket.c
src/libsystemd/sd-device/device-monitor.c
src/nspawn/nspawn.c
src/portable/portable.c
src/resolve/resolved-dns-stream.c
src/resolve/resolved-manager.c
src/shared/ask-password-api.c
src/timesync/timesyncd-manager.c
src/udev/udev-ctrl.c
src/udev/udevd.c