netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: vitalyb@telenet.dn.ua
Cc: bugzilla-daemon@bugzilla.kernel.org,
	bugme-daemon@bugzilla.kernel.org, netdev@vger.kernel.org
Subject: Re: [Bugme-new] [Bug 32872] New: LLC PDU is dropped if skb is not linear
Date: Mon, 11 Apr 2011 16:48:12 -0700	[thread overview]
Message-ID: <20110411164812.8f84f995.akpm@linux-foundation.org> (raw)
In-Reply-To: <bug-32872-10286@https.bugzilla.kernel.org/>


(switched to email.  Please respond via emailed reply-to-all, not via the
bugzilla web interface).

On Fri, 8 Apr 2011 09:52:34 GMT
bugzilla-daemon@bugzilla.kernel.org wrote:

> https://bugzilla.kernel.org/show_bug.cgi?id=32872
> 
>            Summary: LLC PDU is dropped if skb is not linear
>            Product: Networking
>            Version: 2.5
>     Kernel Version: 2.6.32
>           Platform: All
>         OS/Version: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: Other
>         AssignedTo: acme@ghostprotocols.net
>         ReportedBy: vitalyb@telenet.dn.ua
>         Regression: No
> 
> 
> If skb consists of several fragments this check fails
> net/llc/llc_input.c:
> =============================================
> llc_fixup_skb()
> ...
>     pdu = (struct llc_pdu_un *)skb->data;
> ...
>     __be16 pdulen = eth_hdr(skb)->h_proto;
>     s32 data_size = ntohs(pdulen) - llc_len;
> 
>     if (data_size < 0 ||
>         ((skb_tail_pointer(skb) -
>           (u8 *)pdu) - llc_len) < data_size)
>         return 0;
> =============================================
> 
> and packet is silently dropped.
> 
> This breaks GVRP protocol if received packet is large ( > 512 bytes on my
> system) and contains a Leave All message. Since Leave All is missed,
> corresponding JoinIns are not sent and switch unregisters VLANs from port.
> 
> Attached patch seems to resolve this issue, but I don't know if it's a correct
> solution.

--- linux-2.6.32.36/net/llc/llc_input.c.orig	2009-12-03 05:51:21.000000000 +0200
+++ linux-2.6.32.36/net/llc/llc_input.c	2011-04-08 08:57:29.000000000 +0300
@@ -105,6 +105,11 @@
 	if (unlikely(!pskb_may_pull(skb, sizeof(*pdu))))
 		return 0;
 
+	if (skb->data_len != 0){
+	    if (unlikely(skb_linearize(skb)))
+		return 0;
+	}
+
 	pdu = (struct llc_pdu_un *)skb->data;
 	if ((pdu->ctrl_1 & LLC_PDU_TYPE_MASK) == LLC_PDU_TYPE_U)
 		llc_len = 1;


2.6.32 is a pretty old kernel - we'll need to verify if current kernels
have the same problem.

Please don't send patches via bugzilla - it causes lots of problems
with our usual patch management and review processes.  It's preferred
that patches be sent via email as per Documentation/SubmittingPatches,
and that they include a Signed-off-by:, as described in that file.

Thanks.

       reply	other threads:[~2011-04-11 23:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-32872-10286@https.bugzilla.kernel.org/>
2011-04-11 23:48 ` Andrew Morton [this message]
2011-04-12  1:56   ` [Bugme-new] [Bug 32872] New: LLC PDU is dropped if skb is not linear David Miller

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=20110411164812.8f84f995.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=bugme-daemon@bugzilla.kernel.org \
    --cc=bugzilla-daemon@bugzilla.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vitalyb@telenet.dn.ua \
    /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;
as well as URLs for NNTP newsgroup(s).