]> git.baikalelectronics.ru Git - kernel.git/commit
net_sched: check noop_qdisc before qdisc_hash_add()
authorWANG Cong <xiyou.wangcong@gmail.com>
Wed, 5 Apr 2017 01:51:30 +0000 (18:51 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Apr 2017 19:28:39 +0000 (12:28 -0700)
commita267352ac725bd471db97b41f1dec0345d47e206
tree14335495cf00e966fa425b467395b6b38dd77a57
parente2d5925f24cce40a7b7390911a74a33e434d2e15
net_sched: check noop_qdisc before qdisc_hash_add()

Dmitry reported a crash when injecting faults in
attach_one_default_qdisc() and dev->qdisc is still
a noop_disc, the check before qdisc_hash_add() fails
to catch it because it tests NULL. We should test
against noop_qdisc since it is the default qdisc
at this point.

Fixes: f7729dc48077 ("net: sched: convert qdisc linked list to hashtable")
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_generic.c