Commit caf2a3cb authored by Florian Westphal's avatar Florian Westphal Committed by Xie XiuQi
Browse files

netfilter: nf_tables: don't use position attribute on rule replacement



mainline inclusion
from mainline-4.20
commit 447750f2
category: bugfix
bugzilla: 6114
CVE: NA

-------------------------------------------------

Its possible to set both HANDLE and POSITION when replacing a rule.
In this case, the rule at POSITION gets replaced using the
userspace-provided handle.  Rule handles are supposed to be generated
by the kernel only.

Duplicate handles should be harmless, however better disable this "feature"
by only checking for the POSITION attribute on insert operations.

Fixes: 5e948466 ("netfilter: nf_tables: add insert operation")
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarKeefe LIU <liuqifa@huawei.com>
Reviewed-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent bcb1dc73
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment