Re: Potential deadlock in bpf_htab_percpu_lru

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

 



On 7/8/24 9:21 AM, Priya Bala Govindasamy wrote:
Hello,

We are developing a tool to perform static analysis on the bpf
subsystem to detect locking violations. Our tool reported the
raw_spin_lock_irqsave() in bpf_percpu_lru_pop_free(). This function is
used by htab_percpu_lru_map_update_elem() which can be called from an
NMI. A deadlock can happen if a bpf program holding the lock is
interrupted by the same program in NMI. The report was generated for

Thanks for the report.

Similar issue (and its solution) has already been discussed before for other maps. Please help to post an official fix with the test. Thanks.

Here is some reference,

Hsin-Wei Hung had reported similar case for the queue/stack map: https://lore.kernel.org/bpf/CABcoxUbYwuZUL-xm1+5juO42nJMgpQX7cNyQELYz+g2XkZi9TQ@xxxxxxxxxxxxxx/

The solution should be similar here, use in_nmi() and trylock() like commit a34a9f1a19af ("bpf: Avoid deadlock when using queue and stack maps from NMI").





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux