[PATCH] net/failover: remove redundant fops null check

2020-08-08 Thread Gaurav Singh
Remove redundant fops null check Fixes: 30c8bd5aa8b2c ("net: Introduce generic failover module") Signed-off-by: Gaurav Singh --- net/core/failover.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/failover.c b/net/core/failover.c index b5cd3c727285..63

[PATCH] [net/ipv6] ip6_output: Add ipv6_pinfo null check

2020-08-08 Thread Gaurav Singh
abel() that accesses np without check which may cause a segment violation. Fixes: 513674b5a2c9c ("net: reevalulate autoflowlabel setting after sysctl setting") Signed-off-by: Gaurav Singh --- net/ipv6/ip6_output.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/

[PATCH] [net/ethtool] ethnl_set_linkmodes: remove redundant null check

2020-07-30 Thread Gaurav Singh
info cannot be NULL here since its being accessed earlier in the function: nlmsg_parse(info->nlhdr...). Remove this redundant NULL check. Signed-off-by: Gaurav Singh --- net/ethtool/linkmodes.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/ethtool/linkmodes.c b/

[PATCH] [net/ipv6] ip6_output: Add ipv6_pinfo null check

2020-07-27 Thread Gaurav Singh
e have a call ip6_flow_hdr(hdr, tclass, ip6_make_flowlabel(net, skb, fl6->flowlabel, ip6_autoflowlabel(net, np), fl6)); . Hence np = NULL gets passed in the function ip6_autoflowlabel() which accesses np-> without check which may cause a segment violation. Signed-off-by: Gaurav Singh --- ne

[PATCH] [net/ipv6] ip6_output: Add ipv6_pinfo null check

2020-07-26 Thread Gaurav Singh
ipv6_pinfo is initlialized by inet6_sk() which returns NULL. Hence it can cause segmentation fault. Fix this by adding a NULL check. Signed-off-by: Gaurav Singh --- net/ipv6/ip6_output.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/ipv6/ip6_output.c b/net/ipv6

[PATCH] netfilter: ip6tables: Remove redundant null checks

2020-07-26 Thread Gaurav Singh
netfilter: ip6tables: Remove redundant null checks Signed-off-by: Gaurav Singh --- net/ipv6/netfilter/ip6t_ah.c | 3 +-- net/ipv6/netfilter/ip6t_frag.c | 3 +-- net/ipv6/netfilter/ip6t_hbh.c | 3 +-- net/ipv6/netfilter/ip6t_rt.c | 3 +-- 4 files changed, 4 insertions(+), 8 deletions

[PATCH] [net/ipv6] Remove redundant null check in rt_mt6

2020-06-24 Thread Gaurav Singh
rh cannot be NULL here since its already checked above assignment and is being dereferenced before. Remove the redundant null check. Signed-off-by: Gaurav Singh --- net/ipv6/netfilter/ip6t_rt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/ipv6/netfilter/ip6t_rt.c b

[PATCH] [net/ipv6] Remove redundant null check in hbh_mt6

2020-06-24 Thread Gaurav Singh
oh cannot be NULL since its already checked above after assignment and is being dereferenced before. Remove the redundant null check. Signed-off-by: Gaurav Singh --- net/ipv6/netfilter/ip6t_hbh.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/ipv6/netfilter/ip6t_hbh.c

[PATCH] [net/ipv6] remove redundant null check in frag_mt6

2020-06-24 Thread Gaurav Singh
fh cannot be NULL since its already checked above after assignment and is being dereferenced before. Remove the redundant null check. Signed-off-by: Gaurav Singh --- net/ipv6/netfilter/ip6t_frag.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/ipv6/netfilter

[PATCH] [net/ipv6] Remove redundant null check in ah_mt6

2020-06-24 Thread Gaurav Singh
ah cannot be NULL since its already checked above after assignment and is being dereferenced before in pr(). Remove the redundant null check. Signed-off-by: Gaurav Singh --- net/ipv6/netfilter/ip6t_ah.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/ipv6/netfilter

[PATCH] [net/wan] cosa_init: check bounds before access

2020-06-23 Thread Gaurav Singh
Check i < io bounds before accessing io[i]. Signed-off-by: Gaurav Singh --- drivers/net/wan/cosa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c index 5d6532ad6b78..8797adfa0ab0 100644 --- a/drivers/net/wan/cosa.c ++

[PATCH] [net/ethernet] do_reset: remove dev null check

