netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org
Subject: [PATCH net 4/9] netfilter: ctnetlink: fix dump of the expect mask attribute
Date: Fri, 19 Mar 2021 02:06:03 +0100	[thread overview]
Message-ID: <20210319010608.9758-5-pablo@netfilter.org> (raw)
In-Reply-To: <20210319010608.9758-1-pablo@netfilter.org>

From: Florian Westphal <fw@strlen.de>

Before this change, the mask is never included in the netlink message, so
"conntrack -E expect" always prints 0.0.0.0.

In older kernels the l3num callback struct was passed as argument, based
on tuple->src.l3num. After the l3num indirection got removed, the call
chain is based on m.src.l3num, but this value is 0xffff.

Init l3num to the correct value.

Fixes: f957be9d349a3 ("netfilter: conntrack: remove ctnetlink callbacks from l3 protocol trackers")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/nf_conntrack_netlink.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index 1469365bac7e..1d519b0e51a5 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -2962,6 +2962,7 @@ static int ctnetlink_exp_dump_mask(struct sk_buff *skb,
 	memset(&m, 0xFF, sizeof(m));
 	memcpy(&m.src.u3, &mask->src.u3, sizeof(m.src.u3));
 	m.src.u.all = mask->src.u.all;
+	m.src.l3num = tuple->src.l3num;
 	m.dst.protonum = tuple->dst.protonum;
 
 	nest_parms = nla_nest_start(skb, CTA_EXPECT_MASK);
-- 
2.20.1


  parent reply	other threads:[~2021-03-19  1:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19  1:05 [PATCH net 0/9] Netfilter fixes for net Pablo Neira Ayuso
2021-03-19  1:06 ` [PATCH net 1/9] Revert "netfilter: x_tables: Update remaining dereference to RCU" Pablo Neira Ayuso
2021-03-19  1:06 ` [PATCH net 2/9] Revert "netfilter: x_tables: Switch synchronization " Pablo Neira Ayuso
2021-03-19  1:06 ` [PATCH net 3/9] netfilter: x_tables: Use correct memory barriers Pablo Neira Ayuso
2021-03-19  1:06 ` Pablo Neira Ayuso [this message]
2021-03-19  1:06 ` [PATCH net 5/9] netfilter: conntrack: Fix gre tunneling over ipv6 Pablo Neira Ayuso
2021-03-19  1:06 ` [PATCH net 6/9] netfilter: nftables: report EOPNOTSUPP on unsupported flowtable flags Pablo Neira Ayuso
2021-03-19  1:06 ` [PATCH net 7/9] netfilter: nftables: allow to update " Pablo Neira Ayuso
2021-03-19  1:06 ` [PATCH net 8/9] netfilter: flowtable: Make sure GC works periodically in idle system Pablo Neira Ayuso
2021-03-19  1:06 ` [PATCH net 9/9] netfilter: nftables: skip hook overlap logic if flowtable is stale Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210319010608.9758-5-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).