From: deraadt Date: Mon, 27 Feb 2023 15:00:17 +0000 (+0000) Subject: use the correct size of the execve syscall stub X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c35fbcd4f94579b26a8c0ff915f6887813d96ea2;p=openbsd use the correct size of the execve syscall stub --- diff --git a/lib/libc/dlfcn/Makefile.inc b/lib/libc/dlfcn/Makefile.inc index 6605c7f113e..17df76ea678 100644 --- a/lib/libc/dlfcn/Makefile.inc +++ b/lib/libc/dlfcn/Makefile.inc @@ -1,7 +1,9 @@ -# $OpenBSD: Makefile.inc,v 1.5 2016/05/07 19:05:22 guenther Exp $ +# $OpenBSD: Makefile.inc,v 1.6 2023/02/27 15:00:17 deraadt Exp $ .PATH: ${LIBCSRCDIR}/dlfcn .include SRCS+= dlfcn_stubs.c init.c tib.c + +init.o init.po: _execvesize.c diff --git a/lib/libc/dlfcn/init.c b/lib/libc/dlfcn/init.c index db23b5605da..c6d4701f3c7 100644 --- a/lib/libc/dlfcn/init.c +++ b/lib/libc/dlfcn/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.17 2023/02/24 16:30:19 deraadt Exp $ */ +/* $OpenBSD: init.c,v 1.18 2023/02/27 15:00:17 deraadt Exp $ */ /* * Copyright (c) 2014,2015 Philip Guenther * @@ -150,9 +150,11 @@ _libc_preinit(int argc, char **argv, char **envp, dl_cb_cb *cb) setup_static_tib(phdr, phnum); #if !defined(__hppa__) - /* XXX 128 maximum size of a system call stub, hopefully */ - if (&HIDDEN(execve)) - pinsyscall(SYS_execve, &HIDDEN(execve), 128); + if (&HIDDEN(execve)) { + extern const int _execve_size; + + pinsyscall(SYS_execve, &HIDDEN(execve), _execve_size); + } #endif }