Commit df0cb5c
bpf: Allow fall back to interpreter for programs with stack size <= 512
OpenWRT users reported regression on ARMv6 devices after updating to latest
HEAD, where tcpdump filter:
tcpdump "not ether host 3c37121a2b3c and not ether host 184ecbca2a3a \
and not ether host 14130b4d3f47 and not ether host f0f61cf440b7 \
and not ether host a84b4dedf471 and not ether host d022be17e1d7 \
and not ether host 5c497967208b and not ether host 706655784d5b"
fails with warning: "Kernel filter failed: No error information"
when using config:
# CONFIG_BPF_JIT_ALWAYS_ON is not set
CONFIG_BPF_JIT_DEFAULT_ON=y
The issue arises because commits:
1. "bpf: Fix array bounds error with may_goto" changed default runtime to
__bpf_prog_ret0_warn when jit_requested = 1
2. "bpf: Avoid __bpf_prog_ret0_warn when jit fails" returns error when
jit_requested = 1 but jit fails
This change restores interpreter fallback capability for BPF programs with
stack size <= 512 bytes when jit fails.
Reported-by: Felix Fietkau <[email protected]>
Closes: https://lore.kernel.org/bpf/[email protected]/
Fixes: 6ebc503 ("bpf: Fix array bounds error with may_goto")
Signed-off-by: KaFai Wan <[email protected]>
Acked-by: Eduard Zingerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>1 parent 0d80e7f commit df0cb5c
1 file changed
+9
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2366 | 2366 | | |
2367 | 2367 | | |
2368 | 2368 | | |
2369 | | - | |
2370 | | - | |
| 2369 | + | |
2371 | 2370 | | |
2372 | 2371 | | |
2373 | 2372 | | |
| |||
2468 | 2467 | | |
2469 | 2468 | | |
2470 | 2469 | | |
2471 | | - | |
| 2470 | + | |
2472 | 2471 | | |
| 2472 | + | |
2473 | 2473 | | |
2474 | 2474 | | |
2475 | 2475 | | |
| |||
2478 | 2478 | | |
2479 | 2479 | | |
2480 | 2480 | | |
2481 | | - | |
2482 | | - | |
| 2481 | + | |
2483 | 2482 | | |
| 2483 | + | |
2484 | 2484 | | |
2485 | 2485 | | |
2486 | 2486 | | |
2487 | 2487 | | |
2488 | 2488 | | |
2489 | 2489 | | |
| 2490 | + | |
2490 | 2491 | | |
2491 | 2492 | | |
2492 | 2493 | | |
| |||
2505 | 2506 | | |
2506 | 2507 | | |
2507 | 2508 | | |
2508 | | - | |
| 2509 | + | |
2509 | 2510 | | |
2510 | 2511 | | |
2511 | 2512 | | |
| |||
2514 | 2515 | | |
2515 | 2516 | | |
2516 | 2517 | | |
2517 | | - | |
| 2518 | + | |
| 2519 | + | |
2518 | 2520 | | |
2519 | 2521 | | |
2520 | 2522 | | |
| |||
0 commit comments