Skip to content

Commit

Permalink
amt: add missing regeneration nonce logic in request logic
Browse files Browse the repository at this point in the history
[ Upstream commit 627f169 ]

When AMT gateway starts sending a new request message, it should
regenerate the nonce variable.

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 3548132 commit 3ef0b18
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/amt.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,9 +963,13 @@ static void amt_event_send_request(struct amt_dev *amt)
amt->remote_ip = 0;
amt_update_gw_status(amt, AMT_STATUS_INIT, false);
amt->req_cnt = 0;
amt->nonce = 0;
goto out;
}

if (!amt->req_cnt)
get_random_bytes(&amt->nonce, sizeof(__be32));

amt_send_request(amt, false);
amt_send_request(amt, true);
amt_update_gw_status(amt, AMT_STATUS_SENT_REQUEST, true);
Expand Down

0 comments on commit 3ef0b18

Please sign in to comment.