Commit 95dbe21
Alexei Starovoitov
Merge branch 'bpf-fix-verifier_bug_if-to-account-for-bpf_call'
Luis Gerhorst says:
====================
bpf: Fix verifier_bug_if to account for BPF_CALL
This fixes the verifier_bug_if() that runs on nospec_result to not trigger
for BPF_CALL (bug reported by Hu, Mei, and Mu). See patch 1 for a full
description and patch 2 for a test (based on the PoC from the report).
While working on this I noticed two other problems:
- nospec_result is currently ignored for BPF_CALL during patching, but it
may be required if we assume the CPU may speculate into/out of functions.
- Both the instruction patching for nospec and nospec_result erases the
instruction aux information even thought it might be better to keep that.
For nospec_result it may be fine as it is only applied to store
instructions currently (except for when we decide to change the thing
from above), but nospec may be set for arbitrary instructions and if
these require rewrites they break.
I assume these issues are better fixed separately, thus I decided to
exclude them from this series.
====================
Link: https://patch.msgid.link/20260127115912.3026761-1-luis.gerhorst@fau.de
Signed-off-by: Alexei Starovoitov <ast@kernel.org>File tree
2 files changed
+30
-6
lines changed- kernel/bpf
- tools/testing/selftests/bpf/progs
2 files changed
+30
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21065 | 21065 | | |
21066 | 21066 | | |
21067 | 21067 | | |
21068 | | - | |
21069 | | - | |
21070 | | - | |
21071 | | - | |
| 21068 | + | |
| 21069 | + | |
| 21070 | + | |
| 21071 | + | |
| 21072 | + | |
21072 | 21073 | | |
21073 | 21074 | | |
21074 | 21075 | | |
21075 | 21076 | | |
21076 | 21077 | | |
21077 | | - | |
21078 | | - | |
| 21078 | + | |
| 21079 | + | |
| 21080 | + | |
21079 | 21081 | | |
21080 | 21082 | | |
21081 | 21083 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
950 | 950 | | |
951 | 951 | | |
952 | 952 | | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
953 | 975 | | |
0 commit comments