aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorAlexander Lobakin <alobakin@marvell.com>2020-07-06 12:25:53 +0300
committerDavid S. Miller <davem@davemloft.net>2020-07-07 15:42:31 -0700
commitda3287111ab43b32cec54d7ca6b48640f210a196 (patch)
tree27368cf8995d0715b9dac937b85247412168c6dd /include/linux
parentbridge: mcast: Fix MLD2 Report IPv6 payload length check (diff)
downloadlinux-dev-da3287111ab43b32cec54d7ca6b48640f210a196.tar.xz
linux-dev-da3287111ab43b32cec54d7ca6b48640f210a196.zip
net: qed: fix buffer overflow on ethtool -d
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions