[RFC PATCH v2 28/41] net: add SO_PEERCRED_R, SO_PEERGROUPS_R and SCM_CREDENTIALS_R
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Thu Oct 22 03:17:54 UTC 2026
> Services authenticate AF_UNIX peers with SO_PEERCRED, SO_PEERGROUPS and
> SCM_CREDENTIALS, which carry 32 bit ids: a UUID or GUID user shows up
> as the overflow id there.
>
> Add variants with __kernel_uid_r_t ids:
>
> - SO_PEERCRED_R returns a struct __kernel_ucred_r of the peer,
> - SO_PEERGROUPS_R its supplementary groups as __kernel_gid_r_t,
> - SO_PASSCRED_R asks for SCM_CREDENTIALS_R messages, with a struct
> __kernel_ucred_r, next to or instead of SCM_CREDENTIALS (a separate
> option, so receivers sizing their control buffer for SCM_CREDENTIALS
> don't get truncated), and SCM_CREDENTIALS_R can be sent with the same
> privilege rules as SCM_CREDENTIALS.
>
> The classic SCM_CREDENTIALS sending path now shares the checks and pid
> handling with it. Netlink keeps classic ids in its skbs, so it hands out
> the overflow id for UUID senders in SCM_CREDENTIALS_R too.
>
> Assisted-by: Claude:claude-opus-5-5
>
> Signed-off-by: Jan Koester <jan.koester at tuxist.de>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1792552161.git.jan.koester@tuxist.de?part=28
More information about the Linux-security-module-archive
mailing list