Re: [PATCH bpf-next v3 0/4] allow variable-offset stack acces

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

 



On Sat, Feb 6, 2021 at 5:11 PM Andrei Matei <andreimatei1@xxxxxxxxx> wrote:
>
> Before this patch, variable offset access to the stack was dissalowed
> for regular instructions, but was allowed for "indirect" accesses (i.e.
> helpers). This patch removes the restriction, allowing reading and
> writing to the stack through stack pointers with variable offsets. This
> makes stack-allocated buffers more usable in programs, and brings stack
> pointers closer to other types of pointers.
>
> The motivation is being able to use stack-allocated buffers for data
> manipulation. When the stack size limit is sufficient, allocating
> buffers on the stack is simpler than per-cpu arrays, or other
> alternatives.
>
> V2 -> V3
>
> - var-offset writes mark all the stack slots in range as initialized, so
>   that future reads are not rejected.
> - rewrote the C test to not use uprobes, as per Andrii's suggestion.
> - addressed other review comments from Alexei.

I've fixed up Andrii's nits in patch 4,
then moved skel__attach after test_pid init and applied to bpf-next.

I've played with a few other ways to do var stack access in C and all
looked good.
Thanks a lot for making the verifier smarter.



[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