]> git.baikalelectronics.ru Git - kernel.git/commit
net_sched: refetch skb protocol for each filter
authorCong Wang <xiyou.wangcong@gmail.com>
Sat, 12 Jan 2019 02:55:42 +0000 (18:55 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Jan 2019 21:25:11 +0000 (13:25 -0800)
commit5814dd39638f33819e0d1549d503ff0200145091
tree7a4995e44d642b96327846447b71ac8081cb343a
parent709bbb02a8c5935b777b648e2e07dfb04d25fb30
net_sched: refetch skb protocol for each filter

Martin reported a set of filters don't work after changing
from reclassify to continue. Looking into the code, it
looks like skb protocol is not always fetched for each
iteration of the filters. But, as demonstrated by Martin,
TC actions could modify skb->protocol, for example act_vlan,
this means we have to refetch skb protocol in each iteration,
rather than using the one we fetch in the beginning of the loop.

This bug is _not_ introduced by commit 560970f262fd
("net: sched: consolidate tc_classify{,_compat}"), technically,
if act_vlan is the only action that modifies skb protocol, then
it is commit 5b0b6322069e ("sched: introduce vlan action") which
introduced this bug.

Reported-by: Martin Olsson <martin.olsson+netdev@sentorsecurity.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_api.c