summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2024-04-01 12:00:16 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2024-04-01 12:00:16 +0000
commitd7a5192e397f435ed84f341f5c13de3337697701 (patch)
treedfec11eeacb61eceb8ca846becdfba370da126d1 /sys
parentf978ecb677dc0f6ca2d5e4645363dc2e6cb164c3 (diff)
Enforce the pinsyscall rules on non-static/ld.so/libc.so text segments
also. Previously this was handled by msyscall(2), but that was just removed and anton fond out a piece of enforcement was missed..
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/syscall_mi.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/sys/syscall_mi.h b/sys/sys/syscall_mi.h
index 8ed88774d8a..db457616830 100644
--- a/sys/sys/syscall_mi.h
+++ b/sys/sys/syscall_mi.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: syscall_mi.h,v 1.32 2024/03/29 06:47:05 deraadt Exp $ */
+/* $OpenBSD: syscall_mi.h,v 1.33 2024/04/01 12:00:15 deraadt Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@@ -84,6 +84,7 @@ pin_check(struct proc *p, register_t code)
if (code == SYS_sigreturn)
return (0);
error = EPERM;
+ goto die;
}
if (pin) {
if (code >= pin->pn_npins || pin->pn_pins[code] == 0)
@@ -94,9 +95,11 @@ pin_check(struct proc *p, register_t code)
; /* multiple locations, hopefully a boring operation */
else
error = ENOSYS;
- }
+ } else
+ error = ENOSYS;
if (error == 0)
return (0);
+die:
#ifdef KTRACE
if (KTRPOINT(p, KTR_PINSYSCALL))
ktrpinsyscall(p, error, code, addr);