mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-30 15:53:22 -05:00
net_sched: check error pointer in tcf_dump_walker()
[ Upstream commit 580e4273d7a883ececfefa692c1f96bdbacb99b5 ] Although we take RTNL on dump path, it is possible to skip RTNL on insertion path. So the following race condition is possible: rtnl_lock() // no rtnl lock mutex_lock(&idrinfo->lock); // insert ERR_PTR(-EBUSY) mutex_unlock(&idrinfo->lock); tc_dump_action() rtnl_unlock() So we have to skip those temporary -EBUSY entries on dump path too. Reported-and-tested-by: [email protected] Fixes: 0fedc63fadf0 ("net_sched: commit action insertions together") Cc: Vlad Buslov <[email protected]> Cc: Jamal Hadi Salim <[email protected]> Cc: Jiri Pirko <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
5b1de8e15f
commit
99372c38a9
1 changed files with 2 additions and 0 deletions
|
|
@ -231,6 +231,8 @@ static int tcf_dump_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb,
|
|||
index++;
|
||||
if (index < s_i)
|
||||
continue;
|
||||
if (IS_ERR(p))
|
||||
continue;
|
||||
|
||||
if (jiffy_since &&
|
||||
time_after(jiffy_since,
|
||||
|
|
|
|||
Loading…
Reference in a new issue