public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix ____longjmp_chk for s390/s390x
@ 2010-01-20 15:53 Andreas Schwab
  0 siblings, 0 replies; only message in thread
From: Andreas Schwab @ 2010-01-20 15:53 UTC (permalink / raw)
  To: libc-hacker

The logic was backwards, causing the test to fail.

Andreas.

2010-01-20  Andreas Schwab  <schwab@redhat.com>

	* sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c
	(CHECK_SP): Fix check for alternate stack.
	* sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c
	(CHECK_SP): Likewise.

diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c b/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c
index b28e587..f2c1518 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c
@@ -46,7 +46,7 @@
 	    {								\
 	      if ((oss.ss_flags & SS_ONSTACK) == 0			\
 		  || ((uintptr_t) (oss.ss_sp + oss.ss_size) - new_sp	\
-		      >= oss.ss_size))					\
+		      < oss.ss_size))					\
 		__fortify_fail ("longjmp causes uninitialized stack frame");\
 	    }								\
 	}								\
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c b/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c
index dcf58fb..261be25 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c
@@ -46,7 +46,7 @@
 	    {								\
 	      if ((oss.ss_flags & SS_ONSTACK) == 0			\
 		  || ((uintptr_t) (oss.ss_sp + oss.ss_size) - new_sp	\
-		      >= oss.ss_size))					\
+		      < oss.ss_size))					\
 		__fortify_fail ("longjmp causes uninitialized stack frame");\
 	    }								\
 	}								\

-- 
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
"And now for something completely different."

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-01-20 15:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-20 15:53 [PATCH] Fix ____longjmp_chk for s390/s390x Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).