From d4fa8c9010136fb6bcdb9a8338a398eaaa58be5ef594329168efe5d75bda02ef Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 9 Aug 2016 11:48:33 +0000 Subject: [PATCH] - startcontext-cantunwind.patch: mark __startcontext as .cantunwind (bsc#974800, BZ #20435) OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=445 --- _service | 2 +- glibc-testsuite.changes | 3 ++- glibc-testsuite.spec | 4 ++-- glibc-utils.changes | 3 ++- glibc-utils.spec | 4 ++-- glibc.changes | 3 ++- glibc.spec | 4 ++-- setcontext-unwind-info.patch | 35 ----------------------------- startcontext-cantunwind.patch | 42 +++++++++++++++++++++++++++++++++++ 9 files changed, 55 insertions(+), 45 deletions(-) delete mode 100644 setcontext-unwind-info.patch create mode 100644 startcontext-cantunwind.patch diff --git a/_service b/_service index 1aa053b..afda933 100644 --- a/_service +++ b/_service @@ -1,6 +1,6 @@ - 2.23.90.%cd.g%h + 2.24.90.%cd.g%h git://sourceware.org/git/glibc git diff --git a/glibc-testsuite.changes b/glibc-testsuite.changes index 7334d2d..25ae15d 100644 --- a/glibc-testsuite.changes +++ b/glibc-testsuite.changes @@ -28,7 +28,8 @@ Tue Aug 2 13:55:44 UTC 2016 - schwab@suse.de * The IPv6 name server management code in libresolv could result in a memory leak for each thread which is created, performs a failing naming lookup, and exits (CVE-2016-5417) -- setcontext-unwind-info.patch: Add EABI unwind info for setcontext on arm +- startcontext-cantunwind.patch: mark __startcontext as .cantunwind + (bsc#974800, BZ #20435) - Removed patches: * 0001-Updated-translations-for-2.23.patch * 0002-Regenerate-libc.pot-for-2.23.patch diff --git a/glibc-testsuite.spec b/glibc-testsuite.spec index 3104235..7eab6fa 100644 --- a/glibc-testsuite.spec +++ b/glibc-testsuite.spec @@ -267,8 +267,8 @@ Patch2005: nss-files-long-lines-2.patch Patch2006: iconv-reset-input-buffer.patch # PATCH-FIX-UPSTREAM Reinitialize dl_load_write_lock on fork (BZ #19282) Patch2008: reinitialize-dl_load_write_lock.patch -# PATCH-FIX-UPSTREAM Add EABI unwind info to setcontext for arm -Patch2009: setcontext-unwind-info.patch +# PATCH-FIX-UPSTREAM ARM: mark __startcontext as .cantunwind (BZ #20435) +Patch2009: startcontext-cantunwind.patch # Non-glibc patches # PATCH-FIX-OPENSUSE Remove debianisms from manpages diff --git a/glibc-utils.changes b/glibc-utils.changes index 7334d2d..25ae15d 100644 --- a/glibc-utils.changes +++ b/glibc-utils.changes @@ -28,7 +28,8 @@ Tue Aug 2 13:55:44 UTC 2016 - schwab@suse.de * The IPv6 name server management code in libresolv could result in a memory leak for each thread which is created, performs a failing naming lookup, and exits (CVE-2016-5417) -- setcontext-unwind-info.patch: Add EABI unwind info for setcontext on arm +- startcontext-cantunwind.patch: mark __startcontext as .cantunwind + (bsc#974800, BZ #20435) - Removed patches: * 0001-Updated-translations-for-2.23.patch * 0002-Regenerate-libc.pot-for-2.23.patch diff --git a/glibc-utils.spec b/glibc-utils.spec index e1c9703..3577b3b 100644 --- a/glibc-utils.spec +++ b/glibc-utils.spec @@ -266,8 +266,8 @@ Patch2005: nss-files-long-lines-2.patch Patch2006: iconv-reset-input-buffer.patch # PATCH-FIX-UPSTREAM Reinitialize dl_load_write_lock on fork (BZ #19282) Patch2008: reinitialize-dl_load_write_lock.patch -# PATCH-FIX-UPSTREAM Add EABI unwind info to setcontext for arm -Patch2009: setcontext-unwind-info.patch +# PATCH-FIX-UPSTREAM ARM: mark __startcontext as .cantunwind (BZ #20435) +Patch2009: startcontext-cantunwind.patch # Non-glibc patches # PATCH-FIX-OPENSUSE Remove debianisms from manpages diff --git a/glibc.changes b/glibc.changes index 7334d2d..25ae15d 100644 --- a/glibc.changes +++ b/glibc.changes @@ -28,7 +28,8 @@ Tue Aug 2 13:55:44 UTC 2016 - schwab@suse.de * The IPv6 name server management code in libresolv could result in a memory leak for each thread which is created, performs a failing naming lookup, and exits (CVE-2016-5417) -- setcontext-unwind-info.patch: Add EABI unwind info for setcontext on arm +- startcontext-cantunwind.patch: mark __startcontext as .cantunwind + (bsc#974800, BZ #20435) - Removed patches: * 0001-Updated-translations-for-2.23.patch * 0002-Regenerate-libc.pot-for-2.23.patch diff --git a/glibc.spec b/glibc.spec index 0e48224..ccc1836 100644 --- a/glibc.spec +++ b/glibc.spec @@ -267,8 +267,8 @@ Patch2005: nss-files-long-lines-2.patch Patch2006: iconv-reset-input-buffer.patch # PATCH-FIX-UPSTREAM Reinitialize dl_load_write_lock on fork (BZ #19282) Patch2008: reinitialize-dl_load_write_lock.patch -# PATCH-FIX-UPSTREAM Add EABI unwind info to setcontext for arm -Patch2009: setcontext-unwind-info.patch +# PATCH-FIX-UPSTREAM ARM: mark __startcontext as .cantunwind (BZ #20435) +Patch2009: startcontext-cantunwind.patch # Non-glibc patches # PATCH-FIX-OPENSUSE Remove debianisms from manpages diff --git a/setcontext-unwind-info.patch b/setcontext-unwind-info.patch deleted file mode 100644 index abbf13e..0000000 --- a/setcontext-unwind-info.patch +++ /dev/null @@ -1,35 +0,0 @@ -From f4704b4ed4485f092fef19694a15fa5fa891b8ed Mon Sep 17 00:00:00 2001 -From: Andreas Schwab -Date: Mon, 8 Aug 2016 09:29:18 +0200 -Subject: [PATCH] Add EABI unwind info to setcontext for arm - - [BZ #20435] - * sysdeps/unix/sysv/linux/arm/setcontext.S (__setcontext): Mark as - .cantunwind. ---- - sysdeps/unix/sysv/linux/arm/setcontext.S | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/sysdeps/unix/sysv/linux/arm/setcontext.S b/sysdeps/unix/sysv/linux/arm/setcontext.S -index 603e508..233d0ef 100644 ---- a/sysdeps/unix/sysv/linux/arm/setcontext.S -+++ b/sysdeps/unix/sysv/linux/arm/setcontext.S -@@ -74,12 +74,15 @@ ENTRY(__setcontext) - mov r2, #0 - bl PLTJMP(__sigprocmask) - -+ .fnstart - /* Loading r0-r3 makes makecontext easier. */ - add r14, r4, #MCONTEXT_ARM_R0 - ldmia r14, {r0-r12} - ldr r13, [r14, #(MCONTEXT_ARM_SP - MCONTEXT_ARM_R0)] - add r14, r14, #(MCONTEXT_ARM_LR - MCONTEXT_ARM_R0) - ldmia r14, {r14, pc} -+ .cantunwind -+ .fnend - - END(setcontext) - weak_alias(__setcontext, setcontext) --- -2.9.2 - diff --git a/startcontext-cantunwind.patch b/startcontext-cantunwind.patch new file mode 100644 index 0000000..4d36591 --- /dev/null +++ b/startcontext-cantunwind.patch @@ -0,0 +1,42 @@ +From 1061d6fe364ddac7458a872839ea9efe8f7600f0 Mon Sep 17 00:00:00 2001 +From: Andreas Schwab +Date: Mon, 8 Aug 2016 09:29:18 +0200 +Subject: [PATCH] arm: mark __startcontext as .cantunwind + +__startcontext marks the bottom of the call stack of the contexts created +by makecontext. + + [BZ #20435] + * sysdeps/unix/sysv/linux/arm/setcontext.S (__startcontext): Mark + as .cantunwind. +--- + sysdeps/unix/sysv/linux/arm/setcontext.S | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/sysdeps/unix/sysv/linux/arm/setcontext.S b/sysdeps/unix/sysv/linux/arm/setcontext.S +index 603e508..d1f168f 100644 +--- a/sysdeps/unix/sysv/linux/arm/setcontext.S ++++ b/sysdeps/unix/sysv/linux/arm/setcontext.S +@@ -86,12 +86,19 @@ weak_alias(__setcontext, setcontext) + + /* Called when a makecontext() context returns. Start the + context in R4 or fall through to exit(). */ ++ /* Unwind descriptors are looked up based on PC - 2, so we have to ++ make sure to mark the instruction preceding the __startcontext ++ label as .cantunwind. */ ++ .fnstart ++ .cantunwind ++ nop + ENTRY(__startcontext) + movs r0, r4 + bne PLTJMP(__setcontext) + + @ New context was 0 - exit + b PLTJMP(HIDDEN_JUMPTARGET(exit)) ++ .fnend + END(__startcontext) + + #ifdef PIC +-- +2.9.2 +