Skip to content

Commit 580e427

Browse files
congwangdavem330
authored andcommitted
net_sched: check error pointer in tcf_dump_walker()
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: syzbot+b47bc4f247856fb4d9e1@syzkaller.appspotmail.com Fixes: 0fedc63 ("net_sched: commit action insertions together") Cc: Vlad Buslov <vladbu@mellanox.com> Cc: Jamal Hadi Salim <jhs@mojatatu.com> Cc: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9a9e774 commit 580e427

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

net/sched/act_api.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ static int tcf_dump_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb,
235235
index++;
236236
if (index < s_i)
237237
continue;
238+
if (IS_ERR(p))
239+
continue;
238240

239241
if (jiffy_since &&
240242
time_after(jiffy_since,

0 commit comments

Comments
 (0)