Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] This patch removes a userspace-visible AF_UNIX feature with no
deprecation step and no evidence that nobody uses it.
--
af_unix: Remove MSG_OOB.
This patch removes MSG_OOB support from AF_UNIX stream sockets. It also
removes the CONFIG_AF_UNIX_OOB option, the oob_skb field in struct
unix_sock and the SKB_DROP_REASON_UNIX_SKIP_OOB drop reason. After it,
ioctl(SIOCATMARK), EPOLLPRI and SIGURG on AF_UNIX behave as if
CONFIG_AF_UNIX_OOB=n.
quoted hunk ↗ jump to hunk
diff --git a/net/unix/Kconfig b/net/unix/Kconfig
index 6f1783c1659b8..d378726d5eb92 100644
--- a/net/unix/Kconfig
+++ b/net/unix/Kconfig
@@ -16,13 +16,6 @@ config UNIX
Say Y unless you know what you are doing.
-config AF_UNIX_OOB
- bool "UNIX: out-of-bound messages"
- depends on UNIX
- default y
- help
- Support for MSG_OOB in UNIX domain sockets. If unsure, say Y.
-
config UNIX_DIAG
tristate "UNIX: socket monitoring interface"
depends on UNIX
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 96c13682938e1..cc5c7fa40b4d4 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
[ ... ]
quoted hunk ↗ jump to hunk
@@ -2403,12 +2334,7 @@ static int unix_stream_sendmsg(struct socket *sock, struct msghdr *msg,
if (msg->msg_flags & MSG_OOB) {
err = -EOPNOTSUPP;
-#if IS_ENABLED(CONFIG_AF_UNIX_OOB)
- if (len)
- len--;
- else
-#endif
- goto out_err;
+ goto out_err;
}
[Severity: Medium]
Could this break existing userspace on kernels built with the default
config?
The removed AF_UNIX_OOB option was default y, and its help text said "If
unsure, say Y". So most kernels since v5.15 have shipped MSG_OOB support
for AF_UNIX SOCK_STREAM sockets. On those kernels:
send(MSG_OOB) queued a 1-byte OOB skb and raised SIGURG on the peer
through sk_send_sigurg() in queue_oob()
recv(MSG_OOB) read the byte back through unix_stream_recv_urg()
ioctl(SIOCATMARK) reported the mark
unix_poll() returned EPOLLPRI
After this patch, an unprivileged process that calls send() or recv()
with MSG_OOB on a connected AF_UNIX SOCK_STREAM socket always gets
-EOPNOTSUPP. The send side fails in unix_stream_sendmsg() and the recv
side fails in unix_stream_read_generic(). SIOCATMARK now falls through
to -ENOIOCTLCMD in unix_ioctl(), and EPOLLPRI and SIGURG are never
generated.
The commit message says plainly that these features go away. Its only
argument that nobody depends on them is "there is no clear use case". Is
there evidence that no userspace relies on this behaviour?
Would it be safer to first switch AF_UNIX_OOB to default n, or to warn on
use, for a few releases before deleting the symbol? With the option
removed outright, anyone who hits a regression has no way to turn the
feature back on.
Inside the tree, the series looks consistent. Earlier patches remove or
rewrite the selftests that used MSG_OOB: af_unix msg_oob.c and
scm_rights.c, the bpf sockmap_redir case, and the landlock
scoped_signal_test. No references to AF_UNIX_OOB, UNIX_SKIP_OOB or
oob_skb remain.
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116021845.2533130-1-kuniyu%40google.com