From: Stefan Wiehler <stefan.wiehler@nokia.com>
To: Paolo Abeni <pabeni@redhat.com>
Cc: "David S. Miller" <davem@davemloft.net>,
David Ahern <dsahern@kernel.org>,
Eric Dumazet <edumazet@google.com>,
Simon Horman <horms@kernel.org>, David Ahern <dsahern@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com, Jakub Kicinski <kuba@kernel.org>,
Breno Leitao <leitao@debian.org>
Subject: Re: [PATCH net v2] ipmr: Fix access to mfc_cache_list without lock held
Date: Thu, 21 Nov 2024 15:47:54 +0100 [thread overview]
Message-ID: <ddd0019a-477e-469b-bef7-4e995a532f93@nokia.com> (raw)
In-Reply-To: <7003f775-7389-41ed-95e5-1e0e07f3f6fb@redhat.com>
> On 11/15/24 17:55, Paolo Abeni wrote:
>> On 11/15/24 17:07, Stefan Wiehler wrote:
>>>> On Fri, 15 Nov 2024 01:16:27 -0800 Breno Leitao wrote:
>>>>> This one seems to be discussed in the following thread already.
>>>>>
>>>>> https://lore.kernel.org/all/20241017174109.85717-1-stefan.wiehler@nokia.com/
>>>>
>>>> That's why it rung a bell..
>>>> Stefan, are you planning to continue with the series?
>>>
>>> Yes, sorry for the delay, went on vacation and was busy with other tasks, but
>>> next week I plan to continue (i.e. refactor using refcount_t).
>>
>> I forgot about that series and spent a little time investigating the
>> scenario.
>>
>> I think we don't need a refcount: the tables are freed only at netns
>> cleanup time, so the netns refcount is enough to guarantee that the
>> tables are not deleted when escaping the RCU section.
>>
>> Some debug assertions could help clarify, document and make the schema
>> more robust to later change.
>>
>> Side note, I think we need to drop the RCU lock moved by:
>>
>> https://lore.kernel.org/all/20241017174109.85717-2-stefan.wiehler@nokia.com/
>>
>> as the seqfile core can call blocking functions - alloc(GFP_KERNEL) -
>> between ->start() and ->stop().
>>
>> The issue is pre-existent to that patch, and even to the patch
>> introducing the original RCU() - the old read_lock() created an illegal
>> atomic scope - but I think we should address it while touching this code.
>
> @Stefan: are you ok if I go ahead with this work, or do you prefer
> finish it yourself?
Please go ahead, I have neither the expertise in the net subsystem nor the time
to ramp-up (since this is just a side finding for us right now) to proceed with
your proposal. I'll follow the discussion though and hope to learn something
along the way!
Kind regards,
Stefan
next prev parent reply other threads:[~2024-11-21 14:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-08 14:08 Breno Leitao
2024-11-11 1:00 ` David Ahern
2024-11-14 3:10 ` Jakub Kicinski
2024-11-14 8:55 ` Breno Leitao
2024-11-14 15:03 ` Jakub Kicinski
2024-11-15 9:16 ` Breno Leitao
2024-11-15 16:00 ` Jakub Kicinski
2024-11-15 16:07 ` Stefan Wiehler
2024-11-15 16:55 ` Paolo Abeni
2024-11-15 19:16 ` Jakub Kicinski
2024-11-20 9:54 ` Paolo Abeni
2024-11-21 14:47 ` Stefan Wiehler [this message]
2024-11-14 3:20 ` 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=ddd0019a-477e-469b-bef7-4e995a532f93@nokia.com \
--to=stefan.wiehler@nokia.com \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--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
Powered by JetHome