diff options
| author | Jori Koolstra <jkoolstra@xs4all.nl> | 2026-08-13 12:28:17 -0400 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-08-17 18:14:52 -0700 |
| commit | fd8756fa1487577535d6294ae7cc67888b19ae2a (patch) | |
| tree | 14ebfe76e92447fdb92d383532b6f1d805475c4a /tools/perf/scripts/python/flamegraph.py | |
| parent | 48b84acc5e18655f2a02fe2a043330d03f939ffe (diff) | |
net: af_unix: useful handling of LSM denials on SCM_RIGHTS
Right now if some LSM such as Smack denies an AF_UNIX socket peer to
receive an SCM_RIGHTS fd, the SCM_RIGHTS fd array will be cut short at
that point, and MSG_CTRUNC is set on return of recvmsg(). This is
highly problematic behaviour, because it leaves the receiver
wondering what happened. As per man page MSG_CTRUNC is supposed to
indicate that the control buffer was sized too short, but suddenly
a permission error might result in the exact same flag being set.
Moreover, the receiver has no chance to determine how many fds got
originally sent and how many were suppressed.[1]
Add a SO_RIGHTS_NOTRUNC option to UNIX sockets to enable more useful
handling of LSM denials when receiving SCM_RIGHTS messages: instead of
truncating the message at the first blocked fd, keep every fd slot
and store the LSM errno in the blocked slot. The socket option is
inherited by the child accept() socket if set on the listen() socket.
[1]: https://github.com/uapi-group/kernel-features#useful-handling-of-lsm-denials-on-scm_rights
Reviewed-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Jori Koolstra <jkoolstra@xs4all.nl>
Link: https://patch.msgid.link/20260813162818.149248-4-jkoolstra@xs4all.nl
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/flamegraph.py')
0 files changed, 0 insertions, 0 deletions
