Re: [PATCH bpf-next v1 1/8] bpf: Add bpf_dynptr_data_rdonly

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

 



On Wed,  7 Sep 2022 17:02:47 -0700 Joanne Koong <joannelkoong@xxxxxxxxx> wrote:

> Add a new helper bpf_dynptr_data_rdonly
> 
> void *bpf_dynptr_data_rdonly(struct bpf_dynptr *ptr, u32 offset, u32 len);
> 
> which gets a read-only pointer to the underlying dynptr data.
> 
> This is equivalent to bpf_dynptr_data(), except the pointer returned is
> read-only, which allows this to support both read-write and read-only
> dynptrs.
> 
> One example where this will be useful is for skb dynptrs where the
> program type only allows read-only access to packet data. This API will
> provide a way to obtain a data slice that can be used for direct reads.
> 
> Signed-off-by: Joanne Koong <joannelkoong@xxxxxxxxx>

Reviewed-by: Shmulik Ladkani <shmulik.ladkani@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