From: David Miller <davem@davemloft.net>
To: alobakin@marvell.com
Cc: kuba@kernel.org, irusskikh@marvell.com,
michal.kalderon@marvell.com, aelior@marvell.com,
denis.bolotin@marvell.com, GR-everest-linux-l2@marvell.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 net] net: qed: fix buffer overflow on ethtool -d
Date: Tue, 07 Jul 2020 15:42:50 -0700 (PDT) [thread overview]
Message-ID: <20200707.154250.1379487839723091014.davem@davemloft.net> (raw)
In-Reply-To: <20200706092553.3512-1-alobakin@marvell.com>
From: Alexander Lobakin <alobakin@marvell.com>
Date: Mon, 6 Jul 2020 12:25:53 +0300
> When generating debug dump, driver firstly collects all data in binary
> form, and then performs per-feature formatting to human-readable if it
> is supported.
>
> For ethtool -d, this is roughly incorrect for two reasons. First of all,
> drivers should always provide only original raw dumps to Ethtool without
> any changes.
> The second, and more critical, is that Ethtool's output buffer size is
> strictly determined by ethtool_ops::get_regs_len(), and all data *must*
> fit in it. The current version of driver always returns the size of raw
> data, but the size of the formatted buffer exceeds it in most cases.
> This leads to out-of-bound writes and memory corruption.
>
> Address both issues by adding an option to return original, non-formatted
> debug data, and using it for Ethtool case.
>
> v2:
> - Expand commit message to make it more clear;
> - No functional changes.
>
> Fixes: c965db444629 ("qed: Add support for debug data collection")
> Signed-off-by: Alexander Lobakin <alobakin@marvell.com>
> Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Applied, thank you.
prev parent reply other threads:[~2020-07-07 22:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-06 9:25 Alexander Lobakin
2020-07-07 22:42 ` David Miller [this message]
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=20200707.154250.1379487839723091014.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=GR-everest-linux-l2@marvell.com \
--cc=aelior@marvell.com \
--cc=alobakin@marvell.com \
--cc=denis.bolotin@marvell.com \
--cc=irusskikh@marvell.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.kalderon@marvell.com \
--cc=netdev@vger.kernel.org \
/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
all inboxes | Powered by JetHome®