diff options
author | Vlad Buslov <vladbu@mellanox.com> | 2019-02-15 16:18:44 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-02-17 22:26:57 +0100 |
commit | 8b58d12f4ae1a10037b824b1fb409cf424d6aaac (patch) | |
tree | bdb529b1eae848320e967f01eb082ec5cd4430f0 /net | |
parent | net: sched: matchall: verify that filter is not NULL in mall_walk() (diff) | |
download | linux-8b58d12f4ae1a10037b824b1fb409cf424d6aaac.tar.xz linux-8b58d12f4ae1a10037b824b1fb409cf424d6aaac.zip |
net: sched: cgroup: verify that filter is not NULL during walk
Check that filter is not NULL before passing it to tcf_walker->fn()
callback in cls_cgroup_walk(). This can happen when cls_cgroup_change()
failed to set first filter.
Fixes: ed76f5edccc9 ("net: sched: protect filter_chain list with filter_chain_lock mutex")
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/sched/cls_cgroup.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c index 1cef3b416094..02b05066b635 100644 --- a/net/sched/cls_cgroup.c +++ b/net/sched/cls_cgroup.c @@ -158,6 +158,8 @@ static void cls_cgroup_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; return; |