Re: libbpf CO-RE read_user{,_str} macros

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

 



On Mon, Dec 14, 2020 at 1:58 AM Gilad Reti <gilad.reti@xxxxxxxxx> wrote:
>
> Hello there,
> libbpf provides BPF_CORE_READ macros for reading struct members in a
> CO-RE compatible way. By default those macros reduct to the relevant
> bpf_probe_read_kernel functions. As far as I could tell, there are no
> variants of this macros that wrap the _user variants of the read
> functions. Are there any plans to support ones?

BPF_CORE_READ() are using BPF CO-RE and thus emit relocations, which
will be adjusted by libbpf to match kernel struct layouts by using
kernel's BTF(s). Because of this, having xxx_user() variants doesn't
make much sense, because libbpf can't relocate field offsets against
user-space types (as there is no BTF for user-space applications,
typically). Which is why there are no BPF_CORE_READ_USER()-like
macros.

What's your use case, though? There might be a valid one that we are
not aware of, so please provide more details. Thanks.

> Thanks,
> Gilad Reti.



[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