Re: [PATCH bpf-next v1 2/8] bpf: rdonly_untrusted_mem for btf id walk pointer leafs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 3 Jul 2025 at 00:42, Eduard Zingerman <eddyz87@xxxxxxxxx> wrote:
>
> When processing a load from a PTR_TO_BTF_ID, the verifier calculates
> the type of the loaded structure field based on the load offset.
> For example, given the following types:
>
>   struct foo {
>     struct foo *a;
>     int *b;
>   } *p;
>
> The verifier would calculate the type of `p->a` as a pointer to
> `struct foo`. However, the type of `p->b` is currently calculated as a
> SCALAR_VALUE.
>
> This commit updates the logic for processing PTR_TO_BTF_ID to instead
> calculate the type of p->b as PTR_TO_MEM|MEM_RDONLY|PTR_UNTRUSTED.
> This change allows further dereferencing of such pointers (using probe
> memory instructions).
>
> Suggested-by: Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx>
> Signed-off-by: Eduard Zingerman <eddyz87@xxxxxxxxx>
> ---

Acked-by: Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx>

>  [...]




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux