From: Romain Bellan Date: Fri, 27 Mar 2020 08:26:32 +0000 (+0100) Subject: netfilter: ctnetlink: be more strict when NF_CONNTRACK_MARK is not set X-Git-Tag: v5.15~4200^2~12^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7c6b4121627aeaa79536fbb900feafec740410d3;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Florent Fourcot Signed-off-by: Pablo Neira Ayuso --- diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index eb19020..9ddfcd0 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