Re: [PATCH net 3/8] idpf: fix possible race in idpf_vport_stop()
From: Jakub Kicinski
Date: Fri Oct 03 2025 - 13:43:45 EST
On Wed, 01 Oct 2025 17:14:13 -0700 Jacob Keller wrote:
> From: Emil Tantilov <emil.s.tantilov@xxxxxxxxx>
>
> 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.
I'm guessing false negatives are okay in how you use the UP flag?
The commit message doesn't really explain why.