Skip to contentSkip to conversation

net: qrtr: fix len of skb_put_padto in qrtr_node_enqueue

PATCH Superseded Wen Gong 2 participants 4 messages Dec 31, 2019 – Jan 3, 2020

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Wen Gong

author
#0 lore raw

PATCH 1/1 net: qrtr: fix len of skb_put_padto in qrtr_node_enqueue

From: Carl Huang <[email protected]>

The len used for skb_put_padto is wrong, it need to add len of hdr.

---
 net/qrtr/qrtr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/qrtr/qrtr.c +1 -1
index 88f98f27ad88..3d24d45be5f4 100644
@@ -196,7 +196,7 @@ static int qrtr_node_enqueue(struct qrtr_node *node, struct sk_buff *skb,
 	hdr->size = cpu_to_le32(len);
 	hdr->confirm_rx = 0;
 
-	skb_put_padto(skb, ALIGN(len, 4));
+	skb_put_padto(skb, ALIGN(len, 4) + sizeof(*hdr));
 
 	mutex_lock(&node->ep_lock);
 	if (node->ep)
Signature · 6 lines
2.23.0

_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
maintainer
#1 lore raw

From: Wen Gong <[email protected]>
Date: Tue, 31 Dec 2019 17:32:42 +0800

Quoted 6 lines

From: Carl Huang <[email protected]>

The len used for skb_put_padto is wrong, it need to add len of hdr.

...

net/qrtr/qrtr.c static int qrtr_node_enqueue(struct qrtr_node *node, struct sk_buff *skb, · line 199

Quoted 6 lines
net/qrtr/qrtr.c +1 -1
@@ -196,7 +196,7 @@ static int qrtr_node_enqueue(struct qrtr_node *node, struct sk_buff *skb,
 	hdr->size = cpu_to_le32(len);
 	hdr->confirm_rx = 0;
 
-	skb_put_padto(skb, ALIGN(len, 4));
+	skb_put_padto(skb, ALIGN(len, 4) + sizeof(*hdr));

I don't think this is correct.

The 'hdr' was already "pushed" earlier in this file.

Here we are padding the area after the header, which is being "put".

I'm not applying this. If you still think it is correct, you must explain in detail why it is and add that description to the commit log message.

Thank you.

author
#2 lore raw
Quoted 10 lines · David Miller

I don't think this is correct.

The 'hdr' was already "pushed" earlier in this file.

Here we are padding the area after the header, which is being "put".

I'm not applying this. If you still think it is correct, you must explain in detail why it is and add that description to the commit log message.

Thank you.

Thanks David.
I will add more description and send patch v2.

author
#3 lore raw
Quoted 8 lines · Wen Gong
Quoted 6 lines · David Miller

I don't think this is correct.

The 'hdr' was already "pushed" earlier in this file.

Here we are padding the area after the header, which is being "put".

Quoted 7 lines
Quoted 4 lines

I'm not applying this. If you still think it is correct, you must explain in detail why it is and add that description to the commit log message.

Thank you.

Thanks David.
I will add more description and send patch v2.

v2:
http://patchwork.ozlabs.org/patch/1217201/