[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230527040038.6783-1-kuniyu@amazon.com>
Date: Fri, 26 May 2023 21:00:38 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <linmiaohe@...wei.com>
CC: <davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
<linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
<pabeni@...hat.com>, <kuniyu@...zon.com>
Subject: Re: [PATCH] net: skbuff: fix missing a __noreturn annotation warning
From: Miaohe Lin <linmiaohe@...wei.com>
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().
Thanks,
Kuniyuki
>
> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
> ---
> 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
Powered by blists - more mailing lists