diff options
| author | Oleg Nesterov <[email protected]> | 2024-09-29 14:42:35 +0000 |
|---|---|---|
| committer | Peter Zijlstra <[email protected]> | 2024-10-07 07:28:44 +0000 |
| commit | c7b4133c48445dde789ed30b19ccb0448c7593f7 (patch) | |
| tree | 6f1607568e089309bc692cd46dca226ab748e183 /tools/testing/selftests/bpf/prog_tests/access_variable_array.c | |
| parent | uprobes: don't abuse get_utask() in pre_ssout() and prepare_uretprobe() (diff) | |
| download | kernel-c7b4133c48445dde789ed30b19ccb0448c7593f7.tar.gz kernel-c7b4133c48445dde789ed30b19ccb0448c7593f7.zip | |
uprobes: sanitiize xol_free_insn_slot()
1. Clear utask->xol_vaddr unconditionally, even if this addr is not valid,
xol_free_insn_slot() should never return with utask->xol_vaddr != NULL.
2. Add a comment to explain why do we need to validate slot_addr.
3. Simplify the validation above. We can simply check offset < PAGE_SIZE,
unsigned underflows are fine, it should work if slot_addr < area->vaddr.
4. Kill the unnecessary "slot_nr >= UINSNS_PER_PAGE" check, slot_nr must
be valid if offset < PAGE_SIZE.
The next patches will cleanup this function even more.
Signed-off-by: Oleg Nesterov <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/access_variable_array.c')
0 files changed, 0 insertions, 0 deletions
