From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D7D1C433DB for ; Tue, 16 Feb 2021 21:11:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4920164E28 for ; Tue, 16 Feb 2021 21:11:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230198AbhBPVLG (ORCPT ); Tue, 16 Feb 2021 16:11:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:39454 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229767AbhBPVLE (ORCPT ); Tue, 16 Feb 2021 16:11:04 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 15D7564EAD for ; Tue, 16 Feb 2021 21:10:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613509823; bh=zuN//Mi2dqadHAYyFDtFxOXanm3499mh7SOFGrw72PM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=EHcR3NV0Tq80HkGPC+eIC8PBXlxPPQGMJXQVwQ+1lSkn7gV2/4Rcp0B6qiUPryxXg DGM1zxzew7oP2R62po/tLIKd7hGK2Oc28+SaCCmBM3BXzorI1/V+4/6RkHV37EeCaM 3D7KE9tlYjEB3n6RDOnbNv4tP797Mw9j67U8iMccT0Fo1AHfm0ouTIE/DuBHalkfK1 aTdimRDJQP9ryeeFNL3jWaQ2d0f0uwV0HoDw42ak0iLbZlRGhn9in/DirTU10HDsCq 3EsTHLJDsCBsCzPaO5aen+8YM5gQ1cPOaekyPOiw8uDpsgVsGG4wOBL7x+RhRAcW5L cQqpATgaVdQ7w== Received: by mail-lj1-f172.google.com with SMTP id a17so13640990ljq.2 for ; Tue, 16 Feb 2021 13:10:22 -0800 (PST) X-Gm-Message-State: AOAM530AwtCi/KRQ39k6MaxZQQLdj9t/tSUX1Yfq+NvpnCOTbLXoRRzJ 4sMBc6vx6QYwB34rj6ToygWMpPuBlxdvShp3m33SSA== X-Google-Smtp-Source: ABdhPJwgwy516BjoZrdZrJOhyr/k6Uu8nNx4C91gl4NsH+qZi44hy3J8L1JueNqhpQnF82YBvbfYeMLzGuTLZSqnfEw= X-Received: by 2002:a05:651c:1249:: with SMTP id h9mr13363326ljh.425.1613509821328; Tue, 16 Feb 2021 13:10:21 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: KP Singh Date: Tue, 16 Feb 2021 22:10:10 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] bpf: fix a warning message in mark_ptr_not_null_reg() To: Dan Carpenter Cc: Alexei Starovoitov , Dmitrii Banshchikov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , bpf , open list , kernel-janitors@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 16, 2021 at 8:37 PM Dan Carpenter 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 > --- > 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. [...]