Commit 7d49635
bpf: Tighten conditions when timer/wq can be called synchronously
Though hrtimer_start/cancel() inlines all of the smaller helpers in
hrtimer.c and only call timerqueue_add/del() from lib/timerqueue.c where
everything is not traceable and not kprobe-able (because all files in
lib/ are not traceable), there are tracepoints within hrtimer that are
called with locks held. Therefore prevent the deadlock by tightening
conditions when timer/wq can be called synchronously.
hrtimer/wq are using raw_spin_lock_irqsave(), so irqs_disabled() is enough.
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-2-alexei.starovoitov@gmail.com1 parent 5e6e1dc commit 7d49635
1 file changed
Lines changed: 10 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1430 | 1430 | | |
1431 | 1431 | | |
1432 | 1432 | | |
1433 | | - | |
1434 | | - | |
1435 | 1433 | | |
1436 | 1434 | | |
1437 | 1435 | | |
| |||
1473 | 1471 | | |
1474 | 1472 | | |
1475 | 1473 | | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
1476 | 1479 | | |
1477 | 1480 | | |
1478 | 1481 | | |
| |||
1500 | 1503 | | |
1501 | 1504 | | |
1502 | 1505 | | |
1503 | | - | |
| 1506 | + | |
1504 | 1507 | | |
1505 | 1508 | | |
1506 | 1509 | | |
| |||
1524 | 1527 | | |
1525 | 1528 | | |
1526 | 1529 | | |
1527 | | - | |
| 1530 | + | |
1528 | 1531 | | |
1529 | 1532 | | |
1530 | 1533 | | |
| |||
1650 | 1653 | | |
1651 | 1654 | | |
1652 | 1655 | | |
1653 | | - | |
| 1656 | + | |
1654 | 1657 | | |
1655 | 1658 | | |
1656 | 1659 | | |
| |||
3161 | 3164 | | |
3162 | 3165 | | |
3163 | 3166 | | |
3164 | | - | |
| 3167 | + | |
3165 | 3168 | | |
3166 | 3169 | | |
3167 | 3170 | | |
| |||
4461 | 4464 | | |
4462 | 4465 | | |
4463 | 4466 | | |
4464 | | - | |
| 4467 | + | |
4465 | 4468 | | |
4466 | 4469 | | |
4467 | 4470 | | |
| |||
0 commit comments