From: "Tantilov, Emil S" <emil.s.tantilov@intel.com>
To: Jakub Kicinski <kuba@kernel.org>,
Jacob Keller <jacob.e.keller@intel.com>
Cc: Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
"Pavan Kumar Linga" <pavan.kumar.linga@intel.com>,
Alexander Lobakin <aleksander.lobakin@intel.com>,
Willem de Bruijn <willemb@google.com>,
Sridhar Samudrala <sridhar.samudrala@intel.com>,
Phani Burra <phani.r.burra@intel.com>,
Piotr Kwapulinski <piotr.kwapulinski@intel.com>,
Simon Horman <horms@kernel.org>,
Radoslaw Tyl <radoslawx.tyl@intel.com>,
Jedrzej Jagielski <jedrzej.jagielski@intel.com>,
Mateusz Polchlopek <mateusz.polchlopek@intel.com>,
Anton Nadezhdin <anton.nadezhdin@intel.com>,
Konstantin Ilichev <konstantin.ilichev@intel.com>,
Milena Olech <milena.olech@intel.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Joshua Hay <joshua.a.hay@intel.com>,
Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
Chittim Madhu <madhu.chittim@intel.com>,
Samuel Salin <Samuel.salin@intel.com>
Subject: Re: [PATCH net 3/8] idpf: fix possible race in idpf_vport_stop()
Date: Mon, 6 Oct 2025 07:49:32 -0700 [thread overview]
Message-ID: <4a128348-48f9-40d7-b5bf-c3f1af27679c@intel.com> (raw)
In-Reply-To: <20251003104332.40581946@kernel.org>
On 10/3/2025 10:43 AM, Jakub Kicinski wrote:
> On Wed, 01 Oct 2025 17:14:13 -0700 Jacob Keller wrote:
>> From: Emil Tantilov <emil.s.tantilov@intel.com>
>>
>> Make sure to clear the IDPF_VPORT_UP bit on entry. The idpf_vport_stop()
>> function is void and once called, the vport teardown is guaranteed to
>> happen. Previously the bit was cleared at the end of the function, which
>> opened it up to possible races with all instances in the driver where
>> operations were conditional on this bit being set. For example, on rmmod
>> callbacks in the middle of idpf_vport_stop() end up attempting to remove
>> MAC address filter already removed by the function:
>> idpf 0000:83:00.0: Received invalid MAC filter payload (op 536) (len 0)
>
> Argh, please stop using the flag based state machines. They CANNOT
> replace locking. If there was proper locking in place it wouldn't
> have mattered when we clear the flag.
This patch is resolving a bug in the current logic of how the flag is
used (not being atomic and not being cleared properly). I don't think
there is an existing lock in place to address this issue, though we are
looking to refactor the code over time to remove and/or limit how these
flags are used.
>
> I'm guessing false negatives are okay in how you use the UP flag?
> The commit message doesn't really explain why.
I am not sure I understand the question completely, if you mean that the
flag is cleared before the vport is actually brought down, I did touch
on it at the beginning of the description, once we enter
idpf_vport_stop() we know for sure that the vport will be brought down
and that is how the present checks in the driver for the UP flag are
being used. Specifically in the scenario that exposed this issue, the
driver will send a message in the middle of idpf_vport_down() after
checking the flag.
Thanks,
Emil
next prev parent reply other threads:[~2025-10-06 14:49 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-02 0:14 [PATCH net 0/8] Intel Wired LAN Driver Updates 2025-10-01 (idpf, ixgbe, ixgbevf) Jacob Keller
2025-10-02 0:14 ` [PATCH net 1/8] idpf: cleanup remaining SKBs in PTP flows Jacob Keller
2025-10-02 0:14 ` [PATCH net 2/8] idpf: convert vport state to bitmap Jacob Keller
2025-10-02 0:14 ` [PATCH net 3/8] idpf: fix possible race in idpf_vport_stop() Jacob Keller
2025-10-03 17:43 ` Jakub Kicinski
2025-10-06 14:49 ` Tantilov, Emil S [this message]
2025-10-06 17:26 ` Jakub Kicinski
2025-10-07 0:07 ` Tantilov, Emil S
2025-10-08 21:41 ` Jacob Keller
2025-10-13 18:13 ` Jakub Kicinski
2025-10-22 22:49 ` Tantilov, Emil S
2025-10-02 0:14 ` [PATCH net 4/8] ixgbevf: fix getting link speed data for E610 devices Jacob Keller
2025-10-02 0:14 ` [PATCH net 5/8] ixgbe: handle IXGBE_VF_GET_PF_LINK_STATE mailbox operation Jacob Keller
2025-10-02 0:14 ` [PATCH net 6/8] ixgbevf: fix mailbox API compatibility by negotiating supported features Jacob Keller
2025-10-02 0:14 ` [PATCH net 7/8] ixgbe: handle IXGBE_VF_FEATURES_NEGOTIATE mbox cmd Jacob Keller
2025-10-02 0:14 ` [PATCH net 8/8] ixgbe: fix too early devlink_free() in ixgbe_remove() Jacob Keller
2025-10-03 17:42 ` [PATCH net 0/8] Intel Wired LAN Driver Updates 2025-10-01 (idpf, ixgbe, ixgbevf) Jakub Kicinski
2025-10-04 0:58 ` Jacob Keller
2025-10-06 15:27 ` Alexander Lobakin
2025-10-06 21:59 ` Jacob Keller
2025-10-06 23:58 ` Jacob Keller
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=4a128348-48f9-40d7-b5bf-c3f1af27679c@intel.com \
--to=emil.s.tantilov@intel.com \
--cc=Samuel.salin@intel.com \
--cc=aleksander.lobakin@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anton.nadezhdin@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=jedrzej.jagielski@intel.com \
--cc=joshua.a.hay@intel.com \
--cc=konstantin.ilichev@intel.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=madhu.chittim@intel.com \
--cc=mateusz.polchlopek@intel.com \
--cc=milena.olech@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.kumar.linga@intel.com \
--cc=phani.r.burra@intel.com \
--cc=piotr.kwapulinski@intel.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=radoslawx.tyl@intel.com \
--cc=sridhar.samudrala@intel.com \
--cc=willemb@google.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
all inboxes | Powered by JetHome®