netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch net-next] net: sched: cls_matchall: fix null pointer dereference
@ 2017-05-22 14:46 Jiri Pirko
  2017-05-22 18:54 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Pirko @ 2017-05-22 14:46 UTC (permalink / raw)
  To: netdev; +Cc: davem, jhs, xiyou.wangcong, mlxsw, colin.king, yotamg

From: Jiri Pirko <jiri@mellanox.com>

Since the head is guaranteed by the check above to be null, the call_rcu
would explode. Remove the previously logically dead code that was made
logically very much alive and kicking.

Fixes: 985538eee06f ("net/sched: remove redundant null check on head")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 net/sched/cls_matchall.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c
index dee469f..51859b8 100644
--- a/net/sched/cls_matchall.c
+++ b/net/sched/cls_matchall.c
@@ -203,7 +203,6 @@ static int mall_change(struct net *net, struct sk_buff *in_skb,
 
 	*arg = (unsigned long) head;
 	rcu_assign_pointer(tp->root, new);
-	call_rcu(&head->rcu, mall_destroy_rcu);
 	return 0;
 
 err_replace_hw_filter:
-- 
2.9.3

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

* Re: [patch net-next] net: sched: cls_matchall: fix null pointer dereference
  2017-05-22 14:46 [patch net-next] net: sched: cls_matchall: fix null pointer dereference Jiri Pirko
@ 2017-05-22 18:54 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-05-22 18:54 UTC (permalink / raw)
  To: jiri; +Cc: netdev, jhs, xiyou.wangcong, mlxsw, colin.king, yotamg

From: Jiri Pirko <jiri@resnulli.us>
Date: Mon, 22 May 2017 16:46:13 +0200

> From: Jiri Pirko <jiri@mellanox.com>
> 
> Since the head is guaranteed by the check above to be null, the call_rcu
> would explode. Remove the previously logically dead code that was made
> logically very much alive and kicking.
> 
> Fixes: 985538eee06f ("net/sched: remove redundant null check on head")
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>

Ouch... that's kinda scary.

This fix is needed in the 'net' tree so that's where I have applied
it.

Thanks.

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

end of thread, other threads:[~2017-05-22 18:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-22 14:46 [patch net-next] net: sched: cls_matchall: fix null pointer dereference Jiri Pirko
2017-05-22 18:54 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).