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:57 AM Andrii Nakryiko
<andrii.nakryiko@xxxxxxxxx> wrote:
>
> 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.

But I actually ended up replacing two goto cleanup with continue
(there is no clean up to do). And adjusted commit message to reflect
that. Applied to bpf-next, thanks for the fix!



[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