From 433852052dddb3a60d08e099055886c9ca2c283d6d7759f2d96698f0d608f163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 19 Sep 2018 10:25:55 +0000 Subject: [PATCH] Accepting request 636617 from home:WernerFink:branches:security - Add patch f2193587.patch from github pull request * Fix segfault on arm machines which do not eport the cache size or say it is -1 in sysfs - Refresh patches OBS-URL: https://build.opensuse.org/request/show/636617 OBS-URL: https://build.opensuse.org/package/show/security/haveged?expand=0&rev=123 --- f2193587.patch | 27 +++++++++++++++++++++++++++ haveged-conditional-enttest.patch | 10 +++++----- haveged-no-syslog.patch | 12 ++++++------ haveged.changes | 8 ++++++++ haveged.spec | 3 +++ ppc64le.patch | 8 ++++---- 6 files changed, 53 insertions(+), 15 deletions(-) create mode 100644 f2193587.patch diff --git a/f2193587.patch b/f2193587.patch new file mode 100644 index 0000000..5e1d736 --- /dev/null +++ b/f2193587.patch @@ -0,0 +1,27 @@ +From f2193587e8e51aa42b192c17ad39467931e2d4c2 Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Wed, 19 Sep 2018 09:51:43 +0200 +Subject: [PATCH] Fix segfault on arm machines + +Some ARM cpus does not report the cache size or say it is -1 in sysfs. +It has been observed on xgene and thunderx machines. + +Fall back to the generic cache size when that happens so we don't +segfault. + +Should fix https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866306 +--- + src/havegetune.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/src/havegetune.c ++++ b/src/havegetune.c 2018-09-19 09:25:27.016773887 +0000 +@@ -795,6 +795,8 @@ static int vfs_configInfoCache( + ctype = vfs_configFile(pAnchor, path, vfs_configType); + strcpy(path+plen, "size"); + size = vfs_configFile(pAnchor, path, vfs_configInt); ++ if (size == -1) ++ size = ctype == 'I' ? GENERIC_ICACHE : GENERIC_DCACHE; + cfg_cacheAdd(pAnchor, SRC_VFS_INDEX, pArgs[1], level, ctype, size); + } + } diff --git a/haveged-conditional-enttest.patch b/haveged-conditional-enttest.patch index 59c1df5..afaf7b6 100644 --- a/haveged-conditional-enttest.patch +++ b/haveged-conditional-enttest.patch @@ -1,10 +1,10 @@ --- - haveged-1.9.2/configure.ac | 7 ++++++- + haveged-1.9.4/configure.ac | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ---- haveged-1.9.2/configure.ac -+++ haveged-1.9.2/configure.ac 2018-06-26 08:06:45.195289211 +0000 -@@ -61,6 +61,11 @@ AC_ARG_ENABLE(nistest, +--- haveged-1.9.4/configure.ac ++++ haveged-1.9.4/configure.ac 2018-09-19 09:23:58.582379792 +0000 +@@ -62,6 +62,11 @@ AC_ARG_ENABLE(nistest, AS_HELP_STRING([--enable-nistest=[no/yes]],[Run NIST test suite [default=no]]), , enable_nistest="no") @@ -16,7 +16,7 @@ ## Make self test features configurable AC_ARG_ENABLE(olt, AS_HELP_STRING([--enable-olt=[yes/no]],[Enable online tests [default=yes]]), -@@ -228,7 +233,7 @@ AM_CONDITIONAL(ENABLE_SYSV, test "$init_ +@@ -241,7 +246,7 @@ AM_CONDITIONAL(ENABLE_SYSV, test "$init_ AM_CONDITIONAL(ENABLE_SYSTEMD, test "$init_type" = "systemd") AM_CONDITIONAL(ENABLE_SYSTEMD_LOOKUP, test "$enable_initdir" = "?") AM_CONDITIONAL(ENABLE_NOINIT, test "$init_type" = "none") diff --git a/haveged-no-syslog.patch b/haveged-no-syslog.patch index ab0fe50..2baa342 100644 --- a/haveged-no-syslog.patch +++ b/haveged-no-syslog.patch @@ -1,12 +1,12 @@ Index: haveged-1.9.1/src/haveged.c =================================================================== --- - haveged-1.9.2/src/haveged.c | 6 ++++++ + haveged-1.9.4/src/haveged.c | 6 ++++++ 1 file changed, 6 insertions(+) ---- haveged-1.9.2/src/haveged.c -+++ haveged-1.9.2/src/haveged.c 2018-06-26 08:07:51.430076528 +0000 -@@ -361,8 +361,10 @@ static void daemonize( /* RETURN: no +--- haveged-1.9.4/src/haveged.c ++++ haveged-1.9.4/src/haveged.c 2018-09-19 09:24:30.741795848 +0000 +@@ -478,8 +478,10 @@ static void daemonize( /* RETURN: no void) /* IN: nothing */ { FILE *fh; @@ -17,7 +17,7 @@ Index: haveged-1.9.1/src/haveged.c if (daemon(0, 0) == -1) error_exit("Cannot fork into the background"); fh = fopen(params->pid_file, "w"); -@@ -501,7 +503,9 @@ static void error_exit( /* RETURN: no +@@ -684,7 +686,9 @@ void error_exit( /* RETURN: no #ifndef NO_DAEMON if (params->detached!=0) { unlink(params->pid_file); @@ -27,7 +27,7 @@ Index: haveged-1.9.1/src/haveged.c } else #endif -@@ -611,11 +615,13 @@ static void print_msg( /* RETURN: no +@@ -794,11 +798,13 @@ static void print_msg( /* RETURN: no va_list ap; va_start(ap, format); snprintf(buffer, sizeof(buffer), "%s: %s", params->daemon, format); diff --git a/haveged.changes b/haveged.changes index f404ead..7f47e9f 100644 --- a/haveged.changes +++ b/haveged.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Sep 19 09:27:15 UTC 2018 - Dr. Werner Fink + +- Add patch f2193587.patch from github pull request + * Fix segfault on arm machines which do not eport the cache size + or say it is -1 in sysfs +- Refresh patches + ------------------------------------------------------------------- Tue Sep 11 15:29:33 UTC 2018 - Jan Engelhardt diff --git a/haveged.spec b/haveged.spec index 2c87ee2..d5f49da 100644 --- a/haveged.spec +++ b/haveged.spec @@ -34,6 +34,8 @@ Patch0: ppc64le.patch Patch1: haveged-conditional-enttest.patch # PATCH-FIX-UPSTREAM: don't write to syslog at startup to avoid deadlocks psimons@suse.com bnc#959237 Patch2: haveged-no-syslog.patch +# PATCH-FIX-GITHUN: Fix segfault on arm machines +Patch3: f2193587.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool @@ -82,6 +84,7 @@ algorithm and supporting features. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build autoreconf -fvi diff --git a/ppc64le.patch b/ppc64le.patch index 1e5cb46..d46287b 100644 --- a/ppc64le.patch +++ b/ppc64le.patch @@ -1,12 +1,12 @@ Index: haveged-1.9.1/configure.ac =================================================================== --- - haveged-1.9.2/configure.ac | 2 +- + haveged-1.9.4/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---- haveged-1.9.2/configure.ac -+++ haveged-1.9.2/configure.ac 2018-06-26 08:05:43.668415539 +0000 -@@ -157,7 +157,7 @@ case "$host" in +--- haveged-1.9.4/configure.ac ++++ haveged-1.9.4/configure.ac 2018-09-19 09:23:01.331419209 +0000 +@@ -170,7 +170,7 @@ case "$host" in AC_DEFINE(HAVE_ISA_IA64, 1, [Define to 1 for ia64]) ;;