llc: fix skb size for test responses
Subsystems (3)
PATCH 1/1 llc: fix skb size for test responses
Hi
The llc test command is used for a layer2 ping and contains a variable length payload that we must include in the response. Use the size of the received skb as the size of the skb we must allocate to hold the payload.
This resolved an skb_over_panic(), when trying to copy the payload into what was a hard coded skb of size 128.
net/llc/llc_s_ac.c +10 -1
@@ -148,9 +148,18 @@ int llc_sap_action_send_test_r(struct llllc_pdu_decode_sa (skb, mac_da);llc_pdu_decode_da (skb, mac_sa);llc_pdu_decode_ssap (skb, &dsap); - nskb =llc_alloc_frame (NULL , skb->dev); + nskb =alloc_skb (skb->end - skb->head,GFP_ATOMIC ); +if (!nskb) goto out; + +skb_reset_mac_header (nskb); +skb_reserve (nskb,50 ); +skb_reset_network_header (nskb); +skb_reset_transport_header (nskb); + nskb->protocol =htons (ETH_P_802_2 ); + nskb->dev = skb->dev; +llc_pdu_header_init (nskb,LLC_PDU_TYPE_U , sap->laddr.lsap, dsap,LLC_PDU_RSP );llc_pdu_init_as_test_rsp (nskb, skb);
net/llc/llc_station.c +9 -1
@@ -298,10 +298,18 @@ static int llc_station_ac_send_test_r(st {u8 mac_da[ETH_ALEN ], dsap;int rc =1 ; -struct sk_buff *nskb =llc_alloc_frame (NULL , skb->dev); +struct sk_buff *nskb =alloc_skb (skb->end - skb->head,GFP_ATOMIC );if (!nskb) goto out; + +skb_reset_mac_header (nskb); +skb_reserve (nskb,50 ); +skb_reset_network_header (nskb); +skb_reset_transport_header (nskb); + nskb->protocol =htons (ETH_P_802_2 ); + nskb->dev = skb->dev; + rc =0 ;llc_pdu_decode_sa (skb, mac_da);llc_pdu_decode_ssap (skb, &dsap);
David Miller
maintainerFrom: Jim Westfall <[email protected]>
Date: Sun, 24 Feb 2008 11:07:58 -0800
Quoted 10 lines
Hi
The llc test command is used for a layer2 ping and contains a variable length payload that we must include in the response. Use the size of the received skb as the size of the skb we must allocate to hold the payload.
This resolved an
skb_over_panic(), when trying to copy the payload into what was a hard coded skb of size 128.Signed-off-by Jim Westfall <[email protected]>
Arnaldo, please review Jim's patch, thanks!
David Miller <[email protected]> wrote [02.24.08]:
Quoted 9 lines
From: Jim Westfall <[email protected]>
Date: Sun, 24 Feb 2008 11:07:58 -0800Quoted 6 lines
Hi
The llc test command is used for a layer2 ping and contains a variable length payload that we must include in the response. Use the size of the received skb as the size of the skb we must allocate to hold the payload.
Quoted 6 lines
Quoted 4 lines
This resolved an
skb_over_panic(), when trying to copy the payload into what was a hard coded skb of size 128.Signed-off-by Jim Westfall <[email protected]>Arnaldo, please review Jim's patch, thanks!
Our of curiosity did you all get my 2nd patch?
Subject: [PATCH] llc: dont trust payload size on test cmd
I sent it a few minutes after this one, but seems like it never made it to the list. My local smtp shows it was delivered sucussfully to vger.kernel.org.
thanks
jim
2008/2/25, Jim Westfall <[email protected]>:
Quoted 17 lines
David Miller <[email protected]> wrote [02.24.08]:
Quoted 9 lines
From: Jim Westfall <[email protected]>
Date: Sun, 24 Feb 2008 11:07:58 -0800Quoted 6 lines
Hi
The llc test command is used for a layer2 ping and contains a variable length payload that we must include in the response. Use the size of the received skb as the size of the skb we must allocate to hold the payload.
Quoted 6 lines
Quoted 4 lines
This resolved an
skb_over_panic(), when trying to copy the payload into what was a hard coded skb of size 128.Signed-off-by Jim Westfall <[email protected]>Arnaldo, please review Jim's patch, thanks!
Quoted 8 lines
Our of curiosity did you all get my 2nd patch?
Subject: [PATCH] llc: dont trust payload size on test cmd
I sent it a few minutes after this one, but seems like it never made it to the list. My local smtp shows it was delivered sucussfully to vger.kernel.org.
Jim,
Could you please send it again?
I cannot find your second patch on the list.
I have a pending patch for LLC as well, so I want to avoid conflict with yours.
Thanks,
Joonwoo
Em Sun, Feb 24, 2008 at 09:04:21PM -0800, Jim Westfall escreveu:
Quoted 17 lines
David Miller <[email protected]> wrote [02.24.08]:
Quoted 9 lines
From: Jim Westfall <[email protected]>
Date: Sun, 24 Feb 2008 11:07:58 -0800Quoted 6 lines
Hi
The llc test command is used for a layer2 ping and contains a variable length payload that we must include in the response. Use the size of the received skb as the size of the skb we must allocate to hold the payload.
Quoted 6 lines
Quoted 4 lines
This resolved an
skb_over_panic(), when trying to copy the payload into what was a hard coded skb of size 128.Signed-off-by Jim Westfall <[email protected]>Arnaldo, please review Jim's patch, thanks!
Quoted 7 lines
Our of curiosity did you all get my 2nd patch?
Subject: [PATCH] llc: dont trust payload size on test cmd
I sent it a few minutes after this one, but seems like it never made it to the list. My local smtp shows it was delivered sucussfully to vger.kernel.org.
I got it, but you made a mistake on the To: address:
From: Jim Westfall <[email protected]>
Subject: [PATCH] llc: dont trust payload size on test cmd
To: "To:netdev"@vger.kernel.org, [email protected]
David Miller
maintainerFrom: Jim Westfall <[email protected]>
Date: Sun, 24 Feb 2008 21:04:21 -0800
Quoted 3 lines
I sent it a few minutes after this one, but seems like it never made it to the list. My local smtp shows it was delivered sucussfully to vger.kernel.org.
Usually this means some string in the email triggered our Majordomo level regexp filters, they are listed at:
Quoted 15 lines · Jim Westfall
Hi
The llc test command is used for a layer2 ping and contains a variable length payload that we must include in the response. Use the size of the received skb as the size of the skb we must allocate to hold the payload.
This resolved an
skb_over_panic(), when trying to copy the payload into what was a hard coded skb of size 128.Signed-off-by Jim Westfall <[email protected]>diff -urp
linux-2.6.24.2.org/net/llc/llc_s_ac.clinux-2.6.24.2/net/llc/llc_s_ac.c
net/llc/llc_s_ac.c int llc_sap_action_send_test_r(struct ll · line 151
Quoted 5 lines
net/llc/llc_s_ac.c +1
-1@@ -148,9 +148,18 @@ int llc_sap_action_send_test_r(struct llllc_pdu_decode_sa (skb, mac_da);llc_pdu_decode_da (skb, mac_sa);llc_pdu_decode_ssap (skb, &dsap); - nskb =llc_alloc_frame (NULL , skb->dev); + nskb =alloc_skb (skb->end - skb->head,GFP_ATOMIC );
Jim,
Not enough.
Because of 'skb_reserve(nskb, 50)', we need additional 50bytes.
Quoted 18 lines
net/llc/llc_s_ac.c +9
-0+if (!nskb) goto out; + +skb_reset_mac_header (nskb); +skb_reserve (nskb,50 ); +skb_reset_network_header (nskb); +skb_reset_transport_header (nskb); + nskb->protocol =htons (ETH_P_802_2 ); + nskb->dev = skb->dev; +llc_pdu_header_init (nskb,LLC_PDU_TYPE_U , sap->laddr.lsap, dsap,LLC_PDU_RSP );llc_pdu_init_as_test_rsp (nskb, skb);diff -urp
linux-2.6.24.2.org/net/llc/llc_station.clinux-2.6.24.2/net/llc/llc_station.c
net/llc/llc_station.c static int llc_station_ac_send_test_r(st · line 301
Quoted 5 lines
net/llc/llc_station.c +1
-1@@ -298,10 +298,18 @@ static int llc_station_ac_send_test_r(st {u8 mac_da[ETH_ALEN ], dsap;int rc =1 ; -struct sk_buff *nskb =llc_alloc_frame (NULL , skb->dev); +struct sk_buff *nskb =alloc_skb (skb->end - skb->head,GFP_ATOMIC );
Also here.
Quoted 5 lines
net/llc/llc_station.c +2
-0if (!nskb) goto out; + +skb_reset_mac_header (nskb);
net/llc/llc_station.c static int llc_station_ac_send_test_r(st
Quoted 10 lines
net/llc/llc_station.c +6
-0+skb_reserve (nskb,50 ); +skb_reset_network_header (nskb); +skb_reset_transport_header (nskb); + nskb->protocol =htons (ETH_P_802_2 ); + nskb->dev = skb->dev; + rc =0 ;llc_pdu_decode_sa (skb, mac_da);llc_pdu_decode_ssap (skb, &dsap);
Thanks,
Joonwoo
Quoted 4 lines
--
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