diff options
author | Cong Wang <[email protected]> | 2017-10-27 22:08:56 -0700 |
---|---|---|
committer | David S. Miller <[email protected]> | 2017-10-29 17:55:03 +0900 |
commit | 50317fce2cc70a2bbbc4b42c31bbad510382a53c (patch) | |
tree | f95a808773161eb27382e2be0ae9b7877871d7a8 /lib | |
parent | d04adf1b355181e737b6b1e23d801b07f0b7c4c0 (diff) |
net_sched: avoid matching qdisc with zero handle
Davide found the following script triggers a NULL pointer
dereference:
ip l a name eth0 type dummy
tc q a dev eth0 parent :1 handle 1: htb
This is because for a freshly created netdevice noop_qdisc
is attached and when passing 'parent :1', kernel actually
tries to match the major handle which is 0 and noop_qdisc
has handle 0 so is matched by mistake. Commit 69012ae425d7
tries to fix a similar bug but still misses this case.
Handle 0 is not a valid one, should be just skipped. In
fact, kernel uses it as TC_H_UNSPEC.
Fixes: 69012ae425d7 ("net: sched: fix handling of singleton qdiscs with qdisc_hash")
Fixes: 59cc1f61f09c ("net: sched:convert qdisc linked list to hashtable")
Reported-by: Davide Caratti <[email protected]>
Cc: Jiri Kosina <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jamal Hadi Salim <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions