Skip to content

Commit

Permalink
s390/qeth: validate device-provided MAC address
Browse files Browse the repository at this point in the history
It's good practice to not blindly trust what the HW offers.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Julian Wiedmann authored and David S. Miller committed Feb 27, 2020
1 parent 9c6dc7a commit 13bf829
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/s390/net/qeth_l3_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,8 @@ static int qeth_l3_iqd_read_initial_mac_cb(struct qeth_card *card,

if (cmd->hdr.return_code)
return -EIO;
if (!is_valid_ether_addr(cmd->data.create_destroy_addr.mac_addr))
return -EADDRNOTAVAIL;

ether_addr_copy(card->dev->dev_addr,
cmd->data.create_destroy_addr.mac_addr);
Expand Down

0 comments on commit 13bf829

Please sign in to comment.