Commit 6487330
bpf: Add a recursion check to prevent loops in bpf_timer
Do not schedule timer/wq operation on a cpu that is in irq_work
callback that is processing async_cmds queue.
Otherwise the following loop is possible:
bpf_timer_start() -> bpf_async_schedule_op() -> irq_work_queue().
irqrestore -> bpf_async_irq_worker() -> tracepoint -> bpf_timer_start().
Fixes: 1bfbc26 ("bpf: Enable bpf_timer and bpf_wq in any context")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20260204055147.54960-4-alexei.starovoitov@gmail.com1 parent 67ee5ad commit 6487330
1 file changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1427 | 1427 | | |
1428 | 1428 | | |
1429 | 1429 | | |
| 1430 | + | |
| 1431 | + | |
1430 | 1432 | | |
1431 | 1433 | | |
1432 | 1434 | | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
1433 | 1447 | | |
1434 | 1448 | | |
1435 | 1449 | | |
| |||
1628 | 1642 | | |
1629 | 1643 | | |
1630 | 1644 | | |
| 1645 | + | |
1631 | 1646 | | |
1632 | 1647 | | |
1633 | 1648 | | |
1634 | 1649 | | |
1635 | 1650 | | |
1636 | 1651 | | |
1637 | 1652 | | |
| 1653 | + | |
1638 | 1654 | | |
1639 | 1655 | | |
1640 | 1656 | | |
| |||
0 commit comments