From: Eric Dumazet <eric.dumazet@gmail.com>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
Eric Dumazet <eric.dumazet@gmail.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH] sock: fix /proc/net/sockstat underflow in sk_clone_lock()
Date: Sun, 14 Nov 2021 15:54:18 -0800 [thread overview]
Message-ID: <17179d2c-8dd2-216f-9c32-0f37ddd78cfa@gmail.com> (raw)
In-Reply-To: <51c40730-5b75-fe91-560b-4c4ec4974c83@i-love.sakura.ne.jp>
On 11/14/21 2:43 PM, Tetsuo Handa wrote:
> On 2021/11/15 5:01, Eric Dumazet wrote:
>> On 11/13/21 10:02 PM, Tetsuo Handa wrote:
>>> sk_clone_lock() needs to call get_net() and sock_inuse_inc() together, or
>
> s/sock_inuse_inc/sock_inuse_add/
>
>>> socket_seq_show() will underflow when __sk_free() from sk_free() from
>>> sk_free_unlock_clone() is called.
>>>
>>
>> IMO, a "sock_inuse_get() underflow" is a very different problem,
>
> Yes, a different problem. I found this problem while trying to examine
> https://syzkaller.appspot.com/bug?extid=694120e1002c117747ed where
> somebody might be failing to call get_net() or we might be failing to
> make sure that all timers are synchronously stopped before put_net().
>
>> I suspect this should be fixed with the following patch.
>
> My patch addresses a permanent underflow problem which remains as long as
> that namespace exists. Your patch addresses a temporal underflow problem
> which happens due to calculating the sum without locks. Therefore, we can
> apply both patches if we want.
>
I think your changelog is a bit confusing.
It would really help if you add the Fixes: tag, because if you do
1) It makes the patch much easier to understand, by reading again the the old patch.
2) We can tell if we can merge both fixes in the same submission (if they share the same bug origin)
Thanks !
next prev parent reply other threads:[~2021-11-14 23:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-14 6:02 [PATCH] sock: fix /proc/net/sockstat underflow in sk_clone_lock() Tetsuo Handa
2021-11-14 20:01 ` Eric Dumazet
2021-11-14 22:43 ` Tetsuo Handa
2021-11-14 23:54 ` Eric Dumazet [this message]
2021-11-15 10:16 ` [PATCH v2] " Tetsuo Handa
2021-11-15 14:50 ` patchwork-bot+netdevbpf
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=17179d2c-8dd2-216f-9c32-0f37ddd78cfa@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
/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).