Re: [PATCH] net: qrtr: fix len of skb_put_padto in qrtr_node_enqueue

From
David Miller <davem@davemloft.net>
Date
2020-01-03 00:22:51
Also in
ath11k, lkml
Reply to
Wen Gong, 2019-12-31
From: Wen Gong <redacted>
Date: Tue, 31 Dec 2019 17:32:42 +0800
From: Carl Huang <redacted>

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

Signed-off-by: Carl Huang <redacted>
Signed-off-by: Wen Gong <redacted>
 ...
quoted hunk ↗ jump to hunk
@@ -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.
Thread (4 messages) 4 messages, 2 authors, last reply 2020-01-03
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help