Commit cf68ef5
committed
WIP: selftests/bpf: Fix test task_pt_regs on arm 32-bit
Have error:
test_task_pt_regs:PASS:uprobe_offset 0 nsec
test_task_pt_regs:PASS:skel_open 0 nsec
test_task_pt_regs:PASS:check_bss 0 nsec
test_task_pt_regs:PASS:attach_uprobe 0 nsec
test_task_pt_regs:FAIL:check_uprobe_res unexpected check_uprobe_res: actual 0 != expected 1
torvalds#424 task_pt_regs:FAIL
due to progs/test_task_pt_regs.c using:
#define PT_REGS_SIZE sizeof(struct pt_regs)
which is non-CORE and evaluates to wrong size in 64-bit BPF VM.
Workaround is using bpf_core_type_size() to limit the actual read but
leave the potentially larger PT_REGS_SIZE for the allocation.
Signed-off-by: Tony Ambardar <[email protected]>1 parent 1d2ae39 commit cf68ef5
1 file changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | | - | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
0 commit comments