Re: [PATCH bpf v1] libbpf: fix accessing BTF.ext core_relo header

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

 



Hi Shivam,

On Sat, Jan 25, 2025 at 01:57:54PM +0530, shivam tiwari wrote:
> Hii Team,
> 
> I am new to contributing to the Linux kernel and recently submitted a
> patch  via the mailing list. I received a response with a proposed patch
> update and I would like to kindly ask for clarification on the status of my
> submission.

I confess I mistook your email for an automated bug notification from
OSS-Fuzz concerning code I previously contributed, which lead me to
investigate and send out a patch.

Regards,
Tony Ambardar

> 
> Does the patch provided represent a draft or suggested change for my
> initial patch? Should I make any modifications or take further actions to
> move this forward? Or has the patch already been accepted for inclusion in
> the project?
> 
> I appreciate your time and feedback, and I look forward to your guidance on
> the next steps.
> 
> Thank you for your support
> 
> On Sat, Jan 25, 2025, 12:22 PM Tony Ambardar <tony.ambardar@xxxxxxxxx>
> wrote:
> 
> > From: Tony Ambardar <tony.ambardar@xxxxxxxxx>
> >
> > Update btf_ext_parse_info() to ensure the core_relo header is present
> > before reading its fields. This avoids a potential buffer read overflow
> > reported by the OSS Fuzz project.
> >
> > Fixes: cf579164e9ea ("libbpf: Support BTF.ext loading and output in either
> > endianness")
> > Link: https://issues.oss-fuzz.com/issues/388905046
> > Signed-off-by: Tony Ambardar <tony.ambardar@xxxxxxxxx>
> > ---
> >  tools/lib/bpf/btf.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
> > index 48c66f3a9200..560b519f820e 100644
> > --- a/tools/lib/bpf/btf.c
> > +++ b/tools/lib/bpf/btf.c
> > @@ -3015,8 +3015,6 @@ static int btf_ext_parse_info(struct btf_ext
> > *btf_ext, bool is_native)
> >                 .desc = "line_info",
> >         };
> >         struct btf_ext_sec_info_param core_relo = {
> > -               .off = btf_ext->hdr->core_relo_off,
> > -               .len = btf_ext->hdr->core_relo_len,
> >                 .min_rec_size = sizeof(struct bpf_core_relo),
> >                 .ext_info = &btf_ext->core_relo_info,
> >                 .desc = "core_relo",
> > @@ -3034,6 +3032,8 @@ static int btf_ext_parse_info(struct btf_ext
> > *btf_ext, bool is_native)
> >         if (btf_ext->hdr->hdr_len < offsetofend(struct btf_ext_header,
> > core_relo_len))
> >                 return 0; /* skip core relos parsing */
> >
> > +       core_relo.off = btf_ext->hdr->core_relo_off;
> > +       core_relo.len = btf_ext->hdr->core_relo_len;
> >         err = btf_ext_parse_sec_info(btf_ext, &core_relo, is_native);
> >         if (err)
> >                 return err;
> > --
> > 2.34.1
> >
> >




[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