BPF List
 help / color / mirror / Atom feed
From: Kumar Kartikeya Dwivedi <memxor@gmail.com>
To: Xu Kuohai <xukuohai@huaweicloud.com>
Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Song Liu <song@kernel.org>, Yonghong Song <yhs@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>,
	Jiri Olsa <jolsa@kernel.org>
Subject: Re: [PATCH bpf] bpf: Fix offset calculation error in __copy_map_value and zero_map_value
Date: Sat, 12 Nov 2022 01:05:09 +0530	[thread overview]
Message-ID: <20221111193509.dmklqyxyy3psvgfc@apollo> (raw)
In-Reply-To: <20221111125620.754855-1-xukuohai@huaweicloud.com>

On Fri, Nov 11, 2022 at 06:26:20PM IST, Xu Kuohai wrote:
> From: Xu Kuohai <xukuohai@huawei.com>
>
> Function __copy_map_value and zero_map_value miscalculated copy offset,
> resulting in possible copy of unwanted data to user or kernel.
>
> Fix it.
>
> Fixes: cc48755808c6 ("bpf: Add zero_map_value to zero map value with special fields")
> Fixes: 4d7d7f69f4b1 ("bpf: Adapt copy_map_value for multiple offset case")
> Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
> ---

Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>

I also have a fix here for bpf-next, since this won't apply to it:
https://lore.kernel.org/bpf/20221111193224.876706-4-memxor@gmail.com

I think it'd be best if this one gets applied to bpf and mine to bpf-next, and
any conflicts are resolved when merging both trees (the conflict is trivial),
but I'll leave it up to the maintainers to decide.

  parent reply	other threads:[~2022-11-11 19:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11 12:56 [PATCH bpf] bpf: Fix offset calculation error in __copy_map_value and zero_map_value Xu Kuohai
2022-11-11 19:17 ` sdf
2022-11-11 20:45   ` Kumar Kartikeya Dwivedi
2022-11-12 10:25     ` Xu Kuohai
2022-11-11 19:35 ` Kumar Kartikeya Dwivedi [this message]
2022-11-11 20:50 ` patchwork-bot+netdevbpf

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=20221111193509.dmklqyxyy3psvgfc@apollo \
    --to=memxor@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=xukuohai@huaweicloud.com \
    --cc=yhs@fb.com \
    /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