BPF List
 help / color / mirror / Atom feed
From: maqiao.mq <mqaio@linux.alibaba.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: linux-trace-kernel@vger.kernel.org, rostedt@goodmis.org,
	"Masami Hiramatsu (Google)" <mhiramat@kernel.org>,
	mathieu.desnoyers@efficios.com, namhyung.kim@lge.com,
	linux-kernel@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH] uprobe: avoid out-of-bounds memory access of fetching args
Date: Tue, 15 Oct 2024 11:40:34 +0800	[thread overview]
Message-ID: <C45A2710-BAC4-42FF-93A6-C0165A3EC446@linux.alibaba.com> (raw)
In-Reply-To: <20241014145808.GA8567@redhat.com>



> 2024年10月14日 下午10:58,Oleg Nesterov <oleg@redhat.com> 写道:
> 
> Sorry, currently I don't have time to even try to read this patch, just
> one note below...
> 
> On 10/14, Ma Qiao wrote:
>> 
>> @@ -979,6 +980,11 @@ static struct uprobe_cpu_buffer *prepare_uprobe_buffer(struct trace_uprobe *tu,
>> 	ucb = uprobe_buffer_get();
>> 	ucb->dsize = tu->tp.size + dsize;
>> 
>> +	if (WARN_ON_ONCE(ucb->dsize > MAX_UCB_BUFFER_SIZE)) {
>> +		ucb->dsize = MAX_UCB_BUFFER_SIZE;
>> +		dsize = MAX_UCB_BUFFER_SIZE - tu->tp.size;
>> +	}
>> +
> 
> Then you can probably kill the
> 
> 	if (WARN_ON_ONCE(ucb->dsize > PAGE_SIZE))
> 
> check in __uprobe_trace_func(), no?
> 
> Oleg.

Thanks for reminder, I will remove it in v2

      reply	other threads:[~2024-10-15  3:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14  6:14 [PATCH] uprobe: avoid out-of-bounds memory access of fetching args Ma Qiao
2024-10-14 14:40 ` Masami Hiramatsu
2024-10-15  5:43   ` maqiao.mq
2024-10-14 14:58 ` Oleg Nesterov
2024-10-15  3:40   ` maqiao.mq [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=C45A2710-BAC4-42FF-93A6-C0165A3EC446@linux.alibaba.com \
    --to=mqaio@linux.alibaba.com \
    --cc=bpf@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=oleg@redhat.com \
    --cc=rostedt@goodmis.org \
    /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