From fded9d90e36431672be55857d6cc2660f7ea9e34 Mon Sep 17 00:00:00 2001 From: Thomas Deutschmann Date: Wed, 2 Sep 2020 23:49:15 +0200 Subject: 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 --- sys-apps/ethtool/ethtool-5.8-r1.ebuild | 25 ++++++++++++++++++++++ sys-apps/ethtool/ethtool-5.8.ebuild | 22 ------------------- ...ol-5.8-only-memset-non-NULL-link-settings.patch | 20 +++++++++++++++++ 3 files changed, 45 insertions(+), 22 deletions(-) create mode 100644 sys-apps/ethtool/ethtool-5.8-r1.ebuild delete mode 100644 sys-apps/ethtool/ethtool-5.8.ebuild create mode 100644 sys-apps/ethtool/files/ethtool-5.8-only-memset-non-NULL-link-settings.patch (limited to 'sys-apps/ethtool') diff --git a/sys-apps/ethtool/ethtool-5.8-r1.ebuild b/sys-apps/ethtool/ethtool-5.8-r1.ebuild new file mode 100644 index 000000000000..527c52f31588 --- /dev/null +++ b/sys-apps/ethtool/ethtool-5.8-r1.ebuild @@ -0,0 +1,25 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DESCRIPTION="Utility for examining and tuning ethernet-based network interfaces" +HOMEPAGE="https://www.kernel.org/pub/software/network/ethtool/" +SRC_URI="https://www.kernel.org/pub/software/network/ethtool/${P}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ~ppc ~ppc64 sparc x86" +IUSE="+netlink" + +DEPEND="app-arch/xz-utils" +RDEPEND="netlink? ( net-libs/libmnl )" + +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/ethtool-5.8.ebuild b/sys-apps/ethtool/ethtool-5.8.ebuild deleted file mode 100644 index 7fcdd66a7b81..000000000000 --- a/sys-apps/ethtool/ethtool-5.8.ebuild +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -DESCRIPTION="Utility for examining and tuning ethernet-based network interfaces" -HOMEPAGE="https://www.kernel.org/pub/software/network/ethtool/" -SRC_URI="https://www.kernel.org/pub/software/network/ethtool/${P}.tar.xz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ~ppc ~ppc64 sparc x86" -IUSE="+netlink" - -DEPEND="app-arch/xz-utils" -RDEPEND="netlink? ( net-libs/libmnl )" - -PATCHES=( "${FILESDIR}/${PN}-5.8-avoid_bashisms.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; + -- cgit v1.2.3-65-gdbad