aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/dynptr.c
diff options
context:
space:
mode:
authorJoanne Koong <[email protected]>2022-08-09 14:40:54 -0700
committerAlexei Starovoitov <[email protected]>2022-08-09 18:38:12 -0700
commit883743422ced8c961ab05dc63ec81b75a4e56052 (patch)
treeee15ff76a8631132a43ed543c75a373e07aa23db /tools/testing/selftests/bpf/prog_tests/dynptr.c
parenta7be0ab1eb1949f3564739784b4360e1233305f6 (diff)
bpf: Fix ref_obj_id for dynptr data slices in verifier
When a data slice is obtained from a dynptr (through the bpf_dynptr_data API), the ref obj id of the dynptr must be found and then associated with the data slice. The ref obj id of the dynptr must be found *before* the caller saved regs are reset. Without this fix, the ref obj id tracking is not correct for dynptrs that are at an offset from the frame pointer. Please also note that the data slice's ref obj id must be assigned after the ret types are parsed, since RET_PTR_TO_ALLOC_MEM-type return regs get zero-marked. Fixes: 34d4ef5775f7 ("bpf: Add dynptr data slices") Signed-off-by: Joanne Koong <[email protected]> Acked-by: David Vernet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/dynptr.c')
0 files changed, 0 insertions, 0 deletions