All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: qrtr: fix len of skb_put_padto in qrtr_node_enqueue
@ 2019-12-31  9:32 ` Wen Gong
  0 siblings, 0 replies; 8+ messages in thread
From: Wen Gong @ 2019-12-31  9:32 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, ath11k

From: Carl Huang <cjhuang@codeaurora.org>

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

Signed-off-by: Carl Huang <cjhuang@codeaurora.org>
Signed-off-by: Wen Gong <wgong@codeaurora.org>
---
 net/qrtr/qrtr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
index 88f98f27ad88..3d24d45be5f4 100644
--- a/net/qrtr/qrtr.c
+++ b/net/qrtr/qrtr.c
@@ -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)
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] net: qrtr: fix len of skb_put_padto in qrtr_node_enqueue
@ 2019-12-31  9:32 ` Wen Gong
  0 siblings, 0 replies; 8+ messages in thread
From: Wen Gong @ 2019-12-31  9:32 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, ath11k

From: Carl Huang <cjhuang@codeaurora.org>

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

Signed-off-by: Carl Huang <cjhuang@codeaurora.org>
Signed-off-by: Wen Gong <wgong@codeaurora.org>
---
 net/qrtr/qrtr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
index 88f98f27ad88..3d24d45be5f4 100644
--- a/net/qrtr/qrtr.c
+++ b/net/qrtr/qrtr.c
@@ -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)
-- 
2.23.0

_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] net: qrtr: fix len of skb_put_padto in qrtr_node_enqueue
  2019-12-31  9:32 ` Wen Gong
@ 2020-01-03  0:22   ` David Miller
  -1 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2020-01-03  0:22 UTC (permalink / raw)
  To: wgong; +Cc: netdev, linux-kernel, ath11k

From: Wen Gong <wgong@codeaurora.org>
Date: Tue, 31 Dec 2019 17:32:42 +0800

> From: Carl Huang <cjhuang@codeaurora.org>
> 
> The len used for skb_put_padto is wrong, it need to add len of hdr.
> 
> Signed-off-by: Carl Huang <cjhuang@codeaurora.org>
> Signed-off-by: Wen Gong <wgong@codeaurora.org>
 ...
> @@ -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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] net: qrtr: fix len of skb_put_padto in qrtr_node_enqueue
@ 2020-01-03  0:22   ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2020-01-03  0:22 UTC (permalink / raw)
  To: wgong; +Cc: netdev, linux-kernel, ath11k

From: Wen Gong <wgong@codeaurora.org>
Date: Tue, 31 Dec 2019 17:32:42 +0800

> From: Carl Huang <cjhuang@codeaurora.org>
> 
> The len used for skb_put_padto is wrong, it need to add len of hdr.
> 
> Signed-off-by: Carl Huang <cjhuang@codeaurora.org>
> Signed-off-by: Wen Gong <wgong@codeaurora.org>
 ...
> @@ -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.


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] net: qrtr: fix len of skb_put_padto in qrtr_node_enqueue
  2020-01-03  0:22   ` David Miller
@ 2020-01-03  1:37     ` Wen Gong
  -1 siblings, 0 replies; 8+ messages in thread
From: Wen Gong @ 2020-01-03  1:37 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-kernel, ath11k

On 2020-01-03 08:22, David Miller wrote:

> 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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] net: qrtr: fix len of skb_put_padto in qrtr_node_enqueue
@ 2020-01-03  1:37     ` Wen Gong
  0 siblings, 0 replies; 8+ messages in thread
From: Wen Gong @ 2020-01-03  1:37 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-kernel, ath11k

On 2020-01-03 08:22, David Miller wrote:

> 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.

_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] net: qrtr: fix len of skb_put_padto in qrtr_node_enqueue
  2020-01-03  1:37     ` Wen Gong
@ 2020-01-03  4:52       ` Wen Gong
  -1 siblings, 0 replies; 8+ messages in thread
From: Wen Gong @ 2020-01-03  4:52 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-kernel, ath11k

On 2020-01-03 09:37, Wen Gong wrote:
> On 2020-01-03 08:22, David Miller wrote:
> 
>> 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.
v2:
http://patchwork.ozlabs.org/patch/1217201/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] net: qrtr: fix len of skb_put_padto in qrtr_node_enqueue
@ 2020-01-03  4:52       ` Wen Gong
  0 siblings, 0 replies; 8+ messages in thread
From: Wen Gong @ 2020-01-03  4:52 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-kernel, ath11k

On 2020-01-03 09:37, Wen Gong wrote:
> On 2020-01-03 08:22, David Miller wrote:
> 
>> 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.
v2:
http://patchwork.ozlabs.org/patch/1217201/

_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-01-03  4:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-31  9:32 [PATCH] net: qrtr: fix len of skb_put_padto in qrtr_node_enqueue Wen Gong
2019-12-31  9:32 ` Wen Gong
2020-01-03  0:22 ` David Miller
2020-01-03  0:22   ` David Miller
2020-01-03  1:37   ` Wen Gong
2020-01-03  1:37     ` Wen Gong
2020-01-03  4:52     ` Wen Gong
2020-01-03  4:52       ` Wen Gong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.