2020-06-23 Thread Gaurav Singh
dev cannot be NULL here since its already being accessed before. Remove the redundant null check. Signed-off-by: Gaurav Singh --- drivers/net/ethernet/xircom/xirc2ps_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/xircom/xirc2ps_cs.c b/drivers/net

[PATCH] [net/decnet] dn_route_rcv: remove redundant dev null check

2020-06-22 Thread Gaurav Singh
dev cannot be NULL here since its already being accessed before. Remove the redundant null check. Signed-off-by: Gaurav Singh --- net/decnet/dn_route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index 06b9983325cc

[PATCH] [net] dcb_doit: remove redundant skb check

2020-06-22 Thread Gaurav Singh
skb cannot be NULL here since its already being accessed before: sock_net(skb->sk). Remove the redundant null check. Signed-off-by: Gaurav Singh --- net/dcb/dcbnl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index d2a4553bc

[PATCH] [net/sched] tcindex_change: Remove redundant null check

2020-06-21 Thread Gaurav Singh
arg cannot be NULL since its already being dereferenced before. Remove the redundant NULL check. Signed-off-by: Gaurav Singh --- net/sched/cls_tcindex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c index 61e95029c18f

[PATCH] [net] dcb_doit: remove redundant skb check

2020-06-21 Thread Gaurav Singh
Remove the redundant null check for skb. Signed-off-by: Gaurav Singh --- net/dcb/dcbnl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index d2a4553bcf39..84dde5a2066e 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c @@ -1736,7 +1736,7

[PATCH] Fix check in ethtool_rx_flow_rule_create

2020-06-21 Thread Gaurav Singh
Fix check in ethtool_rx_flow_rule_create Signed-off-by: Gaurav Singh --- net/ethtool/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c index b5df90c981c2..21d5fc0f6bb3 100644 --- a/net/ethtool/ioctl.c +++ b/net/ethtool/ioctl.c

[PATCH] [net/sched] Remove redundant skb null check

2020-06-19 Thread Gaurav Singh
Remove the redundant null check for skb. Signed-off-by: Gaurav Singh --- net/sched/act_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 8ac7eb0a8309..90be8fe9128c 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c

[PATCH] [net/sched]: Remove redundant condition in qdisc_graft

2020-06-18 Thread Gaurav Singh
parent cannot be NULL here since its in the else part of the if (parent == NULL) condition. Remove the extra check on parent pointer. Signed-off-by: Gaurav Singh --- net/sched/sch_api.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/sched/sch_api.c b/net/sched

[PATCH] [net/sched]: Remove redundant condition in qdisc_graft

2020-06-17 Thread Gaurav Singh
parent cannot be NULL here since its in the else part of the if (parent == NULL) condition. Remove the extra check on parent pointer. Signed-off-by: Gaurav Singh --- net/sched/sch_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c

[PATCH] [net/sched]: Remove redundant condition in qdisc_graft

2020-06-17 Thread Gaurav Singh
Signed-off-by: Gaurav Singh Fix build errors Signed-off-by: Gaurav Singh --- net/sched/sch_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 9a3449b56bd6..be93ebcdb18d 100644 --- a/net/sched/sch_api.c +++ b/net/sched

[PATCH] [net/sched] Fix null pointer deref skb in tc_ctl_action

2020-06-17 Thread Gaurav Singh
Add null check for skb Signed-off-by: Gaurav Singh --- net/sched/act_api.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 8ac7eb0a8309..fd584821d75a 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -1473,9

[PATCH] [net/sched]: Remove redundant condition in qdisc_graft

2020-06-17 Thread Gaurav Singh
parent cannot be NULL here since its in the else part of the if (parent == NULL) condition. Remove the extra check on parent pointer. Signed-off-by: Gaurav Singh --- net/sched/sch_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c

[PATCH] [bpf] xdp_redirect_cpu_user: Fix null pointer dereference

2020-06-14 Thread Gaurav Singh
Memset() on the pointer right after malloc() can cause a null pointer dereference if it failed to allocate memory. Fix this by replacing malloc/memset with a single calloc(). Signed-off-by: Gaurav Singh --- samples/bpf/xdp_redirect_cpu_user.c | 11 +++ 1 file changed, 3 insertions(+), 8

[PATCH] [bpf] xdp_monitor_user: Fix null pointer dereference

2020-06-14 Thread Gaurav Singh
Memset() on the pointer right after malloc() can cause a null pointer dereference if it failed to allocate memory. Fix this by replacing malloc/memset with a single calloc(). Signed-off-by: Gaurav Singh --- samples/bpf/xdp_monitor_user.c | 8 ++-- 1 file changed, 2 insertions(+), 6

