diff options
author | Julian Wiedmann <jwi@linux.ibm.com> | 2020-02-27 18:08:11 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-02-27 20:15:12 +0100 |
commit | 13bf829581c7d7dadb5b531caa4de681ab03cbc1 (patch) | |
tree | b50a7d9edec93539d9d127656d72c4cbf5ceb6dd /drivers/s390/net | |
parent | s390/qeth: clean up CREATE_ADDR cmd code (diff) | |
download | linux-13bf829581c7d7dadb5b531caa4de681ab03cbc1.tar.xz linux-13bf829581c7d7dadb5b531caa4de681ab03cbc1.zip |
s390/qeth: validate device-provided MAC address
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>
Diffstat (limited to 'drivers/s390/net')
-rw-r--r-- | drivers/s390/net/qeth_l3_main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index 667a10d6495d..1000e18c1090 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c @@ -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); |