summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2020-09-02 23:49:15 +0200
committerThomas Deutschmann <whissi@gentoo.org>2020-09-02 23:50:42 +0200
commitfded9d90e36431672be55857d6cc2660f7ea9e34 (patch)
tree3b0474288da7b3f56563604f0d8bb959bb091522 /sys-apps/ethtool
parentmedia-gfx/feh: 3.5 version bump (diff)
downloadgentoo-fded9d90e36431672be55857d6cc2660f7ea9e34.tar.gz
gentoo-fded9d90e36431672be55857d6cc2660f7ea9e34.tar.bz2
gentoo-fded9d90e36431672be55857d6cc2660f7ea9e34.zip
sys-apps/ethtool: fix crash in do_sset()
Closes: https://bugs.gentoo.org/740114 Package-Manager: Portage-3.0.4, Repoman-3.0.1 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'sys-apps/ethtool')
-rw-r--r--sys-apps/ethtool/ethtool-5.8-r1.ebuild (renamed from sys-apps/ethtool/ethtool-5.8.ebuild)5
-rw-r--r--sys-apps/ethtool/files/ethtool-5.8-only-memset-non-NULL-link-settings.patch20
2 files changed, 24 insertions, 1 deletions
diff --git a/sys-apps/ethtool/ethtool-5.8.ebuild b/sys-apps/ethtool/ethtool-5.8-r1.ebuild
index 7fcdd66a7b81..527c52f31588 100644
--- a/sys-apps/ethtool/ethtool-5.8.ebuild
+++ b/sys-apps/ethtool/ethtool-5.8-r1.ebuild
@@ -15,7 +15,10 @@ IUSE="+netlink"
DEPEND="app-arch/xz-utils"
RDEPEND="netlink? ( net-libs/libmnl )"
-PATCHES=( "${FILESDIR}/${PN}-5.8-avoid_bashisms.patch" )
+PATCHES=(
+ "${FILESDIR}/${PN}-5.8-avoid_bashisms.patch"
+ "${FILESDIR}/${P}-only-memset-non-NULL-link-settings.patch"
+)
src_configure() {
econf $(use_enable netlink)
diff --git a/sys-apps/ethtool/files/ethtool-5.8-only-memset-non-NULL-link-settings.patch b/sys-apps/ethtool/files/ethtool-5.8-only-memset-non-NULL-link-settings.patch
new file mode 100644
index 000000000000..573ee645615b
--- /dev/null
+++ b/sys-apps/ethtool/files/ethtool-5.8-only-memset-non-NULL-link-settings.patch
@@ -0,0 +1,20 @@
+https://bugs.gentoo.org/740114
+https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=cf12872ebe7d8fac2088e7d2cd5e2a0a5f03499d
+
+--- a/ethtool.c
++++ b/ethtool.c
+@@ -3048,10 +3048,11 @@ static int do_sset(struct cmd_context *ctx)
+ struct ethtool_link_usettings *link_usettings;
+
+ link_usettings = do_ioctl_glinksettings(ctx);
+- memset(&link_usettings->deprecated, 0,
+- sizeof(link_usettings->deprecated));
+ if (link_usettings == NULL)
+ link_usettings = do_ioctl_gset(ctx);
++ else
++ memset(&link_usettings->deprecated, 0,
++ sizeof(link_usettings->deprecated));
+ if (link_usettings == NULL) {
+ perror("Cannot get current device settings");
+ err = -1;
+