Re: [PATCH bpf-next v10 6/7] bpf: Support private stack for struct_ops progs

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

 



On Wed, Nov 06, 2024 at 06:42:09PM -0800, Yonghong Song wrote:
> For struct_ops progs, whether a particular prog uses private stack
> depends on prog->aux->priv_stack_requested setting before actual
> insn-level verification for that prog. One particular implementation
> is to piggyback on struct_ops->check_member(). The next patch has
> an example for this. The struct_ops->check_member() sets
> prog->aux->priv_stack_requested to be true which enables private stack
> usage.
> 
> The struct_ops prog follows the same rule as kprobe/tracing progs after
> function bpf_enable_priv_stack(). For example, even a struct_ops prog
> requests private stack, it could still use normal kernel stack if
> the stack size is small (< 64 bytes).
> 
> The prog->aux->priv_stack_requested is also used for recursion checking
> for struct_ops progs. Similar to tracing progs, nested same cpu same
> prog run will be skipped. A field (recursion_detected()) is added to
> bpf_prog_aux structure. If bpf_prog->aux->recursion_detected
> is implemented by the struct_ops subsystem and nested same cpu/prog
> happens, the function will be triggered to report an error, collect
> related info, etc.
> 
> Signed-off-by: Yonghong Song <yonghong.song@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