BPF List
 help / color / mirror / Atom feed
From: Yonghong Song <yhs@fb.com>
To: Felix Maurer <fmaurer@redhat.com>, <bpf@vger.kernel.org>
Cc: <ast@kernel.org>, <daniel@iogearbox.net>, <andrii@kernel.org>,
	<kafai@fb.com>, <songliubraving@fb.com>,
	<john.fastabend@gmail.com>, <kpsingh@kernel.org>
Subject: Re: [PATCH bpf-next v2] bpf: Do not try bpf_msg_push_data with len 0
Date: Wed, 9 Feb 2022 09:06:38 -0800	[thread overview]
Message-ID: <cd545202-d948-2ce5-dfae-362822766f90@fb.com> (raw)
In-Reply-To: <df69012695c7094ccb1943ca02b4920db3537466.1644421921.git.fmaurer@redhat.com>



On 2/9/22 7:55 AM, Felix Maurer wrote:
> If bpf_msg_push_data is called with len 0 (as it happens during
> selftests/bpf/test_sockmap), we do not need to do anything and can
> return early.
> 
> Calling bpf_msg_push_data with len 0 previously lead to a wrong ENOMEM
> error: we later called get_order(copy + len); if len was 0, copy + len
> was also often 0 and get_order returned some undefined value (at the
> moment 52). alloc_pages caught that and failed, but then
> bpf_msg_push_data returned ENOMEM. This was wrong because we are most
> probably not out of memory and actually do not need any additional
> memory.
> 
> v2: Add bug description and Fixes tag
> 
> Fixes: 6fff607e2f14b ("bpf: sk_msg program helper bpf_msg_push_data")
> Signed-off-by: Felix Maurer <fmaurer@redhat.com>

LGTM. I am wondering why bpf CI didn't catch this problem. Did you
modified the test with length 0 in order to trigger that? If this
is the case, it would be great you can add such a test to the
test_sockmap.

Acked-by: Yonghong Song <yhs@fb.com>

  reply	other threads:[~2022-02-09 17:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09 15:55 [PATCH bpf-next v2] bpf: Do not try bpf_msg_push_data with len 0 Felix Maurer
2022-02-09 17:06 ` Yonghong Song [this message]
2022-02-10 15:45   ` Felix Maurer
2022-02-10 18:04     ` Yonghong Song
2022-02-11  3:08       ` Alexei Starovoitov
2022-02-11  6:33         ` John Fastabend
2022-02-11 17:52       ` Felix Maurer
2022-02-11 22:27         ` Yonghong Song
2022-02-11 13:00 ` 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=cd545202-d948-2ce5-dfae-362822766f90@fb.com \
    --to=yhs@fb.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=fmaurer@redhat.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=songliubraving@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