Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Eric Dumazet and committed by
Jakub Kicinski
220d89df 7d7dbafe

+4 -3
+4 -3
net/core/skbuff.c
··· 1312 1312 has_mac = skb_mac_header_was_set(skb); 1313 1313 has_trans = skb_transport_header_was_set(skb); 1314 1314 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" 1317 1317 "shinfo(txflags=%u nr_frags=%u gso(size=%hu type=%u segs=%hu))\n" 1318 1318 "csum(0x%x start=%u offset=%u ip_summed=%u complete_sw=%u valid=%u level=%u)\n" 1319 1319 "hash(0x%x sw=%u l4=%u) proto=0x%04x pkttype=%u iif=%d\n" 1320 1320 "priority=0x%x mark=0x%x alloc_cpu=%u vlan_all=0x%x\n" 1321 1321 "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, 1323 1324 has_mac ? skb->mac_header : -1, 1324 1325 has_mac ? skb_mac_header_len(skb) : -1, 1325 1326 skb->mac_len,