Re: [PATCH bpf-next v2 5/7] mm: introduce BPF kfunc to access memory events

From: Chris Mason

Date: Tue Dec 23 2025 - 09:10:22 EST


On 12/22/25 5:23 PM, Roman Gushchin wrote:
> Chris Mason <clm@xxxxxxxx> writes:
>
>> On 12/20/25 1:43 PM, Roman Gushchin wrote:
>>>>> No, the bpf verifier enforces event > 0.
>>>>> It's a false positive.
>>>>
>>>> I'll add some words here to the bpf prompts, thanks Roman.
>>>
>>> I'll try to play with it too, hopefully we can fix it.
>>>
>>
>> https://github.com/masoncl/review-prompts/commit/fcc3bf704798f6be64cbb2e28b05a5c91eee9c7b
>
> Hi Chris!
>
> I'm sorry, apparently I was dead wrong and overestimated the bpf
> verifier (and ai was correct, lol). Somebody told me that enums
> are fully covered as a feedback to an earlier version and I didn't
> check.
>
> In reality the verifier doesn't guarantee the correctness of the value
> passed as an enum, only that it's a u32. So we need to check the value.
> I've added necessarily checks in v3 of my patchset. It passes the local
> ai review without your latest change. Please, revert it.
>
> Thanks and sorry for the hassle

Thanks Roman, I adjusted the prompt changes and looked harder for proof
of exactly what checks are done.

-chris