public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] s390: fix stack frame handling in _dl_runtime_profile.
@ 2008-11-03 12:45 Martin Schwidefsky
  2008-11-07 15:35 ` Jakub Jelinek
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Schwidefsky @ 2008-11-03 12:45 UTC (permalink / raw)
  To: Glibc hackers

Greetings,
a code inspection done by Curtis Taylor found a problem with the stack
pointer handling in _dl_runtime_profile. The stack frame is created with
a "aghi %r15,-160" which is fine but it is removed by a "lr %r15,%r12".
If the stack pointer in %r15 crossed a 4GB boundary with the aghi then
the stack will be off by 4GB after the lr. Not likely to happen but fatal
for the application if it does.

-- 
blue skies,
  Martin.

"Reality continues to ruin my life." - Calvin.
--

2008-11-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>

	* sysdeps/s390/s390-64/dl-trampoline.S: use the correct instruction
	to remove the stack frame in _dl_runtime_profile.

diff -urpN libc/sysdeps/s390/s390-64/dl-trampoline.S libc-s390/sysdeps/s390/s390-64/dl-trampoline.S
--- libc/sysdeps/s390/s390-64/dl-trampoline.S	2005-07-11 10:54:40.000000000 +0200
+++ libc-s390/sysdeps/s390/s390-64/dl-trampoline.S	2008-11-03 13:24:03.000000000 +0100
@@ -91,7 +91,7 @@ _dl_runtime_profile:
 	ld     %f4,120(%r12)
 	ld     %f6,128(%r12)
 	basr   %r14,%r1			# call resolved function
-0:	lr     %r15,%r12		# remove stack frame
+0:	lgr    %r15,%r12		# remove stack frame
 	cfi_def_cfa_register (15)
 	lg     %r14,32(%r15)		# restore registers
 	lg     %r12,24(%r15)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-11-07 15:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-03 12:45 [PATCH] s390: fix stack frame handling in _dl_runtime_profile Martin Schwidefsky
2008-11-07 15:35 ` Jakub Jelinek

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).