[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240813000128.95086-1-kuniyu@amazon.com>
Date: Mon, 12 Aug 2024 17:01:28 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <fw@...len.de>
CC: <davem@...emloft.net>, <edumazet@...gle.com>, <kerneljasonxing@...il.com>,
<kuba@...nel.org>, <kuniyu@...zon.com>, <netdev@...r.kernel.org>,
<pabeni@...hat.com>, <syzbot+8ea26396ff85d23a8929@...kaller.appspotmail.com>
Subject: Re: [PATCH net] tcp: prevent concurrent execution of tcp_sk_exit_batch
From: Florian Westphal <fw@...len.de>
Date: Tue, 13 Aug 2024 01:52:59 +0200
> Kuniyuki Iwashima <kuniyu@...zon.com> wrote:
> > > ... because refcount_dec() of tw_refcount unexpectedly dropped to 0.
> > >
> > > This doesn't seem like an actual bug (no tw sockets got lost and I don't
> > > see a use-after-free) but as erroneous trigger of debug check.
> >
> > I guess the reason you don't move the check back to tcp_sk_exit() is
>
> No, it would not work. .exit runs before .exit_batch, we'd splat.
ahh, sorry, somehow I checked the order of exit_batch_rtnl() and
ops_exit_list() ... :/
>
> Before e9bd0cca09d1 ordering doesn't matter because
> refcount_dec_and_test is used consistently, so it was not relevant
> if the 0-transition occured from .exit or later via inet_twsk_kill.
>
> > to catch a potential issue explained in solution 4 in the link, right ?
>
> Yes, it would help to catch such issue wrt. twsk lifetime.
> Having the WARN ensures no twsk can escape .exit_batch completion.
>
> E.g. if twsk destructors in the future refer to some other
> object that has to be released before netns pointers become invalid
> or something like that.
>
> Does that make sense?
Yes.
> Otherwise I'm open to alternative approaches.
> Or we can wait until syzbot finds a reproducer, I don't think its
> a real/urgent bug.
Agree, also I guess syzbot will not find a repro as it's been
3 months since the first report.
Thanks!
Powered by blists - more mailing lists