Re: [PATCH bpf-next v3 3/3] selftests/bpf: check operations on untrusted ro pointers to mem

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

 



On Wed, Jun 25, 2025 at 11:24 AM Eduard Zingerman <eddyz87@xxxxxxxxx> wrote:
>
> The following cases are tested:
> - it is ok to load memory at any offset from rdonly_untrusted_mem;
> - rdonly_untrusted_mem offset/bounds are not tracked;
> - writes into rdonly_untrusted_mem are forbidden;
> - atomic operations on rdonly_untrusted_mem are forbidden;
> - rdonly_untrusted_mem can't be passed as a memory argument of a
>   helper of kfunc;
> - it is ok to use PTR_TO_MEM and PTR_TO_BTF_ID in a same load
>   instruction.
>
> Signed-off-by: Eduard Zingerman <eddyz87@xxxxxxxxx>
> ---
>  .../bpf/prog_tests/mem_rdonly_untrusted.c     |   9 ++
>  .../bpf/progs/mem_rdonly_untrusted.c          | 136 ++++++++++++++++++
>  2 files changed, 145 insertions(+)
>  create mode 100644 tools/testing/selftests/bpf/prog_tests/mem_rdonly_untrusted.c
>  create mode 100644 tools/testing/selftests/bpf/progs/mem_rdonly_untrusted.c
>

Would be good to have a test that demonstrates loads of all
combinations of signed/unsigned and 1/2/4/8 bytes. Maybe as a follow
up?


[...]





[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