Oleg Nesterov c7b4133c48 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 <oleg@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20240929144235.GA9471@redhat.com
2024-10-07 09:28:44 +02:00
..
2024-06-15 10:43:06 -07:00
2024-09-23 12:47:06 -07:00
2024-09-29 08:51:30 -07:00
2024-09-28 09:06:15 -07:00
2024-09-19 10:18:15 +02:00
2024-09-17 07:25:37 +02:00
2024-07-29 10:45:54 -07:00
2024-09-03 21:15:26 -07:00
2024-09-19 10:18:15 +02:00
2023-12-01 09:51:44 -08:00
2024-09-27 08:18:43 -07:00
2023-12-29 12:22:29 -08:00
2024-07-18 12:19:20 -07:00
2024-05-30 15:31:38 -07:00
2024-05-17 17:31:24 -07:00
2024-09-18 06:59:44 +02:00