From: gaoxingwang <gaoxingwang1@huawei.com>
To: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>
Cc: <liaichun@huawei.com>, <yanan@huawei.com>
Subject: [PATCH] net: fix print in skb_panic()
Date: Thu, 7 Mar 2024 14:11:43 +0800 [thread overview]
Message-ID: <20240307061143.989505-1-gaoxingwang1@huawei.com> (raw)
skb->len and sz are printed as negative numbers during the panic:
skbuff: skb_under_panic: text:ffffffff8e2d3eac len:-1961180312 put:-1961180408 head:ffff88800b6ac000 data:ffff887f804ffe78 tail:0x1e0 end:0xec0 dev:team0
Use %u to print skb->len and sz,because they are defined as unsigned int.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: gaoxingwang <gaoxingwang1@huawei.com>
---
net/core/skbuff.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 83af8aaeb893..55173b4b3ec7 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -186,7 +186,7 @@ EXPORT_SYMBOL_GPL(drop_reasons_unregister_subsys);
static void 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",
+ pr_emerg("%s: text:%px len:%u put:%u head:%px data:%px tail:%#lx end:%#lx dev:%s\n",
msg, addr, skb->len, sz, skb->head, skb->data,
(unsigned long)skb->tail, (unsigned long)skb->end,
skb->dev ? skb->dev->name : "<NULL>");
--
2.27.0
next reply other threads:[~2024-03-07 6:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-07 6:11 gaoxingwang [this message]
2024-03-07 6:29 ` Eric Dumazet
2024-03-07 9:19 ` Breno Leitao
2024-03-07 9:13 ` Breno Leitao
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=20240307061143.989505-1-gaoxingwang1@huawei.com \
--to=gaoxingwang1@huawei.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=liaichun@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yanan@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®