summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2004-10-27 17:11:43 +0000
committerpeter <peter@FreeBSD.org>2004-10-27 17:11:43 +0000
commitacf0f61a8ab08cf2bd140f446c5164007bf4a458 (patch)
tree6fb1d56f47888c2637ef2b7356a76cfcdb2aebfe
parenta60695c9202d95223d9c91eb761d88805597bd67 (diff)
downloadFreeBSD-src-acf0f61a8ab08cf2bd140f446c5164007bf4a458.zip
FreeBSD-src-acf0f61a8ab08cf2bd140f446c5164007bf4a458.tar.gz
Fix brk(3). The stack was unbalanced when we jumped to cerror. Oops!
This causes nasty things like SEGV or a cpu spin when we return. Submitted by: "James R. Van Artsalen" <james@jrv.org>
-rw-r--r--lib/libc/amd64/sys/brk.S1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libc/amd64/sys/brk.S b/lib/libc/amd64/sys/brk.S
index 7d755e6..ee04cac 100644
--- a/lib/libc/amd64/sys/brk.S
+++ b/lib/libc/amd64/sys/brk.S
@@ -78,6 +78,7 @@ ok:
popq %rdi
ret
err:
+ addq $8, %rsp
#ifdef PIC
movq PIC_GOT(HIDENAME(cerror)),%rdx
jmp *%rdx
OpenPOWER on IntegriCloud