lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 17 Feb 2021 01:37:38 +0100
From:   Daniel Borkmann <daniel@...earbox.net>
To:     KP Singh <kpsingh@...nel.org>,
        Dan Carpenter <dan.carpenter@...cle.com>
Cc:     Alexei Starovoitov <ast@...nel.org>,
        Dmitrii Banshchikov <me@...que.spb.ru>,
        Andrii Nakryiko <andrii@...nel.org>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        John Fastabend <john.fastabend@...il.com>,
        bpf <bpf@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] bpf: fix a warning message in mark_ptr_not_null_reg()

On 2/16/21 10:10 PM, KP Singh wrote:
> On Tue, Feb 16, 2021 at 8:37 PM Dan Carpenter <dan.carpenter@...cle.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@...cle.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().

Powered by blists - more mailing lists