From: Kuniyuki Iwashima <kuniyu@google.com>
To: Dickson Wu <dickson.wu@certik.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Willem de Bruijn <willemb@google.com>
Subject: Re: [PATCH net] af_unix: return 0 for SIOCATMARK on listeners
Date: Sun, 29 Nov 2026 07:00:27 +0000 [thread overview]
Message-ID: <awvNNIlXyBdqjlRz@google.com> (raw)
In-Reply-To: <20261127-unix-atmark2-v1-1-d164028cdae7@certik.com>
On Fri, 27 Nov 2026 16:04:41 +0000, Dickson Wu wrote:
> AF_UNIX listeners cannot receive out-of-band data, but SIOCATMARK
> currently peeks at sk_receive_queue. That queue contains connection
> requests, and unix_accept() can dequeue and free its head under
> sk_receive_queue.lock without taking u->iolock. As a result, SIOCATMARK
> can read the freed skb.
>
> Take u->iolock and the state lock in stream receive order. Return 0
> for TCP_LISTEN, and keep both locks over the receive-queue inspection.
> This prevents a concurrent listen() transition between the state check
> and the queue access.
>
> Fixes: e400cfa38bb0 ("af_unix: Fix wrong ioctl(SIOCATMARK) when consumed OOB skb is at the head.")
> Signed-off-by: Dickson Wu <dickson.wu@certik.com>
> ---
> This is the listener case left after d119775f2bad ("af_unix: Reject
> SIOCATMARK on non-stream sockets"). The earlier queue-lock proposal
> for the same lifetime problem was redirected toward rejecting
> unsupported sockets:
> https://lore.kernel.org/netdev/f6cbbc8da90e95584847b5ceb60aae830d1631c2.1775731983.git.wangjiexun2025@gmail.com/
>
> net-next 387f48167305 ("af_unix: Remove MSG_OOB.") removes SIOCATMARK
> along with AF_UNIX OOB, so this is only for net and stable.
not worth a conflict.
pw-bot: rejected
prev parent reply other threads:[~2026-11-29 7:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 16:04 [PATCH net] af_unix: return 0 for SIOCATMARK on listeners Dickson Wu via B4 Relay
2026-11-27 16:04 ` Dickson Wu
2026-11-29 7:00 ` Kuniyuki Iwashima [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=awvNNIlXyBdqjlRz@google.com \
--to=kuniyu@google.com \
--cc=davem@davemloft.net \
--cc=dickson.wu@certik.com \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.