Netdev List
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
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>,
	Cong Wang <cwang@multikernel.io>,
	 Sergei Zimmerman <sergei@zimmerman.foo>,
	netdev@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2 1/3] af_unix: fix listen() succeeding on sockets in the wrong state
Date: Fri, 03 Jul 2026 15:17:46 +0200	[thread overview]
Message-ID: <20260703-eisdiele-strahl-karneval-28355945318a@brauner> (raw)
In-Reply-To: <20260703081416.2583118-1-John.Ericson@Obsidian.Systems>

> 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.
> 
> Fixes: fd0a109a0f6b ("net, pidfs: prepare for handing out pidfds for reaped sk->sk_peer_pid")
> Signed-off-by: John Ericson <mail@johnericson.me>

Reviewed-by: Christian Brauner (Amutable) <brauner@kernel.org>

-- 
Christian Brauner <brauner@kernel.org>

      parent reply	other threads:[~2026-07-03 13:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-03  8:14 [PATCH net v2 1/3] af_unix: fix listen() succeeding on sockets in the wrong state John Ericson
2026-07-03  8:14 ` [PATCH net v2 2/3] selftests/net/af_unix: test listen() rejects wrong socket states John Ericson
2026-07-03 13:17   ` Christian Brauner
2026-07-04  1:54   ` Kuniyuki Iwashima
2026-07-03  8:14 ` [PATCH net-next v2 3/3] af_unix: Clean up error handling in unix_listen() John Ericson
2026-07-03 13:17   ` Christian Brauner
2026-07-04  1:46   ` Kuniyuki Iwashima
2026-07-03 13:17 ` Christian Brauner [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=20260703-eisdiele-strahl-karneval-28355945318a@brauner \
    --to=brauner@kernel.org \
    --cc=John.Ericson@Obsidian.Systems \
    --cc=cwang@multikernel.io \
    --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