[PATCH] Fix null pointer dereference in vector_user_bpf

2020-06-13 Thread Gaurav Singh
The bpf_prog is being checked for !NULL after uml_kmalloc but later its used directly for example: bpf_prog->filter = bpf and is also later returned upon success. Fix this, do a NULL check and return right away. Signed-off-by: Gaurav Singh --- arch/um/drivers/vector_user.c | 8 +--- 1 f

[PATCH] xdp_rxq_info_user: Fix null pointer dereference. Replace malloc/memset with calloc.

2020-06-12 Thread Gaurav Singh
Memset on the pointer right after malloc can cause a null pointer deference if it failed to allocate memory. A simple fix is to replace malloc/memset with a calloc() Fixes: 0fca931a6f21 ("samples/bpf: program demonstrating access to xdp_rxq_info") Signed-off-by: Gaurav Singh --- s

[PATCH] xdp_rxq_info_user: Replace malloc/memset w/calloc

2020-06-11 Thread Gaurav Singh
Replace malloc/memset with calloc Fixes: 0fca931a6f21 ("samples/bpf: program demonstrating access to xdp_rxq_info") Signed-off-by: Gaurav Singh --- samples/bpf/xdp_rxq_info_user.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/samples/bpf/xdp_rxq_i

[PATCH] xdp_rxq_info_user: Replace malloc/memset w/calloc

2020-06-11 Thread Gaurav Singh
Replace malloc/memset with calloc Fixes: 0fca931a6f21 ("samples/bpf: program demonstrating access to xdp_rxq_info") Signed-off-by: Gaurav Singh --- samples/bpf/xdp_rxq_info_user.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/samples/bpf/xdp_rxq_i

[PATCH] xdp_rxq_info_user: Replace malloc/memset w/calloc

2020-06-11 Thread Gaurav Singh
Replace malloc/memset with calloc Signed-off-by: Gaurav Singh --- samples/bpf/xdp_rxq_info_user.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/samples/bpf/xdp_rxq_info_user.c b/samples/bpf/xdp_rxq_info_user.c index 4fe47502ebed..caa4e7ffcfc7 100644 --- a

[PATCH] Fix null pointer dereference in vector_user_bpf

2020-06-10 Thread Gaurav Singh
The bpf_prog is being checked for !NULL after uml_kmalloc but later its used directly for example: bpf_prog->filter = bpf and is also later returned upon success. Fix this, do a NULL check and return right away. Signed-off-by: Gaurav Singh --- arch/um/drivers/vector_user.c | 8 +--- 1 f

[PATCH] Fix null pointer dereference in vector_user_bpf

2020-06-09 Thread Gaurav Singh
Signed-off-by: Gaurav Singh The bpf_prog is being checked for !NULL after uml_kmalloc but later its used directly for example: bpf_prog->filter = bpf and is also later returned upon success. Fix this, do a NULL check and return right away. --- arch/um/drivers/vector_user.c | 8 +---

[PATCH] xdp_rxq_info_user: Add null check after malloc

2020-06-09 Thread Gaurav Singh
Signed-off-by: Gaurav Singh The memset call is made right after malloc call which can return a NULL pointer upon failure causing a segmentation fault. Fix this by adding a null check right after malloc() and then do memset(). --- samples/bpf/xdp_rxq_info_user.c | 6 +++--- 1 file changed, 3

[PATCH] bpf: alloc_record_per_cpu Add null check after malloc

2020-06-09 Thread Gaurav Singh
The memset call is made right after malloc call. To fix this, add the null check right after malloc and then do memset. Signed-off-by: Gaurav Singh --- samples/bpf/xdp_rxq_info_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/bpf/xdp_rxq_info_user.c b/samples

[PATCH] bpf: alloc_record_per_cpu Add null check after malloc

2020-06-09 Thread Gaurav Singh
Signed-off-by: Gaurav Singh --- samples/bpf/xdp_rxq_info_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/bpf/xdp_rxq_info_user.c b/samples/bpf/xdp_rxq_info_user.c index 4fe47502ebed..490b07b7df78 100644 --- a/samples/bpf/xdp_rxq_info_user.c +++ b/samples/bpf

[no subject]

2020-06-09 Thread Gaurav Singh
Please find the patch below. Thanks and regards, Gaurav. >From Gaurav Singh # This line is ignored. From: Gaurav Singh Reply-To: Subject: In-Reply-To: