Search Linux Wireless

Re: [PATCH bpf-next] xdp: Fix race in dev_map_hash_update_elem() when replacing element

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Toke Høiland-Jørgensen <toke@xxxxxxxxxx> writes:

> syzbot found a crash in dev_map_hash_update_elem(), when replacing an
> element with a new one. Jesper correctly identified the cause of the crash
> as a race condition between the initial lookup in the map (which is done
> before taking the lock), and the removal of the old element.
>
> Rather than just add a second lookup into the hashmap after taking the
> lock, fix this by reworking the function logic to take the lock before the
> initial lookup.
>
> Fixes: 6f9d451ab1a3 ("xdp: Add devmap_hash map type for looking up devices by hashed index")
> Reported-and-tested-by: syzbot+4e7a85b1432052e8d6f8@xxxxxxxxxxxxxxxxxxxxxxxxx
> Signed-off-by: Toke Høiland-Jørgensen <toke@xxxxxxxxxx>
> ---

Oops, this wasn't supposed to go to linux-wireless and make-wifi-fast;
apologies for the noise! :)

-Toke



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux