Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp554445rwd; Sat, 27 May 2023 02:27:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ41yq0OWrVW+yrCbADVc5XQuHmeLMpZpF/NH5+LpSIdnO+U+G6wTcMCXyoTER04ECrdpeRA X-Received: by 2002:a05:6a20:a11b:b0:10a:e73d:2572 with SMTP id q27-20020a056a20a11b00b0010ae73d2572mr2581661pzk.3.1685179635509; Sat, 27 May 2023 02:27:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685179635; cv=none; d=google.com; s=arc-20160816; b=L4SbaGG4qkwQm6fSIq+HirSdmvHFvu0EyJQQM0NwQKK8PHqamxrtpfYB+o0ywQUxVW Yt8n9al0bVrXBDJ/sCW6kVFyMVamyId+ue+JI5tLZVTC9XOULJPfhIJgiuhmrrkfqka2 49f4tdA2DIf0v2UP0USzLAU7w/icXkoOkoHMzglocpK7BS5Fo0qUFC+Z0ynPV62+FfmN //Z7bySBQz4i6+PzjV/7yDKIp5YoJmKSwKiI2JuSmZuepOnjGdGLqGdUk4OmR+hWGa0m 2SsYHwT1xZ/sud8hVY1y2CyQckdRwo7V44VFD/h7qr2UzqUH4jpsvCTTG3P/gq5UI5CW 5DWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=Fv166+E4wOHs1qqp7oIzl2A+NvDcRdeGP1sJFFxeUvI=; b=ugVcu6vkK2zrMqglWC97zmu3NPSRgyXIg7iTkgo8eMULNM4kgbQr7jUI9tVJ8XzKsF gCInC1JQBYEN0Qu4ducFLs3b7s83uu3IQ6O9TtmSpQUeBzdVBFyuoZG38V09gl9K3ftz incvGSC/XQ6i/0K0OsRgTb4Who9aXnCYbTbadq7Mq3J1BBQ8CZcu209cPb2mwO8vHP4U nKaVtgxXRW+AJVH8SUAW78Xiyl/6+FFOxu+zvRYLLOCohe9/6cqM6UYN5njOJlTYo84+ Asp88WXtRkbjFUe73mQpsBnYP4PaUGWQF51z4e5r/Ac/2zFaQfuW/gMDHd8yx38kccgh e0Fw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv4-20020a632e04000000b00536b4c4b695si5715377pgb.136.2023.05.27.02.27.02; Sat, 27 May 2023 02:27:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232010AbjE0JWO (ORCPT + 99 others); Sat, 27 May 2023 05:22:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229841AbjE0JWM (ORCPT ); Sat, 27 May 2023 05:22:12 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 609A619C; Sat, 27 May 2023 02:22:06 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4QSx5R132Vz18LbG; Sat, 27 May 2023 17:17:31 +0800 (CST) Received: from [10.174.151.185] (10.174.151.185) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Sat, 27 May 2023 17:22:03 +0800 Subject: Re: [PATCH] net: skbuff: fix missing a __noreturn annotation warning To: Kuniyuki Iwashima CC: , , , , , References: <20230527110409.497408-1-linmiaohe@huawei.com> <20230527040038.6783-1-kuniyu@amazon.com> From: Miaohe Lin Message-ID: <251633c6-7cbc-a574-5631-9db43a76683b@huawei.com> Date: Sat, 27 May 2023 17:22:03 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20230527040038.6783-1-kuniyu@amazon.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.151.185] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/5/27 12:00, Kuniyuki Iwashima wrote: > From: Miaohe Lin > Date: Sat, 27 May 2023 19:04:09 +0800 >> Add __noreturn annotation to fix the warning: >> net/core/skbuff.o: warning: objtool: skb_push+0x3c: skb_panic() is missing a __noreturn annotation >> net/core/skbuff.o: warning: objtool: skb_put+0x4e: skb_panic() is missing a __noreturn annotation > > What arch are you using ? > > IIUC, BUG() should have an annotation for objtool, for > example, __builtin_unreachable() for x86. > > Maybe the arch is missing such an annotation ? > > Also I'm curious why objtool complains about only skb_push(), > there should be more non-inline functions that has BUG(). I'm not really sure. I was just compiling the kernel using my old gcc (GCC) 7.3.0 and saw this warning. Maybe this warning is just false positive. Thanks. > > Thanks, > Kuniyuki > > >> >> Signed-off-by: Miaohe Lin >> --- >> net/core/skbuff.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/net/core/skbuff.c b/net/core/skbuff.c >> index 6724a84ebb09..12b525aa4783 100644 >> --- a/net/core/skbuff.c >> +++ b/net/core/skbuff.c >> @@ -181,8 +181,8 @@ EXPORT_SYMBOL_GPL(drop_reasons_unregister_subsys); >> * Keep out of line to prevent kernel bloat. >> * __builtin_return_address is not used because it is not always reliable. >> */ >> -static void skb_panic(struct sk_buff *skb, unsigned int sz, void *addr, >> - const char msg[]) >> +static void __noreturn skb_panic(struct sk_buff *skb, unsigned int sz, void *addr, >> + const char msg[]) >> { >> pr_emerg("%s: text:%px len:%d put:%d head:%px data:%px tail:%#lx end:%#lx dev:%s\n", >> msg, addr, skb->len, sz, skb->head, skb->data, >> -- >> 2.27.0 > . >