Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net, cls: also reject deleting all filters when TCA_KIND present

When we check for RTM_DELTFILTER, we should also reject the request
for deleting all filters under a given parent when TCA_KIND attribute
is present. If present, it's currently just ignored but there's also
no point to let it pass in the first place either since this doesn't
have any meaning with wild-card removal.

Fixes: ea7f8277f907 ("net, cls: allow for deleting all filters for given parent")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Daniel Borkmann and committed by
David S. Miller
9f6ed032 5b706e5c

+1 -1
+1 -1
net/sched/cls_api.c
··· 169 169 if (prio == 0) { 170 170 switch (n->nlmsg_type) { 171 171 case RTM_DELTFILTER: 172 - if (protocol || t->tcm_handle) 172 + if (protocol || t->tcm_handle || tca[TCA_KIND]) 173 173 return -ENOENT; 174 174 break; 175 175 case RTM_NEWTFILTER: