Netdev List
 help / color / mirror / Atom feed
From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: <bot+bpf-ci@kernel.org>, <ayushmanrout27@gmail.com>,
	<bpf@vger.kernel.org>
Cc: <ast@kernel.org>, <daniel@iogearbox.net>, <andrii@kernel.org>,
	<memxor@gmail.com>, <hawk@kernel.org>, <drosen@google.com>,
	<netdev@vger.kernel.org>, <martin.lau@kernel.org>,
	<eddyz87@gmail.com>, <yonghong.song@linux.dev>,
	<mason@kernel.org>, <ihor.solodrai@linux.dev>
Subject: Re: [PATCH bpf-next] bpf: Use memmove() to load bytes from an skb and an xdp_buff
Date: Wed, 21 Oct 2026 22:04:04 +0000	[thread overview]
Message-ID: <DMAUUBNDJCOQ.12UWI6DR7LNYU@gmail.com> (raw)
In-Reply-To: <5a586e05ad8d24d79759c1d99d6d58eb661dc6f4a4c8d258e05a4962cfe7e59e@mail.kernel.org>

On Wed Oct 21, 2026 at 11:04 AM UTC, bot+bpf-ci wrote:
>> bpf: Use memmove() to load bytes from an skb and an xdp_buff
>
> TL;DR: bpf_skb_load_bytes_relative() still uses memcpy() and may corrupt data
> when its destination is an overlapping dynptr slice; should it get the same
> memmove() change, or should the commit message explain why not?
>
>> diff --git a/net/core/filter.c b/net/core/filter.c
>> --- a/net/core/filter.c
>> +++ b/net/core/filter.c
>> @@ -1789,7 +1789,7 @@ BPF_CALL_4(bpf_skb_load_bytes, const struct sk_buff *, skb, u32, offset,
>>  	if (unlikely(!ptr))
>>  		goto err_clear;
>>  	if (ptr != to)
>> -		memcpy(to, ptr, len);
>> +		memmove(to, ptr, len);
>>
>>  	return 0;
>>  err_clear:
>
> Should bpf_skb_load_bytes_relative() get the same change?

+1

pw-bot: cr

      reply	other threads:[~2026-10-21 22:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21 10:39 [PATCH bpf-next] bpf: Use memmove() to load bytes from an skb and an xdp_buff Ayushman Rout
2026-10-21 11:04 ` bot+bpf-ci
2026-10-21 22:04   ` Alexei Starovoitov [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=DMAUUBNDJCOQ.12UWI6DR7LNYU@gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=ayushmanrout27@gmail.com \
    --cc=bot+bpf-ci@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=drosen@google.com \
    --cc=eddyz87@gmail.com \
    --cc=hawk@kernel.org \
    --cc=ihor.solodrai@linux.dev \
    --cc=martin.lau@kernel.org \
    --cc=mason@kernel.org \
    --cc=memxor@gmail.com \
    --cc=netdev@vger.kernel.org \
    --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