]> git.baikalelectronics.ru Git - kernel.git/commit
net/sched: cls_flower: fix only mask bit check in the validate_ct_state
authorwenxu <wenxu@ucloud.cn>
Wed, 17 Mar 2021 04:02:43 +0000 (12:02 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 Mar 2021 18:56:25 +0000 (11:56 -0700)
commit5c80c6f33f763fd5b785a3917efc76541a7efff8
treebf491e264711d7d3ff00d72e36237d1e8ab0e792
parent75e09d4d7163078b5f555b32340ed0c9f769b3f3
net/sched: cls_flower: fix only mask bit check in the validate_ct_state

The ct_state validate should not only check the mask bit and also
check mask_bit & key_bit..
For the +new+est case example, The 'new' and 'est' bits should be
set in both state_mask and state flags. Or the -new-est case also
will be reject by kernel.
When Openvswitch with two flows
ct_state=+trk+new,action=commit,forward
ct_state=+trk+est,action=forward

A packet go through the kernel  and the contrack state is invalid,
The ct_state will be +trk-inv. Upcall to the ovs-vswitchd, the
finally dp action will be drop with -new-est+trk.

Fixes: f544e47316a3 ("net/sched: cls_flower: Reject invalid ct_state flags rules")
Fixes: 62564537eb6c ("net/sched: cls_flower: validate ct_state for invalid and reply flags")
Signed-off-by: wenxu <wenxu@ucloud.cn>
Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_flower.c