Re: [PATCH bpf-next] selftests/bpf: fix crash in core_reloc when bpftool btfgen fails

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

 



On Thu, Feb 17, 2022 at 10:55 AM sunyucong@xxxxxxxxx
<sunyucong@xxxxxxxxx> wrote:
>
> > Should it be:
> >                 bpf_object__close(obj);
> >                 obj = NULL:
>
> No, the actual crash is caused by this line:
> https://github.com/kernel-patches/bpf/blob/bpf-next/tools/testing/selftests/bpf/prog_tests/core_reloc.c#L896
>
> When run_btfgen fails, the obj contains uninitialized data and then
> bpf_object__close(obj) crashes.


Martin's point is that you have to NULL out obj so that on the next
iteration this doesn't crash again. I'll fix it up while applying.



[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