From: Cong Wang <cwang@multikernel.io>
To: John Ericson <John.Ericson@obsidian.systems>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Kuniyuki Iwashima <kuniyu@google.com>,
John Ericson <mail@johnericson.me>,
Simon Horman <horms@kernel.org>,
Christian Brauner <brauner@kernel.org>,
David Rheinsberg <david@readahead.eu>,
Sergei Zimmerman <sergei@zimmerman.foo>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] af_unix: fix listen() succeeding on sockets in the wrong state
Date: Thu, 2 Jul 2026 17:36:13 -0700 [thread overview]
Message-ID: <akcD_YywrdvlkTPz@pop-os.localdomain> (raw)
In-Reply-To: <20260702202018.2280336-1-John.Ericson@Obsidian.Systems>
On Thu, Jul 02, 2026 at 04:20:15PM -0400, John Ericson wrote:
> From: John Ericson <mail@johnericson.me>
>
> Commit fd0a109a0f6b ("net, pidfs: prepare for handing out pidfds for
> reaped sk->sk_peer_pid") inserted a `prepare_peercred()` call between
> `err = -EINVAL` and the socket-state check in `unix_listen()`. Since
> `prepare_peercred()` leaves `err` at 0 on success, `listen()` on an
> AF_UNIX socket that is not in `TCP_CLOSE` or `TCP_LISTEN` state (e.g.
> one that is already connected) now silently returns success without
> doing anything, instead of failing with `EINVAL` as it did before.
Do you mind adding a selftest for this?
Thanks,
Cong
prev parent reply other threads:[~2026-07-03 0:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-02 20:20 [PATCH net] af_unix: fix listen() succeeding on sockets in the wrong state John Ericson
2026-07-02 23:17 ` Kuniyuki Iwashima
2026-07-03 0:36 ` Cong Wang [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=akcD_YywrdvlkTPz@pop-os.localdomain \
--to=cwang@multikernel.io \
--cc=John.Ericson@obsidian.systems \
--cc=brauner@kernel.org \
--cc=davem@davemloft.net \
--cc=david@readahead.eu \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mail@johnericson.me \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sergei@zimmerman.foo \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox