Re: [PATCH bpf-next 3/3] bpf: verifier: Disambiguate get_constant_map_key() errors
From: Eduard Zingerman
Date: Mon Feb 03 2025 - 13:49:46 EST
On Sat, 2025-02-01 at 12:58 -0700, Daniel Xu wrote:
> Refactor get_constant_map_key() to disambiguate the constant key
> value from potential error values. In the case that the key is
> negative, it could be confused for an error.
>
> It's not currently an issue, as the verifier seems to track s32 spills
> as u32. So even if the program wrongly uses a negative value for an
> arraymap key, the verifier just thinks it's an impossibly high value
> which gets correctly discarded.
>
> Refactor anyways to make things cleaner and prevent potential future
> issues.
>
> Signed-off-by: Daniel Xu <dxu@xxxxxxxxx>
> ---
Acked-by: Eduard Zingerman <eddyz87@xxxxxxxxx>
[...]