summaryrefslogtreecommitdiff
path: root/lib/csu/mips64/md_init.h
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2020-10-15 16:30:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2020-10-15 16:30:24 +0000
commitd402f1d56e6d2ea8abaaa77b10a6906a2302ec05 (patch)
tree15c27ec4387a19543ea80e0fab7ee704cff884ac /lib/csu/mips64/md_init.h
parentffcf7a30721e2587f44570e470827189426c8999 (diff)
crt0 MD _dl_exit() performs syscall to SYS_exit directly, but then
some of these functions were returning. That makes the +1word address a fairly strong and easily located gadget. Put a hard-trap instruction after the syscall. This remains a gadget for 'terminal system' calls (such as execve), but hey that's why we have pledge w/o "exec" throughout the tree. Quite surprisingly, hppa's delay-slot load of SYS_exit makes it the safest of the bunch, not that this helps anyone. ok kettenis
Diffstat (limited to 'lib/csu/mips64/md_init.h')
-rw-r--r--lib/csu/mips64/md_init.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/csu/mips64/md_init.h b/lib/csu/mips64/md_init.h
index 7328965c8ea..c5ed64c295f 100644
--- a/lib/csu/mips64/md_init.h
+++ b/lib/csu/mips64/md_init.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.18 2020/10/14 22:11:19 deraadt Exp $ */
+/* $OpenBSD: md_init.h,v 1.19 2020/10/15 16:30:23 deraadt Exp $ */
/*-
* Copyright (c) 2001 Ross Harvey
@@ -146,7 +146,7 @@
"_dl_exit: \n" \
" li $v0, " STR(SYS_exit) " \n" \
" syscall \n" \
- " j $ra \n" \
+ " break 0 \n" \
" .end _dl_exit \n" \
" .previous")