Skip to contentSkip to conversation

net: sched: cls_matchall: fix null pointer dereference

PATCH In review Jiri Pirko 2 participants 2 messages May 22, 2017

Subsystems (3)
lore
Share & tools
lore

Jiri Pirko

author maintainer
#0 lore raw

PATCH 1/1 net: sched: cls_matchall: fix null pointer dereference

From: Jiri Pirko <[email protected]>

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")
---
 net/sched/cls_matchall.c | 1 -
 1 file changed, 1 deletion(-)
net/sched/cls_matchall.c +0 -1
index dee469f..51859b8 100644
@@ -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:
Signature · 1 line
2.9.3
maintainer
#1 lore raw

From: Jiri Pirko <[email protected]>
Date: Mon, 22 May 2017 16:46:13 +0200

Quoted 8 lines

From: Jiri Pirko <[email protected]>

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")

Ouch... that's kinda scary.

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

Thanks.