Skip to contentSkip to conversation

: bogus llc packet length

PATCH Arnaldo Carvalho de Melo 2 participants 2 messages Mar 24, 2008 – Mar 25, 2008 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Arnaldo Carvalho de Melo

author Acked-by
#1 lore raw
In reply to a message not in the archive

Em Mon, Mar 24, 2008 at 05:34:16PM +0900, [email protected] escreveu:

Quoted 11 lines

From: Joonwoo Park <[email protected]>

discard llc packet which has bogus packet length.

---

net/llc/llc_input.c +0 -0
index c40c9b2..a2bbc7c 100644

net/llc/llc_input.c static inline int llc_fixup_skb(struct sk_buff *skb) · line 125

Quoted 10 lines
net/llc/llc_input.c +5 -1
@@ -117,8 +117,12 @@ static inline int llc_fixup_skb(struct sk_buff *skb)
 	skb_pull(skb, llc_len);
 	if (skb->protocol == htons(ETH_P_802_2)) {
 		__be16 pdulen = eth_hdr(skb)->h_proto;
-		u16 data_size = ntohs(pdulen) - llc_len;
+		s32 data_size = ntohs(pdulen) - llc_len;
 
+		if (data_size < 0
+		    || ((skb_tail_pointer(skb) - (u8 *)pdu) - llc_len)
+			< data_size)
+			return 0;

Rewrite this as:

		if (data_size < 0 ||
		    ((skb_tail_pointer(skb) -
		      (u8 *)pdu) - llc_len) < data_size)

And stick my:

:-)

Quoted 10 lines
net/llc/llc_input.c +0 -0
 		if (unlikely(pskb_trim_rcsum(skb, data_size)))
 			return 0;
 	}
Signature · 6 lines
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw

2008/3/25, Arnaldo Carvalho de Melo <[email protected]>:

Quoted 25 lines

Em Mon, Mar 24, 2008 at 05:34:16PM +0900, [email protected] escreveu:

Quoted 11 lines

From: Joonwoo Park <[email protected]>

discard llc packet which has bogus packet length.

---

net/llc/llc_input.c +0 -0
index c40c9b2..a2bbc7c 100644

net/llc/llc_input.c static inline int llc_fixup_skb(struct sk_buff *skb) · line 125

Quoted 10 lines
net/llc/llc_input.c +5 -1
@@ -117,8 +117,12 @@ static inline int llc_fixup_skb(struct sk_buff *skb)
      skb_pull(skb, llc_len);
      if (skb->protocol == htons(ETH_P_802_2)) {
              __be16 pdulen = eth_hdr(skb)->h_proto;
-             u16 data_size = ntohs(pdulen) - llc_len;
+             s32 data_size = ntohs(pdulen) - llc_len;
 
+             if (data_size < 0
+                 || ((skb_tail_pointer(skb) - (u8 *)pdu) - llc_len)
+                     < data_size)
+                     return 0;

Rewrite this as:

Quoted 3 lines
               if (data_size < 0 ||
                   ((skb_tail_pointer(skb) -
                     (u8 *)pdu) - llc_len) < data_size)

Thanks Arnaldo.
Dave, I'll update this with the others.

Quoted 6 lines

And stick my:

:-)

Thanks,
Joonwoo