Bug 68501 - llc_fixup_skb considers PDU len including ETH_HLEN
Summary: llc_fixup_skb considers PDU len including ETH_HLEN
Status: NEW
Alias: None
Product: Networking
Classification: Unclassified
Component: IPV4 (show other bugs)
Hardware: All Linux
: P1 high
Assignee: Stephen Hemminger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-10 11:24 UTC by Venkata KIran Katabathena
Modified: 2016-02-15 20:31 UTC (History)
1 user (show)

See Also:
Kernel Version: 3.0.75
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Venkata KIran Katabathena 2014-01-10 11:24:48 UTC
In below snip of code in llc_fixup_skb we calculate pdulen from eth_hdr(skb)->h_proto which contains total length of packet include ETH_HLEN.

<snip>
119         if (skb->protocol == htons(ETH_P_802_2)) {
120                 __be16 pdulen = eth_hdr(skb)->h_proto;
121                 s32 data_size = ntohs(pdulen) - llc_len;
122 
123                 if (data_size < 0 ||
124                     !pskb_may_pull(skb, data_size))
125                         return 0;

</snip>


Line 121 should be changed to 

121                 s32 data_size = ntohs(pdulen) - llc_len - ETH_HLEN;



Log
---
kernel: pdu len 18432(72), data_size 69
kernel: skb len 55, skb data_len 0
Comment 1 Venkata KIran Katabathena 2014-01-13 12:43:31 UTC
Please Junk/Invalid this Bug. My mistake to assume eth_hdr(skb)->h_proto has total L2 payload.

Note You need to log in before you can comment on or make changes to this bug.