]> git.baikalelectronics.ru Git - kernel.git/commit
net_sched: fix a crash in tc_new_tfilter()
authorCong Wang <xiyou.wangcong@gmail.com>
Thu, 27 Sep 2018 20:42:19 +0000 (13:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 Oct 2018 06:09:41 +0000 (23:09 -0700)
commit2a9c070f2b651df121740932c02f9a2c3e20abaa
tree84082e01896498cde177e058e72e6509786055bf
parent7355f4da44bc2bee26abbaec5db77dbf4fbace63
net_sched: fix a crash in tc_new_tfilter()

When tcf_block_find() fails, it already rollbacks the qdisc refcnt,
so its caller doesn't need to clean up this again. Avoid calling
qdisc_put() again by resetting qdisc to NULL for callers.

Reported-by: syzbot+37b8770e6d5a8220a039@syzkaller.appspotmail.com
Fixes: b67d22e89d36 ("net: sched: use Qdisc rcu API instead of relying on rtnl lock")
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_api.c