[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251112213739.40123684@pumpkin>
Date: Wed, 12 Nov 2025 21:37:39 +0000
From: David Laight <david.laight.linux@...il.com>
To: "Lecomte, Arnaud" <contact@...aud-lcm.com>
Cc: Brahmajit Das <listout@...tout.xyz>,
syzbot+d1b7fa1092def3628bd7@...kaller.appspotmail.com, andrii@...nel.org,
ast@...nel.org, bpf@...r.kernel.org, daniel@...earbox.net,
eddyz87@...il.com, haoluo@...gle.com, john.fastabend@...il.com,
jolsa@...nel.org, kpsingh@...nel.org, linux-kernel@...r.kernel.org,
martin.lau@...ux.dev, netdev@...r.kernel.org, sdf@...ichev.me,
song@...nel.org, syzkaller-bugs@...glegroups.com, yonghong.song@...ux.dev
Subject: Re: [PATCH bpf-next v3] bpf: Clamp trace length in __bpf_get_stack
to fix OOB write
On Wed, 12 Nov 2025 16:11:41 +0000
"Lecomte, Arnaud" <contact@...aud-lcm.com> wrote:
> On 12/11/2025 14:47, Brahmajit Das wrote:
> > On 12.11.2025 13:35, David Laight wrote:
> >> On Tue, 11 Nov 2025 13:42:54 +0530
> >> Brahmajit Das <listout@...tout.xyz> wrote:
> >>
> > ...snip...
> >> Please can we have no unnecessary min_t().
> >> You wouldn't write:
> >> x = (u32)a < (u32)b ? (u32)a : (u32)b;
> >>
> >> David
> >>
> >>> copy_len = trace_nr * elem_size;
> >>>
> >>> ips = trace->ip + skip;
> > Hi David,
> >
> > Sorry, I didn't quite get that. Would prefer something like:
> > trace_nr = (trace_nr <= num_elem) ? trace_nr : num_elem;
>
> min_t is a min with casting which is unnecessary in this case as
> trace_nr and num_elem are already u32.
Correct
David
>
> > The pre-refactor code.
> >
>
Powered by blists - more mailing lists