Re: [PATCH bpf-next v3 08/18] libbpf: Add enum64 sanitization

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

 



On Thu, May 26, 2022 at 11:55 AM Yonghong Song <yhs@xxxxxx> wrote:
>
> When old kernel does not support enum64 but user space btf
> contains non-zero enum kflag or enum64, libbpf needs to
> do proper sanitization so modified btf can be accepted
> by the kernel.
>
> Sanitization for enum kflag can be achieved by clearing
> the kflag bit. For enum64, the type is replaced with an
> union of integer member types and the integer member size
> must be smaller than enum64 size. If such an integer
> type cannot be found, a new type is created and used
> for union members.
>
> Signed-off-by: Yonghong Song <yhs@xxxxxx>
> ---

LGTM!

Acked-by: Andrii Nakryiko <andrii@xxxxxxxxxx>

>  tools/lib/bpf/btf.h             |  3 +-
>  tools/lib/bpf/libbpf.c          | 56 ++++++++++++++++++++++++++++++---
>  tools/lib/bpf/libbpf_internal.h |  2 ++
>  3 files changed, 56 insertions(+), 5 deletions(-)
>

[...]



[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