All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: KP Singh <kpsingh@kernel.org>, Dan Carpenter <dan.carpenter@oracle.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Dmitrii Banshchikov <me@ubique.spb.ru>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	bpf <bpf@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] bpf: fix a warning message in mark_ptr_not_null_reg()
Date: Wed, 17 Feb 2021 01:37:38 +0100	[thread overview]
Message-ID: <04c60ed2-1a96-2835-9ae1-0ba84f482362@iogearbox.net> (raw)
In-Reply-To: <CACYkzJ55Ze+aA+qKA8bf=iqNY01H=MuDCKVmn44fLVW1670RxA@mail.gmail.com>

On 2/16/21 10:10 PM, KP Singh wrote:
> On Tue, Feb 16, 2021 at 8:37 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>>
>> The WARN_ON() argument is a condition, and it generates a stack trace
>> but it doesn't print the warning.
>>
>> Fixes: 4ddb74165ae5 ("bpf: Extract nullable reg type conversion into a helper function")
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>> ---
>>   kernel/bpf/verifier.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
>> index 056df6be3e30..bd4d1dfca73c 100644
>> --- a/kernel/bpf/verifier.c
>> +++ b/kernel/bpf/verifier.c
>> @@ -1120,7 +1120,7 @@ static void mark_ptr_not_null_reg(struct bpf_reg_state *reg)
>>                  reg->type = PTR_TO_RDWR_BUF;
>>                  break;
>>          default:
>> -               WARN_ON("unknown nullable register type");
>> +               WARN(1, "unknown nullable register type");
> 
> Should we use WARN_ONCE here? Also, I think the fix should be targeted
> for bpf-next as
> the patch that introduced this hasn't made it to bpf yet.
> 
> [...]

Usually we have something like `verbose(env, "kernel subsystem misconfigured verifier\n")`,
but in this case we'd need to drag env all the way to here. :/ I agree with WARN_ONCE().

  reply	other threads:[~2021-02-17  0:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16 19:36 [PATCH] bpf: fix a warning message in mark_ptr_not_null_reg() Dan Carpenter
2021-02-16 21:10 ` KP Singh
2021-02-17  0:37   ` Daniel Borkmann [this message]
2021-02-17  7:45     ` [PATCH v2 bpf-next] " Dan Carpenter
2021-02-17 22:10       ` 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=04c60ed2-1a96-2835-9ae1-0ba84f482362@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=me@ubique.spb.ru \
    --cc=songliubraving@fb.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.