af_unix: Reject SIOCATMARK on non-stream sockets
Subsystems (3)
PATCH 1/1 af_unix: Reject SIOCATMARK on non-stream sockets
From: Jiexun Wang <[email protected]>
commit d119775f2bad827edc28071c061fdd4a91f889a5 upstream.
SIOCATMARK reports whether the receive queue is at the urgent mark for MSG_OOB.
In AF_UNIX, MSG_OOB is supported only for SOCK_STREAM sockets. SOCK_DGRAM and SOCK_SEQPACKET reject MSG_OOB in sendmsg() and recvmsg(), so they should not support SIOCATMARK either.
Return -EOPNOTSUPP for non-stream sockets before checking the receive queue.
Fixes 314001f0bf92 ("af_unix: Add OOB support")
Reported-by Yuan Tan <[email protected]>
Reported-by Yifan Wu <[email protected]>
Reported-by Juefei Pu <[email protected]>
Reported-by Xin Liu <[email protected]>
Suggested-by Kuniyuki Iwashima <[email protected]>
Signed-off-by Jiexun Wang <[email protected]>
Signed-off-by Ren Wei <[email protected]>
Reviewed-by Kuniyuki Iwashima <[email protected]>
Signed-off-by Jakub Kicinski <[email protected]>
Signed-off-by Alexander Martyniuk <[email protected]>
---
Backport fix for CVE-2026-52928
net/unix/af_unix.c | 3 +++ 1 file changed, 3 insertions(+)
net/unix/af_unix.c +3 -0
@@ -3139,6 +3139,9 @@ static int unix_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)struct sk_buff *skb;int answ =0 ; +if (sk->sk_type !=SOCK_STREAM ) +return -EOPNOTSUPP ; + skb =skb_peek (&sk->sk_receive_queue);if (skb && skb ==READ_ONCE (unix_sk (sk)->oob_skb)) answ =1 ;
Signature · 1 line
2.43.0
Quoted 4 lines
[PATCH 5.15/6.1/6.6]
af_unix: Reject SIOCATMARK on non-stream socketsBackport fix for CVE-2026-52928. Reject SIOCATMARK in
unix_ioctl()for non-stream sockets.
Queued for 6.6, 6.1 and 5.15, thanks!
--
Thanks,
Sasha