sync with OpenBSD -current

This commit is contained in:
purplerain 2023-12-14 01:14:09 +00:00
parent 24ffeadca5
commit 8801582927
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
30 changed files with 1221 additions and 280 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: syscall.c,v 1.27 2023/12/12 15:30:55 deraadt Exp $ */
/* $OpenBSD: syscall.c,v 1.28 2023/12/13 15:57:22 miod Exp $ */
/* $NetBSD: syscall.c,v 1.24 2003/11/14 19:03:17 scw Exp $ */
/*-
@ -114,7 +114,7 @@ swi_handler(trapframe_t *frame)
code = frame->tf_r12;
// XXX out of range stays on syscall0, which we assume is enosys
if (code >= 0 || code <= SYS_MAXSYSCALL)
if (code > 0 && code < SYS_MAXSYSCALL)
callp += code;
nargs = callp->sy_argsize / sizeof(register_t);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: syscall.c,v 1.15 2023/12/12 15:30:55 deraadt Exp $ */
/* $OpenBSD: syscall.c,v 1.17 2023/12/13 15:57:22 miod Exp $ */
/*
* Copyright (c) 2015 Dale Rahn <drahn@dalerahn.com>
*
@ -33,7 +33,7 @@ svc_handler(trapframe_t *frame)
{
struct proc *p = curproc;
const struct sysent *callp;
int code, error = ENOSYS, indirect = -1;
int code, error = ENOSYS;
u_int nap = 8, nargs;
register_t *ap, *args, copyargs[MAXARGS], rval[2];
@ -50,7 +50,7 @@ svc_handler(trapframe_t *frame)
ap = &frame->tf_x[0];
if (code < 0 || code >= SYS_MAXSYSCALL)
if (code <= 0 || code >= SYS_MAXSYSCALL)
goto bad;
callp = sysent + code;

View file

@ -1,4 +1,4 @@
/* $OpenBSD: trap.c,v 1.163 2023/12/12 15:30:55 deraadt Exp $ */
/* $OpenBSD: trap.c,v 1.164 2023/12/13 15:57:22 miod Exp $ */
/* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */
/*-
@ -544,7 +544,7 @@ syscall(struct trapframe *frame)
code = frame->tf_eax;
// XXX out of range stays on syscall0, which we assume is enosys
if (code >= 0 || code <= SYS_MAXSYSCALL)
if (code > 0 && code < SYS_MAXSYSCALL)
callp += code;
argsize = callp->sy_argsize;