summaryrefslogtreecommitdiffstats
path: root/drivers/s390/net
diff options
context:
space:
mode:
authorJulian Wiedmann <jwi@linux.ibm.com>2020-02-27 18:08:11 +0100
committerDavid S. Miller <davem@davemloft.net>2020-02-27 20:15:12 +0100
commit13bf829581c7d7dadb5b531caa4de681ab03cbc1 (patch)
treeb50a7d9edec93539d9d127656d72c4cbf5ceb6dd /drivers/s390/net
parents390/qeth: clean up CREATE_ADDR cmd code (diff)
downloadlinux-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.c2
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);