]> git.ipfire.org Git - thirdparty/systemd.git/commit
tree-wide: ignore messages with too long control data
authorLennart Poettering <lennart@poettering.net>
Tue, 19 Jan 2021 20:34:20 +0000 (21:34 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 20 Jan 2021 05:05:45 +0000 (14:05 +0900)
commit741bfd7f4e60fdc07ecaadbd93f1196dbee657ca
treed5c6d0bffe4f1e39b97e7bdc1ad39603457c5a45
parent6eab0c6dbab5c85cf6471e559b9a54da4ecd32ac
tree-wide: ignore messages with too long control data

Apparently SELinux inserts control data into AF_UNIX datagrams where we
don't expect it, thus miscalculating the control data. This looks like
something to fix in SELinux, but we still should handle this gracefully
and just drop the offending datagram and continue.

recvmsg_safe() actually already drops the datagram, it's just a matter
of actually ignoring EXFULL (which it generates if control data is too
large) in the right places.

This does this wherever an AF_UNIX/SOCK_DGRAM socket is used with
recvmsg_safe() that is not just internal communication.

Fixes: #17795
Follow-up for: 3691bcf3c5eebdcca5b4f1c51c745441c57a6cd1
src/core/manager.c
src/nspawn/nspawn.c
src/shared/ask-password-api.c