summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorRomain Bellan <romain.bellan@wifirst.fr>2020-03-27 09:26:32 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2020-03-30 02:05:36 +0200
commit7c6b4121627aeaa79536fbb900feafec740410d3 (patch)
treeaf6bce3af0c1176b5a4e780717708b20e1913d0c /net
parentnetfilter: nf_queue: prefer nf_queue_entry_free (diff)
downloadlinux-7c6b4121627aeaa79536fbb900feafec740410d3.tar.xz
linux-7c6b4121627aeaa79536fbb900feafec740410d3.zip
netfilter: ctnetlink: be more strict when NF_CONNTRACK_MARK is not set
When CONFIG_NF_CONNTRACK_MARK is not set, any CTA_MARK or CTA_MARK_MASK in netlink message are not supported. We should return an error when one of them is set, not both Fixes: 9306425b70bf ("netfilter: ctnetlink: must check mark attributes vs NULL") Signed-off-by: Romain Bellan <romain.bellan@wifirst.fr> Signed-off-by: Florent Fourcot <florent.fourcot@wifirst.fr> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/nf_conntrack_netlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index eb190206cd12..9ddfcd002d3b 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -860,7 +860,7 @@ ctnetlink_alloc_filter(const struct nlattr * const cda[], u8 family)
struct ctnetlink_filter *filter;
#ifndef CONFIG_NF_CONNTRACK_MARK
- if (cda[CTA_MARK] && cda[CTA_MARK_MASK])
+ if (cda[CTA_MARK] || cda[CTA_MARK_MASK])
return ERR_PTR(-EOPNOTSUPP);
#endif