]> git.baikalelectronics.ru Git - kernel.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)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Feb 2020 01:08:30 +0000 (17:08 -0800)
commit0cb1767a0dabd8e9da51b3fe1116721691b052f5
treea6b6914faa023a6c9f2d3813d3a3ae13878f3db8
parent4adbe6bbb12adca61593fb201e39a8a46d46eb1a
net: ena: fix potential crash when rxfh key is NULL

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: e59074db59c6 ("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>
drivers/net/ethernet/amazon/ena/ena_com.c