Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/ethtool/, sys-apps/ethtool/files/
Date: Wed, 02 Sep 2020 21:50:51
Message-Id: 1599083442.fded9d90e36431672be55857d6cc2660f7ea9e34.whissi@gentoo
1 commit: fded9d90e36431672be55857d6cc2660f7ea9e34
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 2 21:49:15 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 2 21:50:42 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fded9d90
7
8 sys-apps/ethtool: fix crash in do_sset()
9
10 Closes: https://bugs.gentoo.org/740114
11 Package-Manager: Portage-3.0.4, Repoman-3.0.1
12 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
13
14 .../{ethtool-5.8.ebuild => ethtool-5.8-r1.ebuild} | 5 ++++-
15 ...tool-5.8-only-memset-non-NULL-link-settings.patch | 20 ++++++++++++++++++++
16 2 files changed, 24 insertions(+), 1 deletion(-)
17
18 diff --git a/sys-apps/ethtool/ethtool-5.8.ebuild b/sys-apps/ethtool/ethtool-5.8-r1.ebuild
19 similarity index 82%
20 rename from sys-apps/ethtool/ethtool-5.8.ebuild
21 rename to sys-apps/ethtool/ethtool-5.8-r1.ebuild
22 index 7fcdd66a7b8..527c52f3158 100644
23 --- a/sys-apps/ethtool/ethtool-5.8.ebuild
24 +++ b/sys-apps/ethtool/ethtool-5.8-r1.ebuild
25 @@ -15,7 +15,10 @@ IUSE="+netlink"
26 DEPEND="app-arch/xz-utils"
27 RDEPEND="netlink? ( net-libs/libmnl )"
28
29 -PATCHES=( "${FILESDIR}/${PN}-5.8-avoid_bashisms.patch" )
30 +PATCHES=(
31 + "${FILESDIR}/${PN}-5.8-avoid_bashisms.patch"
32 + "${FILESDIR}/${P}-only-memset-non-NULL-link-settings.patch"
33 +)
34
35 src_configure() {
36 econf $(use_enable netlink)
37
38 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
39 new file mode 100644
40 index 00000000000..573ee645615
41 --- /dev/null
42 +++ b/sys-apps/ethtool/files/ethtool-5.8-only-memset-non-NULL-link-settings.patch
43 @@ -0,0 +1,20 @@
44 +https://bugs.gentoo.org/740114
45 +https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=cf12872ebe7d8fac2088e7d2cd5e2a0a5f03499d
46 +
47 +--- a/ethtool.c
48 ++++ b/ethtool.c
49 +@@ -3048,10 +3048,11 @@ static int do_sset(struct cmd_context *ctx)
50 + struct ethtool_link_usettings *link_usettings;
51 +
52 + link_usettings = do_ioctl_glinksettings(ctx);
53 +- memset(&link_usettings->deprecated, 0,
54 +- sizeof(link_usettings->deprecated));
55 + if (link_usettings == NULL)
56 + link_usettings = do_ioctl_gset(ctx);
57 ++ else
58 ++ memset(&link_usettings->deprecated, 0,
59 ++ sizeof(link_usettings->deprecated));
60 + if (link_usettings == NULL) {
61 + perror("Cannot get current device settings");
62 + err = -1;
63 +