Skip to content

Commit 220d89d

Browse files
edumazetkuba-moo
authored andcommitted
net: add skb->data_len and (skb>end - skb->tail) to skb_dump()
While working on a syzbot report, I found that skb_dump() is lacking two important parts : - skb->data_len. - (skb>end - skb->tail) tailroom is zero if skb is not linear. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://patch.msgid.link/20260112172621.4188700-1-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 7d7dbaf commit 220d89d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

net/core/skbuff.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,14 +1312,15 @@ void skb_dump(const char *level, const struct sk_buff *skb, bool full_pkt)
13121312
has_mac = skb_mac_header_was_set(skb);
13131313
has_trans = skb_transport_header_was_set(skb);
13141314

1315-
printk("%sskb len=%u headroom=%u headlen=%u tailroom=%u\n"
1316-
"mac=(%d,%d) mac_len=%u net=(%d,%d) trans=%d\n"
1315+
printk("%sskb len=%u data_len=%u headroom=%u headlen=%u tailroom=%u\n"
1316+
"end-tail=%u mac=(%d,%d) mac_len=%u net=(%d,%d) trans=%d\n"
13171317
"shinfo(txflags=%u nr_frags=%u gso(size=%hu type=%u segs=%hu))\n"
13181318
"csum(0x%x start=%u offset=%u ip_summed=%u complete_sw=%u valid=%u level=%u)\n"
13191319
"hash(0x%x sw=%u l4=%u) proto=0x%04x pkttype=%u iif=%d\n"
13201320
"priority=0x%x mark=0x%x alloc_cpu=%u vlan_all=0x%x\n"
13211321
"encapsulation=%d inner(proto=0x%04x, mac=%u, net=%u, trans=%u)\n",
1322-
level, skb->len, headroom, skb_headlen(skb), tailroom,
1322+
level, skb->len, skb->data_len, headroom, skb_headlen(skb),
1323+
tailroom, skb->end - skb->tail,
13231324
has_mac ? skb->mac_header : -1,
13241325
has_mac ? skb_mac_header_len(skb) : -1,
13251326
skb->mac_len,

0 commit comments

Comments
 (0)