All of lore.kernel.org
 help / color / mirror / Atom feed
From: Taehee Yoo <ap420073@gmail.com>
To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	edumazet@google.com, netdev@vger.kernel.org
Cc: ap420073@gmail.com
Subject: [PATCH net v2 7/8] amt: drop unexpected multicast data
Date: Sun, 17 Jul 2022 16:09:09 +0000	[thread overview]
Message-ID: <20220717160910.19156-8-ap420073@gmail.com> (raw)
In-Reply-To: <20220717160910.19156-1-ap420073@gmail.com>

AMT gateway interface should not receive unexpected multicast data.
Multicast data message type should be received after sending an update
message, which means all establishment between gateway and relay is
finished.
So, amt_multicast_data_handler() checks amt->status.

Fixes: cbc21dc1cfe9 ("amt: add data plane of amt interface")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
---

v2:
 - No changes.

 drivers/net/amt.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/amt.c b/drivers/net/amt.c
index 396cfee018a0..ecd2de22bdfc 100644
--- a/drivers/net/amt.c
+++ b/drivers/net/amt.c
@@ -2282,6 +2282,9 @@ static bool amt_multicast_data_handler(struct amt_dev *amt, struct sk_buff *skb)
 	struct ethhdr *eth;
 	struct iphdr *iph;
 
+	if (READ_ONCE(amt->status) != AMT_STATUS_SENT_UPDATE)
+		return true;
+
 	hdr_size = sizeof(*amtmd) + sizeof(struct udphdr);
 	if (!pskb_may_pull(skb, hdr_size))
 		return true;
-- 
2.17.1


  parent reply	other threads:[~2022-07-17 16:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-17 16:09 [PATCH net v2 0/8] amt: fix validation and synchronization bugs Taehee Yoo
2022-07-17 16:09 ` [PATCH net v2 1/8] amt: use workqueue for gateway side message handling Taehee Yoo
2022-07-17 16:09 ` [PATCH net v2 2/8] amt: remove unnecessary locks Taehee Yoo
2022-07-17 16:09 ` [PATCH net v2 3/8] amt: use READ_ONCE() in amt module Taehee Yoo
2022-07-17 16:09 ` [PATCH net v2 4/8] amt: add missing regeneration nonce logic in request logic Taehee Yoo
2022-07-17 16:09 ` [PATCH net v2 5/8] amt: drop unexpected advertisement message Taehee Yoo
2022-07-17 16:09 ` [PATCH net v2 6/8] amt: drop unexpected query message Taehee Yoo
2022-07-17 16:09 ` Taehee Yoo [this message]
2022-07-17 16:09 ` [PATCH net v2 8/8] amt: do not use amt->nr_tunnels outside of lock Taehee Yoo
2022-07-19 10:50 ` [PATCH net v2 0/8] amt: fix validation and synchronization bugs patchwork-bot+netdevbpf

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=20220717160910.19156-8-ap420073@gmail.com \
    --to=ap420073@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.