From 33a0a6d669629969fd9c4ccab931bae3d3353b1a74d9f2a24316d8d6087d547e Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Tue, 11 Mar 2014 05:41:47 +0000 Subject: [PATCH] Accepting request 225521 from home:garloff:branches:Base:System - dd_rescue-fix_insn_probe.diff: Brings dd_rescue to 1.42.1, fixing the process' signal mask after SIGILL delivery (probing), an issue related to the longjmp() signal handler return fix to bnc#860779. - Update to dd_rescue-1.42: * Addition of plugin interface * MD5 plugin * Use posix_fadvise() if available * Short usage message rather than full help on error - Update to dd_rescue-1.41: * Support for building against Andoid NDK * Consistent use of (improved) int no formatting functions * Fix off-by-one block dev size issue (cosmetic) * Enable AVX2 optimized sparse block detection * Refactored CPU feature detection and selection * New option -u/--rmvtrim to delete output file and issue fstrim - Remove suboptimal fix for bnc#860779, it's fixed properly upstream by returning with longjmp() from the signal handler. OBS-URL: https://build.opensuse.org/request/show/225521 OBS-URL: https://build.opensuse.org/package/show/Base:System/dd_rescue?expand=0&rev=21 --- dd_rescue-1.40.tar.gz | 3 --- dd_rescue-1.42.tar.gz | 3 +++ dd_rescue-fix_insn_probe.diff | 51 +++++++++++++++++++++++++++++++++++ dd_rescue.changes | 22 +++++++++++++++ dd_rescue.spec | 13 ++++----- 5 files changed, 83 insertions(+), 9 deletions(-) delete mode 100644 dd_rescue-1.40.tar.gz create mode 100644 dd_rescue-1.42.tar.gz create mode 100644 dd_rescue-fix_insn_probe.diff diff --git a/dd_rescue-1.40.tar.gz b/dd_rescue-1.40.tar.gz deleted file mode 100644 index f388161..0000000 --- a/dd_rescue-1.40.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:54545ebbe2be00597d8c9ba3d51abcfdd7ba89f17d51974629e612c2619730ff -size 47107 diff --git a/dd_rescue-1.42.tar.gz b/dd_rescue-1.42.tar.gz new file mode 100644 index 0000000..256768c --- /dev/null +++ b/dd_rescue-1.42.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:740fc84b167bea4cecae3b22e0e87f11ef0e563710c7cd8c5bb79b1eebfcbd2f +size 69695 diff --git a/dd_rescue-fix_insn_probe.diff b/dd_rescue-fix_insn_probe.diff new file mode 100644 index 0000000..ce3281d --- /dev/null +++ b/dd_rescue-fix_insn_probe.diff @@ -0,0 +1,51 @@ +From: Kurt Garloff +Subject: Need to restore sigprocmask when not returning from signal handler + +I stumbled over the fine details of signal handling: +A second SIGILL would not have been delivered to the handler as it was +blocked when invoking the handler for the first time. As we can't return +from the handler, we need to restore the process' signal mask ourselves +and reenable delivery. + +Signed-off-by: Kurt Garloff + +Index: find_nonzero.c +=================================================================== +RCS file: /home/cvsroot/dd_rescue/find_nonzero.c,v +retrieving revision 1.44 +retrieving revision 1.46 +diff -u -p -r1.44 -r1.46 +--- find_nonzero.c 21 Feb 2014 12:51:43 -0000 1.44 ++++ find_nonzero.c 6 Mar 2014 12:14:18 -0000 1.46 +@@ -24,6 +24,14 @@ static jmp_buf sigill_jmp; + static void ill_handler(int sig) + { + have_feature = 0; ++ /* As we can't return from handler (as it would result in ++ * reexecuting the illegal instruction again - we jump back ++ * using longjmp) -- we have to restore signal delivery, so the ++ * program context is back to normal. Otherwise a second ++ * probe_procedure would not handle SIGILL. */ ++ sigset_t sigmask; ++ sigemptyset(&sigmask); sigaddset(&sigmask, sig); ++ sigprocmask(SIG_UNBLOCK, &sigmask, NULL); + longjmp(sigill_jmp, 1); + } + +Index: archdep.h +=================================================================== +RCS file: /home/cvsroot/dd_rescue/archdep.h,v +retrieving revision 1.6 +retrieving revision 1.7 +diff -u -p -r1.6 -r1.7 +--- archdep.h 25 Feb 2014 16:06:35 -0000 1.6 ++++ archdep.h 6 Mar 2014 12:20:46 -0000 1.7 +@@ -28,7 +28,7 @@ void probe_sse2(); + #define have_avx2 0 + #define have_sse42 0 + #define ARCH_DETECT do {} while (0) +-#define ARCH_DECLS ++#define ARCH_DECLS ARCH_DECL_386 + #elif defined(NO_AVX2) /* compiler does not support -mavx2 */ + #define have_avx2 0 + extern char have_sse42; diff --git a/dd_rescue.changes b/dd_rescue.changes index c70ad6c..4a97988 100644 --- a/dd_rescue.changes +++ b/dd_rescue.changes @@ -1,3 +1,25 @@ +------------------------------------------------------------------- +Sat Mar 8 18:58:56 CET 2014 - kurt@garloff.de + +- dd_rescue-fix_insn_probe.diff: Brings dd_rescue to 1.42.1, + fixing the process' signal mask after SIGILL delivery (probing), + an issue related to the longjmp() signal handler return fix + to bnc#860779. +- Update to dd_rescue-1.42: + * Addition of plugin interface + * MD5 plugin + * Use posix_fadvise() if available + * Short usage message rather than full help on error +- Update to dd_rescue-1.41: + * Support for building against Andoid NDK + * Consistent use of (improved) int no formatting functions + * Fix off-by-one block dev size issue (cosmetic) + * Enable AVX2 optimized sparse block detection + * Refactored CPU feature detection and selection + * New option -u/--rmvtrim to delete output file and issue fstrim +- Remove suboptimal fix for bnc#860779, it's fixed properly + upstream by returning with longjmp() from the signal handler. + ------------------------------------------------------------------- Tue Feb 11 14:00:38 UTC 2014 - bwiedemann@suse.com diff --git a/dd_rescue.spec b/dd_rescue.spec index 0f95816..c93131f 100644 --- a/dd_rescue.spec +++ b/dd_rescue.spec @@ -17,16 +17,19 @@ Name: dd_rescue -Version: 1.40 +Version: 1.42 Release: 0 Summary: Data Copying in the Presence of I/O Errors License: GPL-2.0 or GPL-3.0 Group: System/Base Url: http://www.garloff.de/kurt/linux/ddrescue/ Source0: http://garloff.de/kurt/linux/ddrescue/%{name}-%{version}.tar.gz +Patch0: dd_rescue-fix_insn_probe.diff BuildRequires: autoconf BuildRequires: libattr-devel +%if 0%{?suse_version} >= 1200 BuildRequires: libfallocate-devel +%endif Requires: bc Recommends: dd_rhelp libfallocate0 # ddrescue was last used in openSUSE 11.4 (version 1.14_0.0.6) @@ -46,6 +49,7 @@ with fallocate(); random number writing etc. %prep %setup -q -n dd_rescue +%patch0 -p0 # Remove build time references so build-compare can do its work FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M') @@ -55,14 +59,10 @@ sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/g" dd_rescue.c %build flags="%{optflags}" -%ifarch i386 i486 i586 i686 -sed -i 's/SSE = "-msse2"/SSE = "-DNO_SSE2"/' Makefile -flags="%{optflags} -DNO_SSE2" -%endif make RPM_OPT_FLAGS="$flags" LIBDIR=%{_libdir} %{?_smp_mflags} %install -make install DESTDIR=%{buildroot} INSTALLDIR=%{buildroot}/%{_bindir} \ +make install DESTDIR=%{buildroot} INSTALLDIR=%{buildroot}/%{_bindir} LIBDIR=%{_libdir} \ INSTASROOT= INSTALLFLAGS= #UsrMerge @@ -80,6 +80,7 @@ make check #UsrMerge /bin/dd_rescue #EndUsrMerge +%{_libdir}/libddr_MD5.so %doc %{_mandir}/man1/dd_rescue.1%{ext_man} %changelog