Skip to content

Commit

Permalink
amt: drop unexpected multicast data
Browse files Browse the repository at this point in the history
[ Upstream commit e882827 ]

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: cbc21dc ("amt: add data plane of amt interface")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
TaeheeYoo authored and gregkh committed Jul 29, 2022
1 parent 0411de0 commit 60413c9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/amt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 60413c9

Please sign in to comment.