Commit 811bf3b
bpf: introduce kfunc flags for dynptr types
The verifier currently special-cases dynptr initialization kfuncs to set
the correct dynptr type for an uninitialized argument. This patch moves
that logic into kfunc metadata.
Introduce KF_DYNPTR_* kfunc flags and a helper,
dynptr_type_from_kfunc_flags(), which translates those flags into the
appropriate DYNPTR_TYPE_* mask. With the type encoded in the kfunc
declaration, the verifier no longer needs explicit checks for
bpf_dynptr_from_xdp(), bpf_dynptr_from_skb(), and
bpf_dynptr_from_skb_meta().
This simplifies the verifier and centralizes dynptr typing in kfunc
declarations, with no user-visible behavior change.
Signed-off-by: Mykyta Yatsenko <[email protected]>
Acked-by: Eduard Zingerman <[email protected]>1 parent 028d6d4 commit 811bf3b
3 files changed
+29
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2297 | 2297 | | |
2298 | 2298 | | |
2299 | 2299 | | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
2300 | 2319 | | |
2301 | 2320 | | |
2302 | 2321 | | |
| |||
13277 | 13296 | | |
13278 | 13297 | | |
13279 | 13298 | | |
13280 | | - | |
13281 | | - | |
13282 | | - | |
13283 | | - | |
13284 | | - | |
13285 | | - | |
13286 | | - | |
13287 | | - | |
| 13299 | + | |
| 13300 | + | |
| 13301 | + | |
| 13302 | + | |
13288 | 13303 | | |
13289 | 13304 | | |
13290 | 13305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12228 | 12228 | | |
12229 | 12229 | | |
12230 | 12230 | | |
12231 | | - | |
| 12231 | + | |
12232 | 12232 | | |
12233 | 12233 | | |
12234 | 12234 | | |
12235 | | - | |
| 12235 | + | |
12236 | 12236 | | |
12237 | 12237 | | |
12238 | 12238 | | |
12239 | | - | |
| 12239 | + | |
12240 | 12240 | | |
12241 | 12241 | | |
12242 | 12242 | | |
| |||
0 commit comments