On Mon, 2024-12-02 at 00:38 -0800, Kumar Kartikeya Dwivedi wrote: > 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") > Reported-by: Tao Lyu <tao.lyu@xxxxxxx> > Signed-off-by: Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx> > --- Acked-by: Eduard Zingerman <eddyz87@xxxxxxxxx> [...]