Re: [PATCH bpf-next] bpf: permit size-0 datasec

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

 



On Tue, Jan 19, 2021 at 7:35 AM Yonghong Song <yhs@xxxxxx> wrote:
> When loading the ./test.o to the kernel with bpftool,
> we see the following error:
>     libbpf: Error loading BTF: Invalid argument(22)
>     libbpf: magic: 0xeb9f
>     ...
>     [6] ARRAY (anon) type_id=5 index_type_id=7 nr_elems=4
>     [7] INT __ARRAY_SIZE_TYPE__ size=4 bits_offset=0 nr_bits=32 encoding=(none)
>     [8] VAR _license type_id=6 linkage=1
>     [9] DATASEC .rodata size=24 vlen=0 vlen == 0
>     libbpf: Error loading .BTF into kernel: -22. BTF is optional, ignoring.
>
> Basically, libbpf changed .rodata datasec size to 24 since elf .rodata
> section size is 24. The kernel then rejected the BTF since vlen = 0.
> Note that the above kernel verifier failure can be worked around with
> changing local variable "fmt" to a static or global, optionally const, variable.
>
> This patch permits a datasec with vlen = 0 in kernel.
>
> Signed-off-by: Yonghong Song <yhs@xxxxxx>

Applied. Thanks



[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