IP GRO verifies csum again?

2019-07-18 Thread Jacob Wen
Hi, inet_gro_receive verifies IP csum but a NIC already did so and set CHECKSUM_UNNECESSARY. https://github.com/torvalds/linux/blob/v5.2/net/ipv4/af_inet.c#L1432-L1433 if (unlikely(ip_fast_csum((u8 *)iph, 5)))         goto out_unlock; Is this a bug?

Re: [PATCH net] net_sched: sch_mqprio: handle return value of mqprio_queue_get

2019-06-10 Thread Jacob Wen
Hi Cong, This was detected by a tool. Thanks for the review :) I will abandon the patch. On 6/11/19 2:19 AM, Cong Wang wrote: On Sun, Jun 9, 2019 at 11:41 PM Jacob Wen wrote: It may return NULL thus we can't ignore it. How is this possible? All of the callers should have validated th

[PATCH net] net_sched: sch_mqprio: handle return value of mqprio_queue_get

2019-06-09 Thread Jacob Wen
It may return NULL thus we can't ignore it. --- net/sched/sch_mqprio.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c index d05086dc3866..d926056f72ac 100644 --- a/net/sched/sch_mqprio.c +++ b/net/sched/sch_mqprio.c @@ -491

[PATCH net] l2tp: copy 4 more bytes to linear part if necessary

2019-01-30 Thread Jacob Wen
parts") Suggested-by: Guillaume Nault Signed-off-by: Jacob Wen --- net/l2tp/l2tp_core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index dd5ba0c11ab3..fed6becc5daf 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l

Re: [PATCH net v3] net: l2tp: fix reading optional fields of L2TPv3

2019-01-29 Thread Jacob Wen
Thanks for the detailed review. On 1/30/19 6:37 AM, Guillaume Nault wrote: On Tue, Jan 29, 2019 at 02:18:13PM +0800, Jacob Wen wrote: Use pskb_may_pull() to make sure the optional fields are in skb linear parts, so we can safely read them in l2tp_recv_common. Looks fine to me. Just a few

[PATCH net v4] l2tp: fix reading optional fields of L2TPv3

2019-01-29 Thread Jacob Wen
fter pskb_may_pull Fixes: f7faffa3ff8e ("l2tp: Add L2TPv3 protocol support") Fixes: 0d76751fad77 ("l2tp: Add L2TPv3 IP encapsulation (no UDP) support") Fixes: a32e0eec7042 ("l2tp: introduce L2TPv3 IP encapsulation support for IPv6") Signed-off-by: Jacob Wen Acked-by

[PATCH net v3] net: l2tp: fix reading optional fields of L2TPv3

2019-01-28 Thread Jacob Wen
Once reproduced, rx err in /sys/kernel/debug/l2tp/tunnels will increase. Signed-off-by: Jacob Wen --- Changes in v3: 1. To keep consistency, move the code out of l2tp_recv_common. 2. Use "net" instead of "net-next", since this is a bug fix. Changes in v2: 1. Only fix L2TPv3 to mak

Re: [PATCH net-next v2] net: l2tp: fix reading optional fields of L2TPv3

2019-01-27 Thread Jacob Wen
On 1/25/19 12:01 AM, Guillaume Nault wrote: On Thu, Jan 24, 2019 at 03:49:17PM +0800, Jacob Wen wrote: Use pskb_may_pull() to make sure the optional fields are in skb linear parts, so we can safely read them later. It's easy to reproduce the issue with a net driver that supports page

Re: [PATCH net-next v1] l2tp: fix reading optional fields

2019-01-23 Thread Jacob Wen
On 1/23/19 10:51 AM, Eric Dumazet wrote: On 01/22/2019 06:30 PM, Jacob Wen wrote: Use pskb_may_pull() to make sure the optional fields are in skb linear parts. Signed-off-by: Jacob Wen --- v1: fix warning: ISO C90 forbids mixed declarations and code --- net/l2tp/l2tp_core.c | 12

[PATCH net-next v2] net: l2tp: fix reading optional fields of L2TPv3

2019-01-23 Thread Jacob Wen
rr in /sys/kernel/debug/l2tp/tunnels will increase. Signed-off-by: Jacob Wen --- Changes in v2: 1. Only fix L2TPv3 to make code simple. To fix both L2TPv3 and L2TPv2, we'd better refactor l2tp_recv_common. It's complicated to do so. 2. Reloading pointers after pskb_may_pul

[PATCH net-next v1] l2tp: fix reading optional fields

2019-01-22 Thread Jacob Wen
Use pskb_may_pull() to make sure the optional fields are in skb linear parts. Signed-off-by: Jacob Wen --- v1: fix warning: ISO C90 forbids mixed declarations and code --- net/l2tp/l2tp_core.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/net/l2tp/l2tp_core.c

[PATCH] net: l2tp: fix reading optional fields

2019-01-22 Thread Jacob Wen
Use pskb_may_pull() to make sure the optional fields are in skb linear parts. Signed-off-by: Jacob Wen --- net/l2tp/l2tp_core.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index 26f1d435696a..7df927bd4202 100644 --- a/net/l2tp

[PATCH v1] rds: use DIV_ROUND_UP instead of ceil

2019-01-06 Thread Jacob Wen
Yes indeed, DIV_ROUND_UP is in kernel.h. Signed-off-by: Jacob Wen --- v1 - git rebase --- net/rds/ib_send.c | 4 ++-- net/rds/message.c | 4 ++-- net/rds/rds.h | 4 net/rds/send.c| 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/net/rds/ib_send.c b/net/rds

[PATCH] rds: use DIV_ROUND_UP instead of ceil

2019-01-03 Thread Jacob Wen
Yes indeed, DIV_ROUND_UP is in kernel.h. Signed-off-by: Jacob Wen --- net/rds/ib_send.c | 4 ++-- net/rds/message.c | 4 ++-- net/rds/rds.h | 4 net/rds/send.c| 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c index