From: Jakub Kicinski <kuba@kernel.org>
To: Sameeh Jubran <sameehj@amazon.com>
Cc: <davem@davemloft.net>, <netdev@vger.kernel.org>,
Arthur Kiyanovski <akiyano@amazon.com>, <dwmw@amazon.com>,
<zorik@amazon.com>, <matua@amazon.com>, <saeedb@amazon.com>,
<msw@amazon.com>, <aliguori@amazon.com>, <nafea@amazon.com>,
<gtzalik@amazon.com>, <netanel@amazon.com>, <alisaidi@amazon.com>,
<benh@amazon.com>, <ndagan@amazon.com>
Subject: Re: [PATCH V1 net 04/11] net: ena: fix incorrect default RSS key
Date: Wed, 29 Jan 2020 08:03:11 -0800 [thread overview]
Message-ID: <20200129080311.0bc5af60@cakuba> (raw)
In-Reply-To: <20200129140422.20166-5-sameehj@amazon.com>
On Wed, 29 Jan 2020 14:04:15 +0000, Sameeh Jubran wrote:
> From: Arthur Kiyanovski <akiyano@amazon.com>
>
> Bug description:
> When running "ethtool -x <if_name>" the key shows up as all zeros.
>
> When we use "ethtool -X <if_name> hfunc toeplitz hkey <some:random:key>" to
> set the key and then try to retrieve it using "ethtool -x <if_name>" then
> we return the correct key because we return the one we saved.
>
> Bug cause:
> We don't fetch the key from the device but instead return the key
> that we have saved internally which is by default set to zero upon
> allocation.
>
> Fix:
> This commit fixes the issue by initializing the key to the default key that
> is used by the device.
>
> 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>
So is the device actually using that key by default?
Hard coding a default RSS key makes it trivial for DDoS attackers
to target specific queues, doesn't it?
Please follow the best practice of initializing your key with
netdev_rss_key_fill() and configuring the device with it at startup.
> diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c
> index e54c44fdc..769339043 100644
> --- a/drivers/net/ethernet/amazon/ena/ena_com.c
> +++ b/drivers/net/ethernet/amazon/ena/ena_com.c
> @@ -64,6 +64,15 @@
>
> #define ENA_POLL_MS 5
>
> +/* Default Microsoft RSS key, used for HRSS. */
> +static const u8 rss_hash_key[ENA_HASH_KEY_SIZE] = {
> + 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2,
> + 0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0,
> + 0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4,
> + 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c,
> + 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa
You also have an extra tab here for no reason.
> +};
> +
> /*****************************************************************************/
> /*****************************************************************************/
> /*****************************************************************************/
next prev parent reply other threads:[~2020-01-29 16:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-29 14:04 [PATCH V1 net 00/11] Bug fixes for ENA Ethernet driver Sameeh Jubran
2020-01-29 14:04 ` [PATCH V1 net 01/11] net: ena: fix potential crash when rxfh key is NULL Sameeh Jubran
2020-01-29 14:04 ` [PATCH V1 net 02/11] net: ena: fix uses of round_jiffies() Sameeh Jubran
2020-01-29 14:04 ` [PATCH V1 net 03/11] net: ena: add missing ethtool TX timestamping indication Sameeh Jubran
2020-01-29 14:04 ` [PATCH V1 net 04/11] net: ena: fix incorrect default RSS key Sameeh Jubran
2020-01-29 16:03 ` Jakub Kicinski [this message]
2020-02-03 13:59 ` Jubran, Samih
2020-01-29 14:04 ` [PATCH V1 net 05/11] net: ena: rss: store hash function as values and not bits Sameeh Jubran
2020-01-29 14:04 ` [PATCH V1 net 06/11] net: ena: rss: fix failure to get indirection table Sameeh Jubran
2020-01-29 14:04 ` [PATCH V1 net 07/11] net: ena: fix incorrectly saving queue numbers when setting RSS " Sameeh Jubran
2020-01-29 16:07 ` Jakub Kicinski
2020-01-29 14:04 ` [PATCH V1 net 08/11] net: ena: fix corruption of dev_idx_to_host_tbl Sameeh Jubran
2020-01-29 14:04 ` [PATCH V1 net 09/11] net: ena: make ena rxfh support ETH_RSS_HASH_NO_CHANGE Sameeh Jubran
2020-01-29 14:04 ` [PATCH V1 net 10/11] net: ena: ethtool: use correct value for crc32 hash Sameeh Jubran
2020-01-29 14:04 ` [PATCH V1 net 11/11] net: ena: ena-com.c: prevent NULL pointer dereference Sameeh Jubran
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200129080311.0bc5af60@cakuba \
--to=kuba@kernel.org \
--cc=akiyano@amazon.com \
--cc=aliguori@amazon.com \
--cc=alisaidi@amazon.com \
--cc=benh@amazon.com \
--cc=davem@davemloft.net \
--cc=dwmw@amazon.com \
--cc=gtzalik@amazon.com \
--cc=matua@amazon.com \
--cc=msw@amazon.com \
--cc=nafea@amazon.com \
--cc=ndagan@amazon.com \
--cc=netanel@amazon.com \
--cc=netdev@vger.kernel.org \
--cc=saeedb@amazon.com \
--cc=sameehj@amazon.com \
--cc=zorik@amazon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).