-/* $OpenBSD: exec_elf.c,v 1.176 2022/11/23 11:00:27 mbuhl Exp $ */
+/* $OpenBSD: exec_elf.c,v 1.177 2022/12/05 23:18:37 deraadt Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
/* verify name padding (after the NUL) is NUL */
for (j = namlen + 1; j < elfround(np->namesz); j++)
if (((char *)(np + 1))[j] != '\0')
- continue;
+ continue;
/* verify desc padding is NUL */
for (j = np->descsz; j < elfround(np->descsz); j++)
if (((char *)(np + 1))[j] != '\0')
- continue;
+ continue;
if (strcmp((char *)(np + 1), elf_note_names[i].name) == 0)
return elf_note_names[i].id;
}
-/* $OpenBSD: exec_subr.c,v 1.63 2022/11/17 18:53:12 deraadt Exp $ */
+/* $OpenBSD: exec_subr.c,v 1.64 2022/12/05 23:18:37 deraadt Exp $ */
/* $NetBSD: exec_subr.c,v 1.9 1994/12/04 03:10:42 mycroft Exp $ */
/*
if (cmd->ev_len == 0)
return (0);
-
+
KASSERT((cmd->ev_addr & PAGE_MASK) == 0);
error = uvm_map(&p->p_vmspace->vm_map, &cmd->ev_addr,
round_page(cmd->ev_len), NULL, UVM_UNKNOWN_OFFSET, 0,
{
if (cmd->ev_len == 0)
return (0);
-
+
/* ev_addr, ev_len may be misaligned, so maximize the region */
uvm_map_immutable(&p->p_vmspace->vm_map, trunc_page(cmd->ev_addr),
round_page(cmd->ev_addr + cmd->ev_len), 0);
-/* $OpenBSD: kern_bufq.c,v 1.34 2022/08/14 01:58:27 jsg Exp $ */
+/* $OpenBSD: kern_bufq.c,v 1.35 2022/12/05 23:18:37 deraadt Exp $ */
/*
* Copyright (c) 2010 Thordur I. Bjornsson <thib@openbsd.org>
* Copyright (c) 2010 David Gwynne <dlg@openbsd.org>
bufq_fifo_destroy(void *data)
{
struct bufq_fifo_head *head = data;
-
+
free(head, M_DEVBUF, sizeof(*head));
}
-/* $OpenBSD: kern_descrip.c,v 1.206 2022/08/14 01:58:27 jsg Exp $ */
+/* $OpenBSD: kern_descrip.c,v 1.207 2022/12/05 23:18:37 deraadt Exp $ */
/* $NetBSD: kern_descrip.c,v 1.42 1996/03/30 22:24:38 christos Exp $ */
/*
}
out:
FRELE(fp, p);
- return (error);
+ return (error);
}
/*
-/* $OpenBSD: kern_exit.c,v 1.207 2022/11/03 04:56:47 guenther Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.208 2022/12/05 23:18:37 deraadt Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
if (SCARG(uap, options) &~ (WUNTRACED|WNOHANG|WCONTINUED))
return (EINVAL);
-
+
if (SCARG(uap, pid) == WAIT_MYPGRP) {
idtype = P_PGID;
id = q->p_p->ps_pgid;
-/* $OpenBSD: kern_ktrace.c,v 1.108 2022/08/14 01:58:27 jsg Exp $ */
+/* $OpenBSD: kern_ktrace.c,v 1.109 2022/12/05 23:18:37 deraadt Exp $ */
/* $NetBSD: kern_ktrace.c,v 1.23 1996/02/09 18:59:36 christos Exp $ */
/*
/* nothing to change about where the trace goes? */
if (pr->ps_tracevp == newvp && pr->ps_tracecred == newcred)
- return;
+ return;
vref(newvp);
crhold(newcred);
struct ktr_header kth;
int count;
int buflen;
-
+
assert(type == KTR_EXECARGS || type == KTR_EXECENV);
atomic_setbits_int(&p->p_flag, P_INKTR);
return (0);
if (ops == KTROP_SET)
ktrsettrace(pr, facs, vp, cred);
- else {
+ else {
/* KTROP_CLEAR */
pr->ps_traceflag &= ~facs;
if ((pr->ps_traceflag & KTRFAC_MASK) == 0) {
-/* $OpenBSD: kern_pledge.c,v 1.299 2022/11/10 00:14:11 jsg Exp $ */
+/* $OpenBSD: kern_pledge.c,v 1.300 2022/12/05 23:18:37 deraadt Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
if (miblen >= 3 && /* ntpd(8) to read sensors */
mib[0] == CTL_HW && mib[1] == HW_SENSORS)
return (0);
-
+
if (miblen == 6 && /* if_nameindex() */
mib[0] == CTL_NET && mib[1] == PF_ROUTE &&
mib[2] == 0 && mib[3] == 0 && mib[4] == NET_RT_IFNAMES)
-/* $OpenBSD: kern_sched.c,v 1.75 2022/08/14 01:58:27 jsg Exp $ */
+/* $OpenBSD: kern_sched.c,v 1.76 2022/12/05 23:18:37 deraadt Exp $ */
/*
* Copyright (c) 2007, 2008 Artur Grabowski <art@openbsd.org>
*
}
KASSERT(p->p_wchan == NULL);
- return (p);
+ return (p);
}
struct cpu_info *
-/* $OpenBSD: kern_sensors.c,v 1.39 2019/12/19 17:40:11 mpi Exp $ */
+/* $OpenBSD: kern_sensors.c,v 1.40 2022/12/05 23:18:37 deraadt Exp $ */
/*
* Copyright (c) 2005 David Gwynne <dlg@openbsd.org>
sensors_quiesced = 1;
while (sensors_running > 0)
tsleep_nsec(&sensors_running, PZERO, "sensorpause", INFSLP);
-
+
}
void
sensor_restart(void)
-/* $OpenBSD: kern_tc.c,v 1.79 2022/11/08 18:17:51 cheloha Exp $ */
+/* $OpenBSD: kern_tc.c,v 1.80 2022/12/05 23:18:37 deraadt Exp $ */
/*
* Copyright (c) 2000 Poul-Henning Kamp <phk@FreeBSD.org>
microboottime(struct timeval *tvp)
{
struct bintime bt;
-
+
binboottime(&bt);
BINTIME_TO_TIMEVAL(&bt, tvp);
}
nanoboottime(struct timespec *tsp)
{
struct bintime bt;
-
+
binboottime(&bt);
BINTIME_TO_TIMESPEC(&bt, tsp);
}
-/* $OpenBSD: kern_time.c,v 1.158 2022/10/12 13:39:50 kettenis Exp $ */
+/* $OpenBSD: kern_time.c,v 1.159 2022/12/05 23:18:37 deraadt Exp $ */
/* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */
/*
struct timeval atv;
const struct timeval *delta = SCARG(uap, delta);
struct timeval *olddelta = SCARG(uap, olddelta);
- int64_t adjustment, remaining;
+ int64_t adjustment, remaining;
int error;
error = pledge_adjtime(p, delta);
-/* $OpenBSD: kern_timeout.c,v 1.88 2022/11/11 18:09:58 cheloha Exp $ */
+/* $OpenBSD: kern_timeout.c,v 1.89 2022/12/05 23:18:37 deraadt Exp $ */
/*
* Copyright (c) 2001 Thomas Nordin <nordin@openbsd.org>
* Copyright (c) 2000-2001 Artur Grabowski <art@openbsd.org>
softclock_process_kclock_timeout(struct timeout *to, int new)
{
struct kclock *kc = &timeout_kclock[to->to_kclock];
-
+
if (timespeccmp(&to->to_abstime, &kc->kc_lastscan, >)) {
tostat.tos_scheduled++;
if (!new)
db_printf("%20s %8s\n",
db_timespec(&kc->kc_lastscan), db_kclock(i));
}
- db_printf("\n");
+ db_printf("\n");
db_printf("%20s %8s %7s %*s %s\n",
"remaining", "clock", "wheel", width, "arg", "func");
db_show_callout_bucket(&timeout_new);
-/* $OpenBSD: kern_unveil.c,v 1.54 2022/08/14 01:58:27 jsg Exp $ */
+/* $OpenBSD: kern_unveil.c,v 1.55 2022/12/05 23:18:37 deraadt Exp $ */
/*
* Copyright (c) 2017-2019 Bob Beck <beck@openbsd.org>
if (pr->ps_uvpaths == NULL)
return;
-
+
uv = unveil_lookup(dp, pr, NULL);
if (uv == NULL) {
uvi = unveil_find_cover(dp, p);
-/* $OpenBSD: kern_xxx.c,v 1.40 2022/11/03 04:52:41 guenther Exp $ */
+/* $OpenBSD: kern_xxx.c,v 1.41 2022/12/05 23:18:37 deraadt Exp $ */
/* $NetBSD: kern_xxx.c,v 1.32 1996/04/22 01:38:41 christos Exp $ */
/*
if (!(scdebug & SCDEBUG_ALL || code < 0 || code >= SYS_MAXSYSCALL ||
sysent[code].sy_call == sys_nosys))
return;
-
+
pr = p->p_p;
printf("proc %d (%s): num ", pr->ps_pid, pr->ps_comm);
if (code < 0 || code >= SYS_MAXSYSCALL)
#! /bin/sh -
-# $OpenBSD: makesyscalls.sh,v 1.17 2022/10/01 23:49:38 deraadt Exp $
+# $OpenBSD: makesyscalls.sh,v 1.18 2022/12/05 23:18:37 deraadt Exp $
# $NetBSD: makesyscalls.sh,v 1.26 1998/01/09 06:17:51 thorpej Exp $
#
# Copyright (c) 1994,1996 Christopher G. Demetriou
if ($f ~ /^[a-z0-9_]*$/) { # allow syscall alias
funcalias=$f
f++
- }
+ }
if ($f != "{")
parserr($f, "{")
f++
-/* $OpenBSD: sched_bsd.c,v 1.72 2022/08/14 01:58:27 jsg Exp $ */
+/* $OpenBSD: sched_bsd.c,v 1.73 2022/12/05 23:18:37 deraadt Exp $ */
/* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
/*-
speedup = 1;
goto faster;
}
-
+
if (!idleticks)
if (!(idleticks = mallocarray(ncpusfound, sizeof(*idleticks),
M_DEVBUF, M_NOWAIT | M_ZERO)))
-/* $OpenBSD: spec_vnops.c,v 1.110 2022/11/09 18:12:47 claudio Exp $ */
+/* $OpenBSD: spec_vnops.c,v 1.111 2022/12/05 23:18:37 deraadt Exp $ */
/* $NetBSD: spec_vnops.c,v 1.29 1996/04/22 01:42:38 christos Exp $ */
/*
struct vop_strategy_args *ap = v;
struct buf *bp = ap->a_bp;
int maj = major(bp->b_dev);
-
+
if (LIST_FIRST(&bp->b_dep) != NULL)
buf_start(bp);
-/* $OpenBSD: subr_extent.c,v 1.63 2020/01/11 14:30:24 mpi Exp $ */
+/* $OpenBSD: subr_extent.c,v 1.64 2022/12/05 23:18:37 deraadt Exp $ */
/* $NetBSD: subr_extent.c,v 1.7 1996/11/21 18:46:34 cgd Exp $ */
/*-
*/
goto fail;
}
-
+
last = rp;
}
-/* $OpenBSD: sys_pipe.c,v 1.142 2022/08/14 01:58:28 jsg Exp $ */
+/* $OpenBSD: sys_pipe.c,v 1.143 2022/12/05 23:18:37 deraadt Exp $ */
/*
* Copyright (c) 1996 John S. Dyson
if (wpipe->pipe_state & PIPE_EOF) {
error = EPIPE;
break;
- }
+ }
}
}
pipe_iounlock(wpipe);
-/* $OpenBSD: sys_process.c,v 1.89 2021/12/07 04:19:24 guenther Exp $ */
+/* $OpenBSD: sys_process.c,v 1.90 2022/12/05 23:18:37 deraadt Exp $ */
/* $NetBSD: sys_process.c,v 1.55 1996/05/15 06:17:47 tls Exp $ */
/*-
iov.iov_base = &pss;
iov.iov_len = sizeof(pss);
uio.uio_iov = &iov;
- uio.uio_iovcnt = 1;
+ uio.uio_iovcnt = 1;
uio.uio_offset = (off_t)tr->ps_strings;
uio.uio_resid = sizeof(pss);
uio.uio_segflg = UIO_SYSSPACE;
-/* $OpenBSD: uipc_syscalls.c,v 1.205 2022/11/30 13:58:39 kn Exp $ */
+/* $OpenBSD: uipc_syscalls.c,v 1.206 2022/12/05 23:18:37 deraadt Exp $ */
/* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */
/*
error = socreate(AF_INET, &so, SCARG(uap, type), 0);
if (error)
return (error);
-
+
error = ypsockargs(&nam, &ypsin, sizeof ypsin, MT_SONAME);
if (error) {
soclose(so, MSG_DONTWAIT);
return (error);
}
-
+
#ifdef KTRACE
if (KTRPOINT(p, KTR_STRUCT))
ktrsockaddr(p, mtod(nam, caddr_t), sizeof(struct sockaddr_in));
-/* $OpenBSD: uipc_usrreq.c,v 1.194 2022/11/26 17:51:18 mvs Exp $ */
+/* $OpenBSD: uipc_usrreq.c,v 1.195 2022/12/05 23:18:37 deraadt Exp $ */
/* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */
/*
{
struct unpcb *unp = sotounpcb(so), *unp2;
int error;
-
+
if ((error = unp_connect2(so, so2)))
return (error);
-/* $OpenBSD: vfs_getcwd.c,v 1.37 2022/08/14 01:58:28 jsg Exp $ */
+/* $OpenBSD: vfs_getcwd.c,v 1.38 2022/12/05 23:18:37 deraadt Exp $ */
/* $NetBSD: vfs_getcwd.c,v 1.3.2.3 1999/07/11 10:24:09 sommerfeld Exp $ */
/*
ino_t fileno;
struct vattr va;
struct vnode *uvp = NULL;
- struct vnode *lvp = *lvpp;
+ struct vnode *lvp = *lvpp;
struct componentname cn;
tries = 0;
vput(uvp);
*uvpp = NULL;
-
+
error = vn_lock(lvp, LK_EXCLUSIVE | LK_RETRY);
if (!error) {
*bpp = obp; /* restore the buffer */
if (lvp == rvp)
goto out;
-
+
tvp = lvp;
lvp = lvp->v_mount->mnt_vnodecovered;