netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <edumazet@google.com>
Cc: <davem@davemloft.net>, <kuba@kernel.org>, <kuni1840@gmail.com>,
	<kuniyu@amazon.com>, <netdev@vger.kernel.org>,
	<pabeni@redhat.com>
Subject: Re: [PATCH v2 net-next 00/14] af_unix: Rework GC.
Date: Fri, 16 Feb 2024 13:42:09 -0800	[thread overview]
Message-ID: <20240216214209.69408-1-kuniyu@amazon.com> (raw)
In-Reply-To: <CANn89i+oURrHhvODH0U9gzR869r_3EK5zuRBNYAV_Frrj_3GRA@mail.gmail.com>

From: Eric Dumazet <edumazet@google.com>
Date: Fri, 16 Feb 2024 22:28:11 +0100
> On Fri, Feb 16, 2024 at 10:06 PM Kuniyuki Iwashima <kuniyu@amazon.com> wrote:
> >
> > When we pass a file descriptor to an AF_UNIX socket via SCM_RIGTHS,
> > the underlying struct file of the inflight fd gets its refcount bumped.
> > If the fd is of an AF_UNIX socket, we need to track it in case it forms
> > cyclic references.
> >
> > Let's say we send a fd of AF_UNIX socket A to B and vice versa and
> > close() both sockets.
> >
> > When created, each socket's struct file initially has one reference.
> > After the fd exchange, both refcounts are bumped up to 2.  Then, close()
> > decreases both to 1.  From this point on, no one can touch the file/socket.
> 
> Note that I have pending syzbot reports about af_unix. (apparently
> syzbot found its way with SO_PEEK_OFF)

Interesting :)

> 
> I would prefer we wait a bit before reworking the whole thing.

Sure, I'll wait to avoid a sad situation that large refactoring
happens to fix the bug and we need to backport or cook another
fix for stable.

      reply	other threads:[~2024-02-16 21:42 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 21:05 [PATCH v2 net-next 00/14] af_unix: Rework GC Kuniyuki Iwashima
2024-02-16 21:05 ` [PATCH v2 net-next 01/14] af_unix: Add struct unix_vertex in struct unix_sock Kuniyuki Iwashima
2024-02-16 21:05 ` [PATCH v2 net-next 02/14] af_unix: Allocate struct unix_edge for each inflight AF_UNIX fd Kuniyuki Iwashima
2024-02-16 21:05 ` [PATCH v2 net-next 03/14] af_unix: Link struct unix_edge when queuing skb Kuniyuki Iwashima
2024-02-20 12:11   ` Paolo Abeni
2024-02-20 17:44     ` Kuniyuki Iwashima
2024-02-20 17:53       ` Paolo Abeni
2024-02-16 21:05 ` [PATCH v2 net-next 04/14] af_unix: Save listener for embryo socket Kuniyuki Iwashima
2024-02-16 21:05 ` [PATCH v2 net-next 05/14] af_unix: Fix up unix_edge.successor " Kuniyuki Iwashima
2024-02-16 21:05 ` [PATCH v2 net-next 06/14] af_unix: Bulk update unix_tot_inflight/unix_inflight when queuing skb Kuniyuki Iwashima
2024-02-16 21:05 ` [PATCH v2 net-next 07/14] af_unix: Detect Strongly Connected Components Kuniyuki Iwashima
2024-02-16 21:05 ` [PATCH v2 net-next 08/14] af_unix: Save O(n) setup of Tarjan's algo Kuniyuki Iwashima
2024-02-16 21:05 ` [PATCH v2 net-next 09/14] af_unix: Skip GC if no cycle exists Kuniyuki Iwashima
2024-02-20 12:56   ` Paolo Abeni
2024-02-20 17:47     ` Kuniyuki Iwashima
2024-02-16 21:05 ` [PATCH v2 net-next 10/14] af_unix: Avoid Tarjan's algorithm if unnecessary Kuniyuki Iwashima
2024-02-16 21:05 ` [PATCH v2 net-next 11/14] af_unix: Assign a unique index to SCC Kuniyuki Iwashima
2024-02-16 21:05 ` [PATCH v2 net-next 12/14] af_unix: Detect dead SCC Kuniyuki Iwashima
2024-02-16 21:05 ` [PATCH v2 net-next 13/14] af_unix: Replace garbage collection algorithm Kuniyuki Iwashima
2024-02-16 21:05 ` [PATCH v2 net-next 14/14] selftest: af_unix: Test GC for SCM_RIGHTS Kuniyuki Iwashima
2024-02-16 21:28 ` [PATCH v2 net-next 00/14] af_unix: Rework GC Eric Dumazet
2024-02-16 21:42   ` 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=20240216214209.69408-1-kuniyu@amazon.com \
    --to=kuniyu@amazon.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).