]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: ena: fix potential crash when rxfh key is NULL
authorArthur Kiyanovski <akiyano@amazon.com>
Tue, 11 Feb 2020 15:17:40 +0000 (15:17 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Mar 2020 15:45:08 +0000 (16:45 +0100)
commit93e37c070e02c6253a3da0e2ded666158797458e
treed83d16ef364e14743309fafffd27ece668f33248
parentc045a6efe264dd084398dbc380e49a6308a955e4
net: ena: fix potential crash when rxfh key is NULL

[ Upstream commit 91a65b7d3ed8450f31ab717a65dcb5f9ceb5ab02 ]

When ethtool -X is called without an hkey, ena_com_fill_hash_function()
is called with key=NULL, which is passed to memcpy causing a crash.

This commit fixes this issue by checking key is not NULL.

Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Sameeh Jubran <sameehj@amazon.com>
Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/amazon/ena/ena_com.c