diff options
author | 2019-02-15 17:17:56 +0200 | |
---|---|---|
committer | 2019-02-17 13:26:39 -0800 | |
commit | d66022cd1623edfd7b43e13c9e973403a811af02 (patch) | |
tree | 15065b291045abc24f07c5f72086c417b6fcebe0 /net/sched/cls_matchall.c | |
parent | net: sched: route: don't set arg->stop in route4_walk() when empty (diff) | |
download | linux-d66022cd1623edfd7b43e13c9e973403a811af02.tar.gz linux-d66022cd1623edfd7b43e13c9e973403a811af02.tar.bz2 linux-d66022cd1623edfd7b43e13c9e973403a811af02.zip |
net: sched: matchall: verify that filter is not NULL in mall_walk()
Check that filter is not NULL before passing it to tcf_walker->fn()
callback. This can happen when mall_change() failed to offload filter to
hardware.
Fixes: ed76f5edccc9 ("net: sched: protect filter_chain list with filter_chain_lock mutex")
Reported-by: Ido Schimmel <idosch@mellanox.com>
Tested-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_matchall.c')
-rw-r--r-- | net/sched/cls_matchall.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c index a37137430e61..1f9d481b0fbb 100644 --- a/net/sched/cls_matchall.c +++ b/net/sched/cls_matchall.c @@ -247,6 +247,9 @@ static void mall_walk(struct tcf_proto *tp, struct tcf_walker *arg, if (arg->count < arg->skip) goto skip; + + if (!head) + return; if (arg->fn(tp, head, arg) < 0) arg->stop = 1; skip: |