netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: "Lecomte, Arnaud" <contact@arnaud-lcm.com>
Cc: Brahmajit Das <listout@listout.xyz>,
	syzbot+d1b7fa1092def3628bd7@syzkaller.appspotmail.com,
	andrii@kernel.org, ast@kernel.org, bpf@vger.kernel.org,
	daniel@iogearbox.net, eddyz87@gmail.com, haoluo@google.com,
	john.fastabend@gmail.com, jolsa@kernel.org, kpsingh@kernel.org,
	linux-kernel@vger.kernel.org, martin.lau@linux.dev,
	netdev@vger.kernel.org, sdf@fomichev.me, song@kernel.org,
	syzkaller-bugs@googlegroups.com, yonghong.song@linux.dev
Subject: Re: [PATCH bpf-next v3] bpf: Clamp trace length in __bpf_get_stack to fix OOB write
Date: Wed, 12 Nov 2025 21:37:39 +0000	[thread overview]
Message-ID: <20251112213739.40123684@pumpkin> (raw)
In-Reply-To: <fead1ceb-c3a2-4e61-9b11-f30da188d93a@arnaud-lcm.com>

On Wed, 12 Nov 2025 16:11:41 +0000
"Lecomte, Arnaud" <contact@arnaud-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@listout.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.
> >  
> 


      reply	other threads:[~2025-11-12 21:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-10 18:41 [syzbot] [bpf?] KASAN: stack-out-of-bounds Write in __bpf_get_stack syzbot
2025-11-10 21:16 ` [RFC bpf-next PATCH] bpf: Clamp trace length in __bpf_get_stack to fix OOB write Brahmajit Das
2025-11-11  0:37 ` [PATCH bpf-next v2] " Brahmajit Das
2025-11-11  1:04   ` bot+bpf-ci
2025-11-11  8:12 ` [PATCH bpf-next v3] " Brahmajit Das
2025-11-12  1:44   ` Yonghong Song
2025-11-12  8:40   ` Lecomte, Arnaud
2025-11-12  8:58     ` Brahmajit Das
2025-11-13 12:49     ` Brahmajit Das
2025-11-13 13:26       ` Lecomte, Arnaud
2025-11-13 13:49         ` Brahmajit Das
2025-11-12 13:35   ` David Laight
2025-11-12 14:47     ` Brahmajit Das
2025-11-12 16:11       ` Lecomte, Arnaud
2025-11-12 21:37         ` David Laight [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251112213739.40123684@pumpkin \
    --to=david.laight.linux@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=contact@arnaud-lcm.com \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=listout@listout.xyz \
    --cc=martin.lau@linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=syzbot+d1b7fa1092def3628bd7@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).