Kumar Kartikeya Dwivedi 69772f509e bpf: Don't mark STACK_INVALID as STACK_MISC in mark_stack_slot_misc
Inside mark_stack_slot_misc, we should not upgrade STACK_INVALID to
STACK_MISC when allow_ptr_leaks is false, since invalid contents
shouldn't be read unless the program has the relevant capabilities.
The relaxation only makes sense when env->allow_ptr_leaks is true.

However, such conversion in privileged mode becomes unnecessary, as
invalid slots can be read without being upgraded to STACK_MISC.

Currently, the condition is inverted (i.e. checking for true instead of
false), simply remove it to restore correct behavior.

Fixes: eaf18febd6eb ("bpf: preserve STACK_ZERO slots on partial reg spills")
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Reported-by: Tao Lyu <tao.lyu@epfl.ch>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20241204044757.1483141-2-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2024-12-04 09:19:50 -08:00
..
2024-11-21 08:11:04 -08:00
2024-11-21 08:11:04 -08:00
2024-08-30 08:55:26 -07:00
2024-08-30 08:55:26 -07:00
2024-11-22 20:36:11 -08:00
2024-11-21 08:11:04 -08:00
2022-05-10 11:20:45 -07:00
2024-08-30 08:55:26 -07:00
2024-08-30 08:57:47 -07:00
2024-10-22 15:42:56 -07:00
2024-11-22 13:27:01 -08:00
2024-11-18 10:30:29 -08:00
2023-10-23 15:01:53 -07:00