netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fw: [Bug 68501] New: llc_fixup_skb considers PDU len including ETH_HLEN
@ 2014-01-10 23:11 Stephen Hemminger
  2014-01-14 23:01 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2014-01-10 23:11 UTC (permalink / raw)
  To: netdev



Begin forwarded message:

Date: Fri, 10 Jan 2014 03:24:59 -0800
From: "bugzilla-daemon@bugzilla.kernel.org" <bugzilla-daemon@bugzilla.kernel.org>
To: "stephen@networkplumber.org" <stephen@networkplumber.org>
Subject: [Bug 68501] New: llc_fixup_skb considers PDU len including ETH_HLEN


https://bugzilla.kernel.org/show_bug.cgi?id=68501

            Bug ID: 68501
           Summary: llc_fixup_skb considers PDU len including ETH_HLEN
           Product: Networking
           Version: 2.5
    Kernel Version: 3.0.75
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: high
          Priority: P1
         Component: IPV4
          Assignee: shemminger@linux-foundation.org
          Reporter: vkatabat@gmail.com
        Regression: No

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

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Bug 68501] New: llc_fixup_skb considers PDU len including ETH_HLEN
  2014-01-10 23:11 Fw: [Bug 68501] New: llc_fixup_skb considers PDU len including ETH_HLEN Stephen Hemminger
@ 2014-01-14 23:01 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-01-14 23:01 UTC (permalink / raw)
  To: stephen; +Cc: netdev

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 10 Jan 2014 15:11:56 -0800

> 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;

This can't be right, everything I can find says that the length here is:

	the 802.2 packet length - the number of bytes of the 802.2
	(LLC and data) portion of the frame, excluding padding

Which imples that the ethernet header length is not included.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-14 23:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-10 23:11 Fw: [Bug 68501] New: llc_fixup_skb considers PDU len including ETH_HLEN Stephen Hemminger
2014-01-14 23:01 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).