linux/arch
Jori Koolstra fd8756fa14 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>
2026-08-17 18:14:52 -07:00
..
alpha net: af_unix: useful handling of LSM denials on SCM_RIGHTS 2026-08-17 18:14:52 -07:00
arc ARC: configs: Drop redundant I2C_DESIGNWARE_PLATFORM 2026-07-10 15:26:11 -07:00
arm nuvoton: First batch of ARM arch fixes for 7.2 2026-08-04 21:25:25 +02:00
arm64 17 hotfixes. 15 are cc:stable. 16 are for MM. 2026-08-06 20:29:38 -07:00
csky ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
hexagon uaccess: unify inline vs outline copy_{from,to}_user() selection 2026-05-28 21:24:44 -07:00
loongarch LoongArch: BPF: Fix memory leak in bpf_jit_free() 2026-07-24 16:33:08 +08:00
m68k m68k: Define NR_CPUS to 1 2026-08-12 13:53:44 +02:00
microblaze microblaze: restore the page alignment of swapper_pg_dir 2026-08-04 20:02:00 -07:00
mips net: af_unix: useful handling of LSM denials on SCM_RIGHTS 2026-08-17 18:14:52 -07:00
nios2 uaccess: unify inline vs outline copy_{from,to}_user() selection 2026-05-28 21:24:44 -07:00
openrisc mm.git review status for mm-hotfixes-stable..mm-nonmm-stable 2026-06-21 13:20:19 -07:00
parisc net: af_unix: useful handling of LSM denials on SCM_RIGHTS 2026-08-17 18:14:52 -07:00
powerpc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-08-13 11:00:14 -07:00
riscv RISC-V updates for v7.2-rc6 2026-08-02 12:12:21 -07:00
s390 KVM: s390: Misc fixes for 7.2 2026-08-06 15:47:46 +02:00
sh Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
sparc net: af_unix: useful handling of LSM denials on SCM_RIGHTS 2026-08-17 18:14:52 -07:00
um um: vector: fix use-after-free in vector_mmsg_rx() 2026-07-23 21:31:14 +02:00
x86 - Fix MCE CMCI discovery initialization ordering bug 2026-08-08 16:43:07 -07:00
xtensa mm.git review status for mm-hotfixes-stable..mm-nonmm-stable 2026-06-21 13:20:19 -07:00
.gitignore
Kconfig Locking updates for v7.2: 2026-06-15 14:21:14 +05:30