[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7e193767.4214.1872bf50476.Coremail.windhl@126.com>
Date: Wed, 29 Mar 2023 14:01:30 +0800 (CST)
From: "Liang He" <windhl@....com>
To: "Jakub Kicinski" <kuba@...nel.org>
Cc: davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
netdev@...r.kernel.org
Subject: Re:Re: [PATCH] rionet: Fix refcounting bugs
Hi, Jakub,
First, thanks for you reviewing our patch again.
At 2023-03-29 10:10:51, "Jakub Kicinski" <kuba@...nel.org> wrote:
>On Tue, 28 Mar 2023 12:50:06 +0800 Liang He wrote:
>> In rionet_start_xmit(), we should put the refcount_inc()
>> before we add *skb* into the queue, otherwise it may cause
>> the consumer to prematurely call refcount_dec().
>
>Are you sure the race can happen? Look around the code, please.
We commit this patch based on the pattern we learned from these commits,
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.3-rc4&id=bb765d1c331f62b59049d35607ed2e365802bef9
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.3-rc4&id=47a017f33943278570c072bc71681809b2567b3a
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.3-rc4&id=b780d7415aacec855e2f2370cbf98f918b224903
If it is indeed in different context which makes our pattern failed, please kindly pointing out it.
>
>> Besides, before the next rionet_queue_tx_msg() when we
>> meet the 'RIONET_MAC_MATCH', we should also call
>> refcount_inc() before the skb is added into the queue.
>
>And why is that?
We think it should be better to keep the consistent refcounting-operation
when we put the *skb* into the queue.
>
>As far as I can tell your patch reorders something that doesn't matter
>and then adds a bug :|
If there is any bug, can you kindly tell us?
Thanks,
Liang
Powered by blists - more mailing lists