Use the LWP cached credentials where sane.

This commit is contained in:
ad 2006-07-23 22:06:03 +00:00
parent 8a487b533d
commit f474dceb13
326 changed files with 2090 additions and 2206 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: a12dc.c,v 1.15 2006/05/14 21:55:09 elad Exp $ */
/* $NetBSD: a12dc.c,v 1.16 2006/07/23 22:06:03 ad Exp $ */
/* [Notice revision 2.2]
* Copyright (c) 1997, 1998 Avalon Computer Systems, Inc.
@ -64,7 +64,7 @@
#ifndef BSIDE
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: a12dc.c,v 1.15 2006/05/14 21:55:09 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: a12dc.c,v 1.16 2006/07/23 22:06:03 ad Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -164,7 +164,7 @@ a12dcattach(parent, self, aux)
/* note that we've attached the chipset; can't have 2 A12Cs. */
a12dcfound = 1;
printf(": driver %s\n", "$Revision: 1.15 $");
printf(": driver %s\n", "$Revision: 1.16 $");
tp = a12dc_tty[0] = ttymalloc();
tp->t_oproc = a12dcstart;
@ -262,10 +262,10 @@ static int did_init;
}
int
a12dcopen(dev, flag, mode, p)
a12dcopen(dev, flag, mode, l)
dev_t dev;
int flag, mode;
struct proc *p;
struct lwp *l;
{
int unit = minor(dev);
struct tty *tp;
@ -287,7 +287,8 @@ a12dcopen(dev, flag, mode, p)
if ((tp->t_state & TS_ISOPEN) &&
(tp->t_state & TS_XCLUDE) &&
kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag) != 0)
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return EBUSY;
s = spltty();

View File

@ -1,4 +1,4 @@
/* $NetBSD: promcons.c,v 1.27 2006/05/14 21:55:09 elad Exp $ */
/* $NetBSD: promcons.c,v 1.28 2006/07/23 22:06:04 ad Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@ -29,7 +29,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: promcons.c,v 1.27 2006/05/14 21:55:09 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: promcons.c,v 1.28 2006/07/23 22:06:04 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -113,8 +113,8 @@ promopen(dev_t dev, int flag, int mode, struct lwp *l)
setuptimeout = 1;
} else if (tp->t_state&TS_XCLUDE &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER,
&l->l_proc->p_acflag) != 0) {
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0) {
splx(s);
return EBUSY;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.110 2006/07/19 21:11:39 ad Exp $ */
/* $NetBSD: trap.c,v 1.111 2006/07/23 22:06:04 ad Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -100,7 +100,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.110 2006/07/19 21:11:39 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.111 2006/07/23 22:06:04 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -549,8 +549,8 @@ do_fault:
printf("UVM: pid %d (%s), uid %d killed: "
"out of swap\n", l->l_proc->p_pid,
l->l_proc->p_comm,
l->l_proc->p_cred ?
kauth_cred_geteuid(l->l_proc->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
} else
ksi.ksi_signo = SIGSEGV;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mem.c,v 1.6 2006/05/14 21:55:09 elad Exp $ */
/* $NetBSD: mem.c,v 1.7 2006/07/23 22:06:04 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.6 2006/05/14 21:55:09 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.7 2006/07/23 22:06:04 ad Exp $");
#include "opt_compat_netbsd.h"
@ -226,7 +226,7 @@ mmmmap(dev, off, prot)
off_t off;
int prot;
{
struct proc *p = curproc; /* XXX */
struct lwp *l = curlwp; /* XXX */
/*
* /dev/mem is the only one that makes sense through this
@ -239,7 +239,8 @@ mmmmap(dev, off, prot)
if (minor(dev) != DEV_MEM)
return (-1);
if (off > ctob(physmem) && kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag) != 0)
if (off > ctob(physmem) && kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag) != 0)
return (-1);
return (x86_btop(off));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep.c,v 1.23 2006/05/14 21:55:09 elad Exp $ */
/* $NetBSD: netbsd32_machdep.c,v 1.24 2006/07/23 22:06:04 ad Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.23 2006/05/14 21:55:09 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.24 2006/07/23 22:06:04 ad Exp $");
#include "opt_compat_netbsd.h"
#include "opt_execfmt.h"
@ -607,14 +607,14 @@ x86_64_get_mtrr32(struct lwp *l, void *args, register_t *retval)
int32_t n;
struct mtrr32 *m32p, m32;
struct mtrr *m64p, *mp;
struct proc *p = l->l_proc;
m64p = NULL;
if (mtrr_funcs == NULL)
return ENOSYS;
error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag);
error = kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag);
if (error != 0)
return error;
@ -639,7 +639,7 @@ x86_64_get_mtrr32(struct lwp *l, void *args, register_t *retval)
error = ENOMEM;
goto fail;
}
error = mtrr_get(m64p, &n, p, 0);
error = mtrr_get(m64p, &n, l->l_proc, 0);
if (error != 0)
goto fail;
m32p = (struct mtrr32 *)(uintptr_t)args32.mtrrp;
@ -674,14 +674,14 @@ x86_64_set_mtrr32(struct lwp *l, void *args, register_t *retval)
struct mtrr *m64p, *mp;
int error, i;
int32_t n;
struct proc *p = l->l_proc;
m64p = NULL;
if (mtrr_funcs == NULL)
return ENOSYS;
error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag);
error = kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag);
if (error != 0)
return error;
@ -718,7 +718,7 @@ x86_64_set_mtrr32(struct lwp *l, void *args, register_t *retval)
mp++;
}
error = mtrr_set(m64p, &n, p, 0);
error = mtrr_set(m64p, &n, l->l_proc, 0);
fail:
if (m64p != NULL)
free(m64p, M_TEMP);

View File

@ -1,4 +1,4 @@
/* $NetBSD: sys_machdep.c,v 1.6 2006/05/14 21:55:09 elad Exp $ */
/* $NetBSD: sys_machdep.c,v 1.7 2006/07/23 22:06:04 ad Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.6 2006/05/14 21:55:09 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.7 2006/07/23 22:06:04 ad Exp $");
#if 0
#include "opt_user_ldt.h"
@ -389,14 +389,14 @@ x86_64_iopl(l, args, retval)
register_t *retval;
{
int error;
struct proc *p = l->l_proc;
struct trapframe *tf = l->l_md.md_regs;
struct x86_64_iopl_args ua;
if (securelevel > 1)
return EPERM;
if ((error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0)
if ((error = kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag)) != 0)
return error;
if ((error = copyin(args, &ua, sizeof(ua))) != 0)
@ -441,7 +441,8 @@ x86_64_set_ioperm(p, args, retval)
if (securelevel > 1)
return EPERM;
if ((error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0)
if ((error = kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag)) != 0)
return error;
if ((error = copyin(args, &ua, sizeof(ua))) != 0)
@ -483,12 +484,12 @@ x86_64_set_mtrr(struct lwp *l, void *args, register_t *retval)
{
int error, n;
struct x86_64_set_mtrr_args ua;
struct proc *p = l->l_proc;
if (mtrr_funcs == NULL)
return ENOSYS;
error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag);
error = kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag);
if (error != 0)
return error;
@ -500,7 +501,7 @@ x86_64_set_mtrr(struct lwp *l, void *args, register_t *retval)
if (error != 0)
return error;
error = mtrr_set(ua.mtrrp, &n, p, MTRR_GETSET_USER);
error = mtrr_set(ua.mtrrp, &n, l->l_proc, MTRR_GETSET_USER);
if (n != 0)
mtrr_commit();

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.26 2006/07/19 21:11:39 ad Exp $ */
/* $NetBSD: trap.c,v 1.27 2006/07/23 22:06:04 ad Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.26 2006/07/19 21:11:39 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.27 2006/07/23 22:06:04 ad Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -522,8 +522,8 @@ faultcommon:
ksi.ksi_signo = SIGKILL;
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
} else {
#ifdef TRAP_SIGDEBUG
printf("pid %d (%s): SEGV at rip %lx addr %lx\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.109 2006/07/19 21:11:39 ad Exp $ */
/* $NetBSD: trap.c,v 1.110 2006/07/23 22:06:04 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@ -83,7 +83,7 @@
#include "opt_fpu_emulate.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.109 2006/07/19 21:11:39 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.110 2006/07/23 22:06:04 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -534,7 +534,7 @@ nogo:
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ? kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ? kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
} else {
ksi.ksi_signo = SIGSEGV;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ite.c,v 1.73 2006/05/14 21:55:09 elad Exp $ */
/* $NetBSD: ite.c,v 1.74 2006/07/23 22:06:04 ad Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
@ -83,7 +83,7 @@
#include "opt_ddb.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.73 2006/05/14 21:55:09 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.74 2006/07/23 22:06:04 ad Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -465,7 +465,8 @@ iteopen(dev_t dev, int mode, int devtype, struct lwp *l)
} else
tp = ip->tp;
if ((tp->t_state & (TS_ISOPEN | TS_XCLUDE)) == (TS_ISOPEN | TS_XCLUDE)
&& kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
&& kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return (EBUSY);
if ((ip->flags & ITE_ACTIVE) == 0) {
ite_on(dev, 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: mfc.c,v 1.40 2006/05/14 21:55:09 elad Exp $ */
/* $NetBSD: mfc.c,v 1.41 2006/07/23 22:06:04 ad Exp $ */
/*
* Copyright (c) 1982, 1990 The Regents of the University of California.
@ -58,7 +58,7 @@
#include "opt_kgdb.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mfc.c,v 1.40 2006/05/14 21:55:09 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: mfc.c,v 1.41 2006/07/23 22:06:04 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -536,9 +536,8 @@ mfcsopen(dev_t dev, int flag, int mode, struct lwp *l)
else
tp->t_state &= ~TS_CARR_ON;
} else if (tp->t_state & TS_XCLUDE &&
kauth_authorize_generic(l->l_proc->p_cred,
KAUTH_GENERIC_ISSUSER,
&l->l_proc->p_acflag) != 0) {
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0) {
splx(s);
return(EBUSY);
}
@ -715,9 +714,8 @@ mfcsioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
*(int *)data = SWFLAGS(dev);
break;
case TIOCSFLAGS:
error = kauth_authorize_generic(l->l_proc->p_cred,
KAUTH_GENERIC_ISSUSER,
&l->l_proc->p_acflag);
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
if (error != 0)
return(EPERM);

View File

@ -1,4 +1,4 @@
/* $NetBSD: msc.c,v 1.33 2006/05/14 21:55:09 elad Exp $ */
/* $NetBSD: msc.c,v 1.34 2006/07/23 22:06:04 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@ -93,7 +93,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: msc.c,v 1.33 2006/05/14 21:55:09 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: msc.c,v 1.34 2006/07/23 22:06:04 ad Exp $");
#include "msc.h"
@ -409,9 +409,8 @@ mscopen(dev_t dev, int flag, int mode, struct lwp *l)
} else {
if (tp->t_state & TS_XCLUDE &&
kauth_authorize_generic(l->l_proc->p_cred,
KAUTH_GENERIC_ISSUSER,
&l->l_proc->p_acflag) != 0) {
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0) {
splx(s);
return (EBUSY);
}
@ -864,9 +863,8 @@ mscioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
break;
case TIOCSFLAGS:
error = kauth_authorize_generic(l->l_proc->p_cred,
KAUTH_GENERIC_ISSUSER,
&l->l_proc->p_acflag);
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
if (error != 0)
return(EPERM);
msc->openflags = *(int *)data;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ser.c,v 1.72 2006/05/14 21:55:09 elad Exp $ */
/* $NetBSD: ser.c,v 1.73 2006/07/23 22:06:04 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@ -40,7 +40,7 @@
#include "opt_kgdb.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ser.c,v 1.72 2006/05/14 21:55:09 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: ser.c,v 1.73 2006/07/23 22:06:04 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -296,9 +296,8 @@ seropen(dev_t dev, int flag, int mode, struct lwp *l)
if ((tp->t_state & TS_ISOPEN) &&
(tp->t_state & TS_XCLUDE) &&
kauth_authorize_generic(l->l_proc->p_cred,
KAUTH_GENERIC_ISSUSER,
&l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return (EBUSY);
s = spltty();
@ -742,9 +741,8 @@ serioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
*(int *)data = serswflags;
break;
case TIOCSFLAGS:
error = kauth_authorize_generic(l->l_proc->p_cred,
KAUTH_GENERIC_ISSUSER,
&l->l_proc->p_acflag);
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
if (error != 0)
return(EPERM);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pccons.c,v 1.45 2006/07/01 17:15:46 tsutsui Exp $ */
/* $NetBSD: pccons.c,v 1.46 2006/07/23 22:06:04 ad Exp $ */
/* $OpenBSD: pccons.c,v 1.22 1999/01/30 22:39:37 imp Exp $ */
/* NetBSD: pccons.c,v 1.89 1995/05/04 19:35:20 cgd Exp */
@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pccons.c,v 1.45 2006/07/01 17:15:46 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: pccons.c,v 1.46 2006/07/23 22:06:04 ad Exp $");
#include "opt_ddb.h"
@ -621,7 +621,8 @@ pcopen(dev_t dev, int flag, int mode, struct lwp *l)
pcparam(tp, &tp->t_termios);
ttsetwater(tp);
} else if (tp->t_state&TS_XCLUDE &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return EBUSY;
tp->t_state |= TS_CARR_ON;

View File

@ -1,4 +1,4 @@
/* $NetBSD: fault.c,v 1.61 2006/07/19 21:11:40 ad Exp $ */
/* $NetBSD: fault.c,v 1.62 2006/07/23 22:06:04 ad Exp $ */
/*
* Copyright 2003 Wasabi Systems, Inc.
@ -81,7 +81,7 @@
#include "opt_kgdb.h"
#include <sys/types.h>
__KERNEL_RCSID(0, "$NetBSD: fault.c,v 1.61 2006/07/19 21:11:40 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: fault.c,v 1.62 2006/07/23 22:06:04 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -493,7 +493,7 @@ data_abort_handler(trapframe_t *tf)
if (error == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: "
"out of swap\n", l->l_proc->p_pid, l->l_proc->p_comm,
l->l_proc->p_cred ? kauth_cred_geteuid(l->l_proc->p_cred) : -1);
l->l_cred ? kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
} else
ksi.ksi_signo = SIGSEGV;
@ -868,7 +868,7 @@ prefetch_abort_handler(trapframe_t *tf)
if (error == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: "
"out of swap\n", l->l_proc->p_pid, l->l_proc->p_comm,
l->l_proc->p_cred ? kauth_cred_geteuid(l->l_proc->p_cred) : -1);
l->l_cred ? kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
} else
ksi.ksi_signo = SIGSEGV;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mem.c,v 1.13 2006/05/14 21:55:09 elad Exp $ */
/* $NetBSD: mem.c,v 1.14 2006/07/23 22:06:04 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -75,7 +75,7 @@
#include "opt_compat_netbsd.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.13 2006/05/14 21:55:09 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.14 2006/07/23 22:06:04 ad Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@ -204,7 +204,7 @@ mmmmap(dev, off, prot)
off_t off;
int prot;
{
struct proc *p = curproc; /* XXX */
struct proc *l = curlwp; /* XXX */
/*
* /dev/mem is the only one that makes sense through this
@ -219,8 +219,8 @@ mmmmap(dev, off, prot)
/* minor device 0 is physical memory */
if (off >= ctob(physmem) &&
kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag) != 0)
if (off >= ctob(physmem) && kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag) != 0)
return -1;
return arm_btop(off);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: epcom.c,v 1.10 2006/05/14 21:55:09 elad Exp $ */
/* $NetBSD: epcom.c,v 1.11 2006/07/23 22:06:04 ad Exp $ */
/*
* Copyright (c) 1998, 1999, 2001, 2002, 2004 The NetBSD Foundation, Inc.
* All rights reserved.
@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: epcom.c,v 1.10 2006/05/14 21:55:09 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: epcom.c,v 1.11 2006/07/23 22:06:04 ad Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -471,7 +471,8 @@ epcomopen(dev_t dev, int flag, int mode, struct lwp *l)
if (ISSET(tp->t_state, TS_ISOPEN) &&
ISSET(tp->t_state, TS_XCLUDE) &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return (EBUSY);
s = spltty();
@ -693,7 +694,8 @@ epcomioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
break;
case TIOCSFLAGS:
error = kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag);
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
if (error)
break;
sc->sc_swflags = *(int *)data;

View File

@ -1,4 +1,4 @@
/* $NetBSD: footbridge_com.c,v 1.19 2006/05/14 21:55:10 elad Exp $ */
/* $NetBSD: footbridge_com.c,v 1.20 2006/07/23 22:06:04 ad Exp $ */
/*-
* Copyright (c) 1997 Mark Brinicombe
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: footbridge_com.c,v 1.19 2006/05/14 21:55:10 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: footbridge_com.c,v 1.20 2006/07/23 22:06:04 ad Exp $");
#include "opt_ddb.h"
#include "opt_ddbparam.h"
@ -227,7 +227,6 @@ fcomopen(dev, flag, mode, l)
int flag, mode;
struct lwp *l;
{
struct proc *p = l->l_proc;
struct fcom_softc *sc;
int unit = minor(dev);
struct tty *tp;
@ -272,7 +271,8 @@ fcomopen(dev, flag, mode, l)
fcomparam(tp, &tp->t_termios);
ttsetwater(tp);
} else if ((tp->t_state&TS_XCLUDE) &&
kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag))
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag))
return EBUSY;
tp->t_state |= TS_CARR_ON;
@ -349,7 +349,6 @@ fcomioctl(dev, cmd, data, flag, l)
int flag;
struct lwp *l;
{
struct proc *p = l->l_proc;
struct fcom_softc *sc = fcom_cd.cd_devs[minor(dev)];
struct tty *tp = sc->sc_tty;
int error;
@ -366,7 +365,8 @@ fcomioctl(dev, cmd, data, flag, l)
break;
case TIOCSFLAGS:
error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag);
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
if (error)
return (error);
sc->sc_swflags = *(int *)data;

View File

@ -1,4 +1,4 @@
/* $NetBSD: console.c,v 1.16 2006/05/14 21:55:10 elad Exp $ */
/* $NetBSD: console.c,v 1.17 2006/07/23 22:06:04 ad Exp $ */
/*
* Copyright (c) 1994-1995 Melvyn Tang-Richardson
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: console.c,v 1.16 2006/05/14 21:55:10 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: console.c,v 1.17 2006/07/23 22:06:04 ad Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -406,7 +406,8 @@ physconopen(dev, flag, mode, l)
physconparam(TP, &TP->t_termios);
ttsetwater(TP);
} else if (TP->t_state&TS_XCLUDE &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return EBUSY;
TP->t_state |= TS_CARR_ON;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixp12x0_com.c,v 1.26 2006/05/14 21:55:10 elad Exp $ */
/* $NetBSD: ixp12x0_com.c,v 1.27 2006/07/23 22:06:04 ad Exp $ */
/*
* Copyright (c) 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
* All rights reserved.
@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ixp12x0_com.c,v 1.26 2006/05/14 21:55:10 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: ixp12x0_com.c,v 1.27 2006/07/23 22:06:04 ad Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -508,7 +508,8 @@ ixpcomopen(dev, flag, mode, l)
if (ISSET(tp->t_state, TS_ISOPEN) &&
ISSET(tp->t_state, TS_XCLUDE) &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return (EBUSY);
s = spltty();
@ -749,7 +750,8 @@ ixpcomioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
break;
case TIOCSFLAGS:
error = kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag);
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
if (error)
break;
sc->sc_swflags = *(int *)data;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sscom.c,v 1.18 2006/05/14 21:55:10 elad Exp $ */
/* $NetBSD: sscom.c,v 1.19 2006/07/23 22:06:04 ad Exp $ */
/*
* Copyright (c) 2002, 2003 Fujitsu Component Limited
@ -105,7 +105,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sscom.c,v 1.18 2006/05/14 21:55:10 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: sscom.c,v 1.19 2006/07/23 22:06:04 ad Exp $");
#include "opt_sscom.h"
#include "opt_ddb.h"
@ -632,7 +632,8 @@ sscomopen(dev_t dev, int flag, int mode, struct lwp *l)
if (ISSET(tp->t_state, TS_ISOPEN) &&
ISSET(tp->t_state, TS_XCLUDE) &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return EBUSY;
s = spltty();
@ -859,7 +860,8 @@ sscomioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
break;
case TIOCSFLAGS:
error = kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag);
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
if (error)
break;
sc->sc_swflags = *(int *)data;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sa11x0_com.c,v 1.34 2006/06/27 13:58:08 peter Exp $ */
/* $NetBSD: sa11x0_com.c,v 1.35 2006/07/23 22:06:04 ad Exp $ */
/*-
* Copyright (c) 1998, 1999, 2001 The NetBSD Foundation, Inc.
@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sa11x0_com.c,v 1.34 2006/06/27 13:58:08 peter Exp $");
__KERNEL_RCSID(0, "$NetBSD: sa11x0_com.c,v 1.35 2006/07/23 22:06:04 ad Exp $");
#include "opt_com.h"
#include "opt_ddb.h"
@ -523,8 +523,8 @@ sacomopen(dev_t dev, int flag, int mode, struct lwp *l)
if (ISSET(tp->t_state, TS_ISOPEN) &&
ISSET(tp->t_state, TS_XCLUDE) &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER,
&l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return EBUSY;
s = spltty();
@ -760,7 +760,8 @@ sacomioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
break;
case TIOCSFLAGS:
error = kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag);
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
if (error)
break;
sc->sc_swflags = *(int *)data;

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.83 2006/07/19 21:11:40 ad Exp $ */
/* $NetBSD: trap.c,v 1.84 2006/07/23 22:06:04 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.83 2006/07/19 21:11:40 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.84 2006/07/23 22:06:04 ad Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -721,8 +721,8 @@ trap(type, code, v, frame)
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
} else {
ksi.ksi_signo = SIGSEGV;
@ -821,7 +821,7 @@ writeback(fp, docachepush)
pmap_update(pmap_kernel());
} else
printf("WARNING: pid %d(%s) uid %d: CPUSH not done\n",
p->p_pid, p->p_comm, kauth_cred_geteuid(p->p_cred));
p->p_pid, p->p_comm, kauth_cred_geteuid(l->l_cred));
} else if ((f->f_ssw & (SSW4_RW|SSW4_TTMASK)) == SSW4_TTM16) {
/*
* MOVE16 fault.

View File

@ -1,4 +1,4 @@
/* $NetBSD: ite.c,v 1.51 2006/05/14 21:55:10 elad Exp $ */
/* $NetBSD: ite.c,v 1.52 2006/07/23 22:06:04 ad Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
@ -81,7 +81,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.51 2006/05/14 21:55:10 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.52 2006/07/23 22:06:04 ad Exp $");
#include "opt_ddb.h"
@ -443,7 +443,8 @@ iteopen(dev, mode, devtype, l)
else tp = ip->tp;
if ((tp->t_state & (TS_ISOPEN | TS_XCLUDE)) == (TS_ISOPEN | TS_XCLUDE)
&& kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
&& kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return (EBUSY);
if ((ip->flags & ITE_ACTIVE) == 0) {
ite_on(dev, 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ser.c,v 1.29 2006/05/14 21:55:10 elad Exp $ */
/* $NetBSD: ser.c,v 1.30 2006/07/23 22:06:04 ad Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -100,7 +100,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ser.c,v 1.29 2006/05/14 21:55:10 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: ser.c,v 1.30 2006/07/23 22:06:04 ad Exp $");
#include "opt_ddb.h"
#include "opt_mbtype.h"
@ -393,7 +393,8 @@ seropen(dev, flag, mode, l)
if (ISSET(tp->t_state, TS_ISOPEN) &&
ISSET(tp->t_state, TS_XCLUDE) &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return (EBUSY);
s = spltty();
@ -611,7 +612,8 @@ serioctl(dev, cmd, data, flag, l)
break;
case TIOCSFLAGS:
error = kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag);
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
if (error)
return (error);
sc->sc_swflags = *(int *)data;

View File

@ -1,4 +1,4 @@
/* $NetBSD: zs.c,v 1.47 2006/05/14 21:55:10 elad Exp $ */
/* $NetBSD: zs.c,v 1.48 2006/07/23 22:06:04 ad Exp $ */
/*
* Copyright (c) 1992, 1993
@ -82,7 +82,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.47 2006/05/14 21:55:10 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.48 2006/07/23 22:06:04 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -403,7 +403,8 @@ struct lwp *l;
if ((tp->t_state & TS_ISOPEN) &&
(tp->t_state & TS_XCLUDE) &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return (EBUSY);
s = spltty();
@ -908,7 +909,8 @@ struct lwp *l;
case TIOCSFLAGS: {
int userbits = 0;
error = kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag);
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
if(error != 0)
return (EPERM);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pccons.c,v 1.39 2006/05/14 21:55:10 elad Exp $ */
/* $NetBSD: pccons.c,v 1.40 2006/07/23 22:06:05 ad Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pccons.c,v 1.39 2006/05/14 21:55:10 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: pccons.c,v 1.40 2006/07/23 22:06:05 ad Exp $");
#include "opt_ddb.h"
#include "opt_xserver.h"
@ -871,7 +871,8 @@ pcopen(dev, flag, mode, l)
pcparam(tp, &tp->t_termios);
ttsetwater(tp);
} else if (tp->t_state&TS_XCLUDE &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return (EBUSY);
tp->t_state |= TS_CARR_ON;

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.28 2006/07/19 21:11:40 ad Exp $ */
/* $NetBSD: trap.c,v 1.29 2006/07/23 22:06:05 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.28 2006/07/19 21:11:40 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.29 2006/07/23 22:06:05 ad Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -730,8 +730,8 @@ trap(type, code, v, frame)
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
} else {
ksi.ksi_signo = SIGSEGV;
@ -825,7 +825,7 @@ writeback(fp, docachepush)
pmap_update(pmap_kernel());
} else
printf("WARNING: pid %d(%s) uid %d: CPUSH not done\n",
p->p_pid, p->p_comm, kauth_cred_geteuid(p->p_cred));
p->p_pid, p->p_comm, kauth_cred_geteuid(l->l_cred));
} else if ((f->f_ssw & (SSW4_RW|SSW4_TTMASK)) == SSW4_TTM16) {
/*
* MOVE16 fault.

View File

@ -1,4 +1,4 @@
/* $NetBSD: plcom.c,v 1.16 2006/05/14 21:55:10 elad Exp $ */
/* $NetBSD: plcom.c,v 1.17 2006/07/23 22:06:05 ad Exp $ */
/*-
* Copyright (c) 2001 ARM Ltd
@ -101,7 +101,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.16 2006/05/14 21:55:10 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.17 2006/07/23 22:06:05 ad Exp $");
#include "opt_plcom.h"
#include "opt_ddb.h"
@ -643,9 +643,8 @@ plcomopen(dev_t dev, int flag, int mode, struct lwp *l)
if (ISSET(tp->t_state, TS_ISOPEN) &&
ISSET(tp->t_state, TS_XCLUDE) &&
kauth_authorize_generic(l->l_proc->p_cred,
KAUTH_GENERIC_ISSUSER,
&l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return EBUSY;
s = spltty();
@ -887,9 +886,8 @@ plcomioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
break;
case TIOCSFLAGS:
error = kauth_authorize_generic(l->l_proc->p_cred,
KAUTH_GENERIC_ISSUSER,
&l->l_proc->p_acflag);
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
if (error)
break;
sc->sc_swflags = *(int *)data;

View File

@ -1,4 +1,4 @@
/* $NetBSD: dcm.c,v 1.72 2006/07/21 10:01:39 tsutsui Exp $ */
/* $NetBSD: dcm.c,v 1.73 2006/07/23 22:06:05 ad Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -123,7 +123,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dcm.c,v 1.72 2006/07/21 10:01:39 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: dcm.c,v 1.73 2006/07/23 22:06:05 ad Exp $");
#include "opt_kgdb.h"
@ -552,8 +552,8 @@ dcmopen(dev_t dev, int flag, int mode, struct lwp *l)
if ((tp->t_state & TS_ISOPEN) &&
(tp->t_state & TS_XCLUDE) &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER,
&l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return EBUSY;
s = spltty();
@ -1088,8 +1088,8 @@ dcmioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
case TIOCSFLAGS: {
int userbits;
error = kauth_authorize_generic(l->l_proc->p_cred,
KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag);
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
if (error)
return EPERM;

View File

@ -1,4 +1,4 @@
/* $NetBSD: hil.c,v 1.71 2006/07/21 10:01:39 tsutsui Exp $ */
/* $NetBSD: hil.c,v 1.72 2006/07/23 22:06:05 ad Exp $ */
/*
* Copyright (c) 1990, 1993
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hil.c,v 1.71 2006/07/21 10:01:39 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: hil.c,v 1.72 2006/07/23 22:06:05 ad Exp $");
#include "opt_compat_hpux.h"
#include "ite.h"
@ -171,7 +171,7 @@ static void hpuxhilevent(struct hil_softc *, struct hilloopdev *);
static int hilqalloc(struct hil_softc *, struct hilqinfo *, struct proc *);
static int hilqfree(struct hil_softc *, int, struct proc *);
static int hilqmap(struct hil_softc *, int, int, struct proc *);
static int hilqmap(struct hil_softc *, int, int, struct lwp *);
static int hilqunmap(struct hil_softc *, int, int, struct proc *);
#ifdef DEBUG
@ -629,7 +629,7 @@ hilioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
break;
case HILIOCMAPQ:
error = hilqmap(hilp, *(int *)data, HILUNIT(dev), l->l_proc);
error = hilqmap(hilp, *(int *)data, HILUNIT(dev), l);
break;
case HILIOCUNMAPQ:
@ -1216,7 +1216,7 @@ hilqfree(struct hil_softc *hilp, int qnum, struct proc *p)
}
static int
hilqmap(struct hil_softc *hilp, int qnum, int device, struct proc *p)
hilqmap(struct hil_softc *hilp, int qnum, int device, struct lwp *l)
{
struct hilloopdev *dptr = &hilp->hl_device[device];
int s;
@ -1226,17 +1226,17 @@ hilqmap(struct hil_softc *hilp, int qnum, int device, struct proc *p)
printf("hilqmap(%d): qnum %d device %x\n",
p->p_pid, qnum, device);
#endif
if (qnum >= NHILQ || hilp->hl_queue[qnum].hq_procp != p)
if (qnum >= NHILQ || hilp->hl_queue[qnum].hq_procp != l->l_proc)
return EINVAL;
if ((dptr->hd_flags & HIL_QUEUEIN) == 0)
return EINVAL;
if (dptr->hd_qmask && kauth_cred_geteuid(p->p_cred) &&
kauth_cred_geteuid(p->p_cred) != dptr->hd_uid)
if (dptr->hd_qmask && kauth_cred_geteuid(l->l_cred) &&
kauth_cred_geteuid(l->l_cred) != dptr->hd_uid)
return EPERM;
hilp->hl_queue[qnum].hq_devmask |= hildevmask(device);
if (dptr->hd_qmask == 0)
dptr->hd_uid = kauth_cred_geteuid(p->p_cred);
dptr->hd_uid = kauth_cred_geteuid(l->l_cred);
s = splhil();
dptr->hd_qmask |= hilqmask(qnum);
splx(s);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ite.c,v 1.74 2006/07/21 10:01:39 tsutsui Exp $ */
/* $NetBSD: ite.c,v 1.75 2006/07/23 22:06:05 ad Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -119,7 +119,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.74 2006/07/21 10:01:39 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.75 2006/07/23 22:06:05 ad Exp $");
#include "hil.h"
@ -401,8 +401,8 @@ iteopen(dev_t dev, int mode, int devtype, struct lwp *l)
} else
tp = ip->tty;
if ((tp->t_state&(TS_ISOPEN|TS_XCLUDE)) == (TS_ISOPEN|TS_XCLUDE)
&& kauth_authorize_generic(l->l_proc->p_cred,
KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
&& kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag) != 0)
return EBUSY;
if ((ip->flags & ITE_ACTIVE) == 0) {
error = iteon(ip, 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.124 2006/07/19 21:11:41 ad Exp $ */
/* $NetBSD: trap.c,v 1.125 2006/07/23 22:06:05 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.124 2006/07/19 21:11:41 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.125 2006/07/23 22:06:05 ad Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -703,8 +703,8 @@ trap(int type, u_int code, u_int v, struct frame frame)
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
} else {
ksi.ksi_signo = SIGSEGV;
@ -796,7 +796,7 @@ writeback(struct frame *fp, int docachepush)
pmap_update(pmap_kernel());
} else
printf("WARNING: pid %d(%s) uid %d: CPUSH not done\n",
p->p_pid, p->p_comm, kauth_cred_geteuid(p->p_cred));
p->p_pid, p->p_comm, kauth_cred_geteuid(l->l_cred));
} else if ((f->f_ssw & (SSW4_RW|SSW4_TTMASK)) == SSW4_TTM16) {
/*
* MOVE16 fault.

View File

@ -1,4 +1,4 @@
/* $NetBSD: pdc.c,v 1.16 2006/05/14 21:55:11 elad Exp $ */
/* $NetBSD: pdc.c,v 1.17 2006/07/23 22:06:05 ad Exp $ */
/* $OpenBSD: pdc.c,v 1.14 2001/04/29 21:05:43 mickey Exp $ */
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.16 2006/05/14 21:55:11 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.17 2006/07/23 22:06:05 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -197,7 +197,8 @@ pdcopen(dev_t dev, int flag, int mode, struct lwp *l)
setuptimeout = 1;
} else if ((tp->t_state&TS_XCLUDE) &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag)) {
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag)) {
splx(s);
return EBUSY;
} else

View File

@ -1,4 +1,4 @@
/* $NetBSD: txcom.c,v 1.30 2006/05/14 21:55:11 elad Exp $ */
/* $NetBSD: txcom.c,v 1.31 2006/07/23 22:06:05 ad Exp $ */
/*-
* Copyright (c) 1999, 2000, 2004 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: txcom.c,v 1.30 2006/05/14 21:55:11 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: txcom.c,v 1.31 2006/07/23 22:06:05 ad Exp $");
#include "opt_tx39uart_debug.h"
@ -797,7 +797,8 @@ txcomopen(dev_t dev, int flag, int mode, struct lwp *l)
if (ISSET(tp->t_state, TS_ISOPEN) &&
ISSET(tp->t_state, TS_XCLUDE) &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return (EBUSY);
s = spltty();
@ -987,7 +988,8 @@ txcomioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
break;
case TIOCSFLAGS:
err = kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag);
err = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
if (err) {
break;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sys_machdep.c,v 1.73 2006/05/14 21:55:38 elad Exp $ */
/* $NetBSD: sys_machdep.c,v 1.74 2006/07/23 22:06:05 ad Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.73 2006/05/14 21:55:38 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.74 2006/07/23 22:06:05 ad Exp $");
#include "opt_compat_netbsd.h"
#include "opt_mtrr.h"
@ -351,14 +351,14 @@ i386_iopl(l, args, retval)
register_t *retval;
{
int error;
struct proc *p = l->l_proc;
struct trapframe *tf = l->l_md.md_regs;
struct i386_iopl_args ua;
if (securelevel > 1)
return EPERM;
if ((error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0)
if ((error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0)
return error;
if ((error = copyin(args, &ua, sizeof(ua))) != 0)
@ -395,14 +395,14 @@ i386_set_ioperm(l, args, retval)
register_t *retval;
{
int error;
struct proc *p = l->l_proc;
struct pcb *pcb = &l->l_addr->u_pcb;
struct i386_set_ioperm_args ua;
if (securelevel > 1)
return EPERM;
if ((error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0)
if ((error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0)
return error;
if ((error = copyin(args, &ua, sizeof(ua))) != 0)
@ -417,7 +417,6 @@ i386_get_mtrr(struct lwp *l, void *args, register_t *retval)
{
struct i386_get_mtrr_args ua;
int error, n;
struct proc *p = l->l_proc;
if (mtrr_funcs == NULL)
return ENOSYS;
@ -430,7 +429,7 @@ i386_get_mtrr(struct lwp *l, void *args, register_t *retval)
if (error != 0)
return error;
error = mtrr_get(ua.mtrrp, &n, p, MTRR_GETSET_USER);
error = mtrr_get(ua.mtrrp, &n, l->l_proc, MTRR_GETSET_USER);
copyout(&n, ua.n, sizeof (int));
@ -442,12 +441,12 @@ i386_set_mtrr(struct lwp *l, void *args, register_t *retval)
{
int error, n;
struct i386_set_mtrr_args ua;
struct proc *p = l->l_proc;
if (mtrr_funcs == NULL)
return ENOSYS;
error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag);
error = kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag);
if (error != 0)
return error;
@ -459,7 +458,7 @@ i386_set_mtrr(struct lwp *l, void *args, register_t *retval)
if (error != 0)
return error;
error = mtrr_set(ua.mtrrp, &n, p, MTRR_GETSET_USER);
error = mtrr_set(ua.mtrrp, &n, l->l_proc, MTRR_GETSET_USER);
if (n != 0)
mtrr_commit();

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.212 2006/07/19 21:11:42 ad Exp $ */
/* $NetBSD: trap.c,v 1.213 2006/07/23 22:06:05 ad Exp $ */
/*-
* Copyright (c) 1998, 2000, 2005 The NetBSD Foundation, Inc.
@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.212 2006/07/19 21:11:42 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.213 2006/07/23 22:06:05 ad Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -677,8 +677,8 @@ copyfault:
ksi.ksi_signo = SIGKILL;
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
} else {
ksi.ksi_signo = SIGSEGV;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: pccons.c,v 1.177 2006/05/14 21:55:38 elad Exp $ */
/* $NetBSD: pccons.c,v 1.178 2006/07/23 22:06:05 ad Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pccons.c,v 1.177 2006/05/14 21:55:38 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: pccons.c,v 1.178 2006/07/23 22:06:05 ad Exp $");
#include "opt_ddb.h"
#include "opt_xserver.h"
@ -848,7 +848,8 @@ pcopen(dev_t dev, int flag, int mode, struct lwp *l)
pcparam(tp, &tp->t_termios);
ttsetwater(tp);
} else if (tp->t_state&TS_XCLUDE &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag) != 0)
return (EBUSY);
tp->t_state |= TS_CARR_ON;

View File

@ -1,4 +1,4 @@
/* $NetBSD: siotty.c,v 1.17 2006/05/14 21:55:38 elad Exp $ */
/* $NetBSD: siotty.c,v 1.18 2006/07/23 22:06:05 ad Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: siotty.c,v 1.17 2006/05/14 21:55:38 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: siotty.c,v 1.18 2006/07/23 22:06:05 ad Exp $");
#include "opt_ddb.h"
@ -380,7 +380,8 @@ sioopen(dev, flag, mode, l)
tty_attach(tp);
}
else if ((tp->t_state & TS_ISOPEN) && (tp->t_state & TS_XCLUDE)
&& kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
&& kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return EBUSY;
tp->t_oproc = siostart;

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.38 2006/07/19 21:11:42 ad Exp $ */
/* $NetBSD: trap.c,v 1.39 2006/07/23 22:06:05 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -78,7 +78,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.38 2006/07/19 21:11:42 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.39 2006/07/23 22:06:05 ad Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -642,8 +642,8 @@ trap(type, code, v, frame)
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
} else {
ksi.ksi_signo = SIGSEGV;
@ -738,7 +738,7 @@ writeback(fp, docachepush)
pmap_update(pmap_kernel());
} else
printf("WARNING: pid %d(%s) uid %d: CPUSH not done\n",
p->p_pid, p->p_comm, kauth_cred_geteuid(p->p_cred));
p->p_pid, p->p_comm, kauth_cred_geteuid(l->l_cred));
} else if ((f->f_ssw & (SSW4_RW|SSW4_TTMASK)) == SSW4_TTM16) {
/*
* MOVE16 fault.

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_machdep.c,v 1.21 2006/07/22 06:58:17 tsutsui Exp $ */
/* $NetBSD: svr4_machdep.c,v 1.22 2006/07/23 22:06:05 ad Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_machdep.c,v 1.21 2006/07/22 06:58:17 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_machdep.c,v 1.22 2006/07/23 22:06:05 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -289,16 +289,15 @@ svr4_sys_sysarch(struct lwp *l, void *v, register_t *retval)
syscallarg(int) op;
syscallarg(void *) a1;
} */ *uap = v;
struct proc *p = l->l_proc;
char tmp[MAXHOSTNAMELEN];
size_t len;
int error, name[2];
switch (SCARG(uap, op)) {
case SVR4_SYSARCH_SETNAME:
if ((error = kauth_authorize_generic(p->p_cred,
KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0)
return error;
if ((error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0)
return (error);
if ((error = copyinstr(SCARG(uap, a1), tmp, sizeof (tmp), &len))
!= 0)
return error;

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.120 2006/07/19 21:11:42 ad Exp $ */
/* $NetBSD: trap.c,v 1.121 2006/07/23 22:06:05 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.120 2006/07/19 21:11:42 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.121 2006/07/23 22:06:05 ad Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -678,8 +678,8 @@ copyfault:
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
} else {
ksi.ksi_signo = SIGSEGV;
@ -772,7 +772,7 @@ writeback(struct frame *fp, int docachepush)
pmap_update(pmap_kernel());
} else
printf("WARNING: pid %d(%s) uid %d: CPUSH not done\n",
p->p_pid, p->p_comm, kauth_cred_geteuid(p->p_cred));
p->p_pid, p->p_comm, kauth_cred_geteuid(l->l_cred));
} else if ((f->f_ssw & (SSW4_RW|SSW4_TTMASK)) == SSW4_TTM16) {
/*
* MOVE16 fault.

View File

@ -1,4 +1,4 @@
/* $NetBSD: ofb.c,v 1.49 2006/05/14 21:55:38 elad Exp $ */
/* $NetBSD: ofb.c,v 1.50 2006/07/23 22:06:06 ad Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ofb.c,v 1.49 2006/05/14 21:55:38 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: ofb.c,v 1.50 2006/07/23 22:06:06 ad Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -415,7 +415,7 @@ ofb_mmap(void *v, void *vs, off_t offset, int prot)
struct ofb_softc *sc = vd->cookie;
struct rasops_info *ri;
u_int32_t *ap = sc->sc_addrs;
struct proc *me;
struct lwp *me;
int i;
if (vd->active == NULL) {
@ -433,9 +433,10 @@ ofb_mmap(void *v, void *vs, off_t offset, int prot)
* restrict all other mappings to processes with superuser privileges
* or the kernel itself
*/
me = __curproc();
me = curlwp;
if (me != NULL) {
if (kauth_authorize_generic(me->p_cred, KAUTH_GENERIC_ISSUSER, NULL) != 0) {
if (kauth_authorize_generic(me->l_cred, KAUTH_GENERIC_ISSUSER,
NULL) != 0) {
printf("%s: mmap() rejected.\n", sc->sc_dev.dv_xname);
return -1;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ofcons.c,v 1.17 2006/05/14 21:55:38 elad Exp $ */
/* $NetBSD: ofcons.c,v 1.18 2006/07/23 22:06:06 ad Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ofcons.c,v 1.17 2006/05/14 21:55:38 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: ofcons.c,v 1.18 2006/07/23 22:06:06 ad Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@ -146,7 +146,8 @@ ofcopen(dev_t dev, int flag, int mode, struct lwp *l)
ofcparam(tp, &tp->t_termios);
ttsetwater(tp);
} else if ((tp->t_state&TS_XCLUDE) &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag))
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag))
return EBUSY;
tp->t_state |= TS_CARR_ON;

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu_exec.c,v 1.48 2006/05/14 21:55:38 elad Exp $ */
/* $NetBSD: cpu_exec.c,v 1.49 2006/07/23 22:06:06 ad Exp $ */
/*
* Copyright (c) 1992, 1993
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.48 2006/05/14 21:55:38 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.49 2006/07/23 22:06:06 ad Exp $");
#include "opt_compat_netbsd.h"
#include "opt_compat_ultrix.h"
@ -211,7 +211,7 @@ mips_elf_makecmds (l, epp)
if ((error = vn_rdwr(UIO_READ, epp->ep_vp, (caddr_t)&ph,
sizeof ph, ex->e_phoff + i * sizeof ph,
UIO_SYSSPACE, IO_NODELOCKED,
l->l_proc->p_cred, &resid, NULL))
l->l_cred, &resid, NULL))
!= 0)
return error;

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.204 2006/07/19 21:11:43 ad Exp $ */
/* $NetBSD: trap.c,v 1.205 2006/07/23 22:06:06 ad Exp $ */
/*
* Copyright (c) 1992, 1993
@ -78,7 +78,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.204 2006/07/19 21:11:43 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.205 2006/07/23 22:06:06 ad Exp $");
#include "opt_cputype.h" /* which mips CPU levels do we support? */
#include "opt_ktrace.h"
@ -415,8 +415,8 @@ trap(unsigned status, unsigned cause, unsigned vaddr, unsigned opc,
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : (uid_t) -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : (uid_t) -1);
ksi.ksi_signo = SIGKILL;
ksi.ksi_code = 0;
} else {

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbjcn.c,v 1.12 2006/05/14 21:55:38 elad Exp $ */
/* $NetBSD: sbjcn.c,v 1.13 2006/07/23 22:06:06 ad Exp $ */
/*
* Copyright 2000, 2001
@ -110,7 +110,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sbjcn.c,v 1.12 2006/05/14 21:55:38 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: sbjcn.c,v 1.13 2006/07/23 22:06:06 ad Exp $");
#define SBJCN_DEBUG
@ -490,7 +490,7 @@ sbjcn_shutdown(struct sbjcn_channel *ch)
}
int
sbjcnopen(dev_t dev, int flag, int mode, struct proc *p)
sbjcnopen(dev_t dev, int flag, int mode, struct lwp *l)
{
int unit = SBJCN_UNIT(dev);
int chan = SBJCN_CHAN(dev);
@ -521,7 +521,8 @@ sbjcnopen(dev_t dev, int flag, int mode, struct proc *p)
if (ISSET(tp->t_state, TS_ISOPEN) &&
ISSET(tp->t_state, TS_XCLUDE) &&
kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag) != 0)
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return (EBUSY);
s = spltty();
@ -678,7 +679,7 @@ sbjcntty(dev_t dev)
}
int
sbjcnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
sbjcnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
{
struct sbjcn_softc *sc = sbjcn_cd.cd_devs[SBJCN_UNIT(dev)];
struct sbjcn_channel *ch = &sc->sc_channels[SBJCN_CHAN(dev)];
@ -720,7 +721,8 @@ sbjcnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
break;
case TIOCSFLAGS:
error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag);
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
if (error)
break;
ch->ch_swflags = *(int *)data;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbscn.c,v 1.17 2006/05/14 21:55:38 elad Exp $ */
/* $NetBSD: sbscn.c,v 1.18 2006/07/23 22:06:06 ad Exp $ */
/*
* Copyright 2000, 2001
@ -116,7 +116,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sbscn.c,v 1.17 2006/05/14 21:55:38 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: sbscn.c,v 1.18 2006/07/23 22:06:06 ad Exp $");
#define SBSCN_DEBUG
@ -572,7 +572,8 @@ sbscnopen(dev_t dev, int flag, int mode, struct lwp *l)
if (ISSET(tp->t_state, TS_ISOPEN) &&
ISSET(tp->t_state, TS_XCLUDE) &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return (EBUSY);
s = spltty();
@ -786,7 +787,8 @@ sbscnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
break;
case TIOCSFLAGS:
error = kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag);
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
if (error)
break;
ch->ch_swflags = *(int *)data;

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.84 2006/07/19 21:11:43 ad Exp $ */
/* $NetBSD: trap.c,v 1.85 2006/07/23 22:06:06 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.84 2006/07/19 21:11:43 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.85 2006/07/23 22:06:06 ad Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -738,8 +738,8 @@ trap(type, code, v, frame)
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
} else {
ksi.ksi_signo = SIGSEGV;
@ -848,7 +848,7 @@ writeback(fp, docachepush)
pmap_update(pmap_kernel());
} else
printf("WARNING: pid %d(%s) uid %d: CPUSH not done\n",
p->p_pid, p->p_comm, kauth_cred_geteuid(p->p_cred));
p->p_pid, p->p_comm, kauth_cred_geteuid(l->l_cred));
} else if ((f->f_ssw & (SSW4_RW|SSW4_TTMASK)) == SSW4_TTM16) {
/*
* MOVE16 fault.

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.46 2006/07/19 21:11:44 ad Exp $ */
/* $NetBSD: trap.c,v 1.47 2006/07/23 22:06:06 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.46 2006/07/19 21:11:44 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.47 2006/07/23 22:06:06 ad Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -671,8 +671,8 @@ trap(int type, u_int code, u_int v, struct frame frame)
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
} else {
ksi.ksi_signo = SIGSEGV;
@ -764,7 +764,7 @@ writeback(struct frame *fp, int docachepush)
pmap_update(pmap_kernel());
} else
printf("WARNING: pid %d(%s) uid %d: CPUSH not done\n",
p->p_pid, p->p_comm, kauth_cred_geteuid(p->p_cred));
p->p_pid, p->p_comm, kauth_cred_geteuid(l->l_cred));
} else if ((f->f_ssw & (SSW4_RW|SSW4_TTMASK)) == SSW4_TTM16) {
/*
* MOVE16 fault.

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.60 2006/07/19 21:11:44 ad Exp $ */
/* $NetBSD: trap.c,v 1.61 2006/07/23 22:06:06 ad Exp $ */
/*
* This file was taken from mvme68k/mvme68k/trap.c
@ -84,7 +84,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.60 2006/07/19 21:11:44 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.61 2006/07/23 22:06:06 ad Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -730,8 +730,8 @@ trap(int type, unsigned code, unsigned v, struct frame frame)
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
} else {
ksi.ksi_signo = SIGSEGV;
@ -823,7 +823,7 @@ writeback(struct frame *fp, int docachepush)
pmap_update(pmap_kernel());
} else
printf("WARNING: pid %d(%s) uid %d: CPUSH not done\n",
p->p_pid, p->p_comm, kauth_cred_geteuid(p->p_cred));
p->p_pid, p->p_comm, kauth_cred_geteuid(l->l_cred));
} else if ((f->f_ssw & (SSW4_RW|SSW4_TTMASK)) == SSW4_TTM16) {
/*
* MOVE16 fault.

View File

@ -1,4 +1,4 @@
/* $NetBSD: lpt.c,v 1.45 2006/05/14 21:55:39 elad Exp $ */
/* $NetBSD: lpt.c,v 1.46 2006/07/23 22:06:06 ad Exp $ */
/*
* Copyright (c) 1994 Matthias Pfaller.
@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lpt.c,v 1.45 2006/05/14 21:55:39 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: lpt.c,v 1.46 2006/07/23 22:06:06 ad Exp $");
#include "opt_inet.h"
@ -538,7 +538,7 @@ plipattach(struct lpt_softc *sc, int unit)
static int
plipioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
struct proc *p = curproc; /* XXX ktrace-lwp */
struct lwp *l = curlwp; /* XXX ktrace-lwp */
struct lpt_softc *sc = (struct lpt_softc *)(ifp->if_softc);
volatile struct i8255 *i8255 = sc->sc_i8255;
struct ifaddr *ifa = (struct ifaddr *)data;
@ -612,7 +612,8 @@ plipioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
break;
case SIOCSIFMTU:
if ((error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)))
if ((error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)))
return(error);
if (ifp->if_mtu != ifr->ifr_mtu) {
ifp->if_mtu = ifr->ifr_mtu;

View File

@ -1,4 +1,4 @@
/* $NetBSD: scn.c,v 1.72 2006/05/14 21:55:39 elad Exp $ */
/* $NetBSD: scn.c,v 1.73 2006/07/23 22:06:06 ad Exp $ */
/*
* Copyright (c) 1991, 1992, 1993
@ -85,7 +85,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: scn.c,v 1.72 2006/05/14 21:55:39 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: scn.c,v 1.73 2006/07/23 22:06:06 ad Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -1119,8 +1119,8 @@ scnopen(dev_t dev, int flag, int mode, struct lwp *l)
tp->t_state &= ~TS_CARR_ON;
} else {
if (tp->t_state & TS_XCLUDE &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER,
&l->l_proc->p_acflag) != 0) {
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0) {
splx(s);
return (EBUSY);
} else {
@ -1736,9 +1736,8 @@ scnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
case TIOCSFLAGS:{
int userbits, driverbits = 0;
error = kauth_authorize_generic(l->l_proc->p_cred,
KAUTH_GENERIC_ISSUSER,
&l->l_proc->p_acflag);
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
if (error != 0)
return (EPERM);

View File

@ -1,4 +1,4 @@
/* $NetBSD: mem.c,v 1.40 2006/05/15 20:50:38 yamt Exp $ */
/* $NetBSD: mem.c,v 1.41 2006/07/23 22:06:06 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.40 2006/05/15 20:50:38 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.41 2006/07/23 22:06:06 ad Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@ -196,7 +196,7 @@ mmrw(dev_t dev, struct uio *uio, int flags)
paddr_t
mmmmap(dev_t dev, off_t off, int prot)
{
struct proc *p = curproc; /* XXX */
struct lwp *l = curlwp; /* XXX */
/*
* /dev/mem is the only one that makes sense through this
@ -209,9 +209,8 @@ mmmmap(dev_t dev, off_t off, int prot)
if (minor(dev) != DEV_MEM)
return (-1);
if ((u_int)off > ctob(physmem) &&
kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER,
&p->p_acflag) != 0)
if ((u_int)off > ctob(physmem) && kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag) != 0)
return (-1);
return (ns532_btop((u_int)off));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.79 2006/07/19 21:11:44 ad Exp $ */
/* $NetBSD: trap.c,v 1.80 2006/07/23 22:06:06 ad Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.79 2006/07/19 21:11:44 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.80 2006/07/23 22:06:06 ad Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -435,8 +435,8 @@ trap(struct trapframe frame)
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
sig = SIGKILL;
} else {
sig = SIGSEGV;

View File

@ -1,4 +1,4 @@
/* $NetBSD: dc.c,v 1.85 2006/05/14 21:56:32 elad Exp $ */
/* $NetBSD: dc.c,v 1.86 2006/07/23 22:06:06 ad Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: dc.c,v 1.85 2006/05/14 21:56:32 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: dc.c,v 1.86 2006/07/23 22:06:06 ad Exp $");
/*
* devDC7085.c --
@ -513,7 +513,8 @@ dcopen(dev, flag, mode, l)
(void) dcparam(tp, &tp->t_termios);
ttsetwater(tp);
} else if ((tp->t_state & TS_XCLUDE) &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return (EBUSY);
#ifdef HW_FLOW_CONTROL
(void) dcmctl(dev, DML_DTR | DML_RTS, DMSET);

View File

@ -1,4 +1,4 @@
/* $NetBSD: dtop.c,v 1.72 2006/05/14 21:56:32 elad Exp $ */
/* $NetBSD: dtop.c,v 1.73 2006/07/23 22:06:06 ad Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -90,7 +90,7 @@ SOFTWARE.
********************************************************/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: dtop.c,v 1.72 2006/05/14 21:56:32 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: dtop.c,v 1.73 2006/07/23 22:06:06 ad Exp $");
#include "opt_ddb.h"
#include "rasterconsole.h"
@ -335,8 +335,9 @@ dtopopen(dev, flag, mode, l)
}
(void) dtopparam(tp, &tp->t_termios);
ttsetwater(tp);
} else if ((tp->t_state & TS_XCLUDE)
&& kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
} else if ((tp->t_state & TS_XCLUDE) &&
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return (EBUSY);
s = spltty();
while (!(flag & O_NONBLOCK) && !(tp->t_cflag & CLOCAL) &&

View File

@ -1,4 +1,4 @@
/* $NetBSD: rcons.c,v 1.64 2006/05/14 21:56:32 elad Exp $ */
/* $NetBSD: rcons.c,v 1.65 2006/07/23 22:06:06 ad Exp $ */
/*
* Copyright (c) 1995
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rcons.c,v 1.64 2006/05/14 21:56:32 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: rcons.c,v 1.65 2006/07/23 22:06:06 ad Exp $");
#include "rasterconsole.h"
#if NRASTERCONSOLE > 0
@ -337,7 +337,8 @@ rconsopen(dev, flag, mode, l)
(void)(*tp->t_param)(tp, &tp->t_termios);
ttsetwater(tp);
} else if (tp->t_state & TS_XCLUDE &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return (EBUSY);
status = (*tp->t_linesw->l_open)(dev, tp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: scc.c,v 1.93 2006/05/14 21:56:32 elad Exp $ */
/* $NetBSD: scc.c,v 1.94 2006/07/23 22:06:06 ad Exp $ */
/*
* Copyright (c) 1991,1990,1989,1994,1995,1996 Carnegie Mellon University
@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: scc.c,v 1.93 2006/05/14 21:56:32 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: scc.c,v 1.94 2006/07/23 22:06:06 ad Exp $");
/*
* Intel 82530 dual usart chip driver. Supports the serial port(s) on the
@ -660,7 +660,8 @@ sccopen(dev, flag, mode, l)
ttsetwater(tp);
}
else if ((tp->t_state & TS_XCLUDE) &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0) {
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0) {
error = EBUSY;
splx(s);
goto bad;

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.35 2006/07/19 21:11:45 ad Exp $ */
/* $NetBSD: trap.c,v 1.36 2006/07/23 22:06:06 ad Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.35 2006/07/19 21:11:45 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.36 2006/07/23 22:06:06 ad Exp $");
#include "opt_altivec.h"
#include "opt_ddb.h"
@ -253,8 +253,8 @@ trap(struct trapframe *frame)
printf("UVM: pid %d (%s) lid %d, uid %d killed: "
"out of swap\n",
p->p_pid, p->p_comm, l->l_lid,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
}
trapsignal(l, &ksi);

View File

@ -1,4 +1,4 @@
/* $NetBSD: mem.c,v 1.22 2006/05/14 21:56:33 elad Exp $ */
/* $NetBSD: mem.c,v 1.23 2006/07/23 22:06:06 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.22 2006/05/14 21:56:33 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.23 2006/07/23 22:06:06 ad Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@ -162,13 +162,13 @@ mmrw(dev_t dev, struct uio *uio, int flags)
paddr_t
mmmmap(dev_t dev, off_t off, int prot)
{
struct proc *p = curproc;
struct lwp *l = curlwp;
if (minor(dev) != DEV_MEM)
return (-1);
if (atop(off) >= physmem &&
kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag) != 0)
if (atop(off) >= physmem && kauth_authorize_generic(l-l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag) != 0)
return (-1);
return (trunc_page((paddr_t)off));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.113 2006/07/19 21:11:45 ad Exp $ */
/* $NetBSD: trap.c,v 1.114 2006/07/23 22:06:06 ad Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.113 2006/07/19 21:11:45 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.114 2006/07/23 22:06:06 ad Exp $");
#include "opt_altivec.h"
#include "opt_ddb.h"
@ -280,8 +280,8 @@ trap(struct trapframe *frame)
printf("UVM: pid %d.%d (%s), uid %d killed: "
"out of swap\n",
p->p_pid, l->l_lid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
}
(*p->p_emul->e_trapsignal)(l, &ksi);

View File

@ -1,4 +1,4 @@
/* $NetBSD: sci.c,v 1.42 2006/05/14 21:56:33 elad Exp $ */
/* $NetBSD: sci.c,v 1.43 2006/07/23 22:06:06 ad Exp $ */
/*-
* Copyright (C) 1999 T.Horiuchi and SAITOH Masanobu. All rights reserved.
@ -100,7 +100,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sci.c,v 1.42 2006/05/14 21:56:33 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: sci.c,v 1.43 2006/07/23 22:06:06 ad Exp $");
#include "opt_kgdb.h"
#include "opt_sci.h"
@ -667,7 +667,8 @@ sciopen(dev_t dev, int flag, int mode, struct lwp *l)
if (ISSET(tp->t_state, TS_ISOPEN) &&
ISSET(tp->t_state, TS_XCLUDE) &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag) != 0)
return (EBUSY);
s = spltty();
@ -843,7 +844,8 @@ sciioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
break;
case TIOCSFLAGS:
error = kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag);
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
if (error)
break;
sc->sc_swflags = *(int *)data;

View File

@ -1,4 +1,4 @@
/* $NetBSD: scif.c,v 1.46 2006/05/14 21:56:33 elad Exp $ */
/* $NetBSD: scif.c,v 1.47 2006/07/23 22:06:06 ad Exp $ */
/*-
* Copyright (C) 1999 T.Horiuchi and SAITOH Masanobu. All rights reserved.
@ -100,7 +100,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: scif.c,v 1.46 2006/05/14 21:56:33 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: scif.c,v 1.47 2006/07/23 22:06:06 ad Exp $");
#include "opt_kgdb.h"
#include "opt_scif.h"
@ -765,7 +765,8 @@ scifopen(dev_t dev, int flag, int mode, struct lwp *l)
if (ISSET(tp->t_state, TS_ISOPEN) &&
ISSET(tp->t_state, TS_XCLUDE) &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag) != 0)
return (EBUSY);
s = spltty();
@ -941,7 +942,8 @@ scifioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
break;
case TIOCSFLAGS:
error = kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag);
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
if (error)
break;
sc->sc_swflags = *(int *)data;

View File

@ -1,4 +1,4 @@
/* $NetBSD: coff_exec.c,v 1.24 2006/05/14 21:56:33 elad Exp $ */
/* $NetBSD: coff_exec.c,v 1.25 2006/07/23 22:06:07 ad Exp $ */
/*
* Copyright (c) 1994, 1995 Scott Bartram
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: coff_exec.c,v 1.24 2006/05/14 21:56:33 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: coff_exec.c,v 1.25 2006/07/23 22:06:07 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -197,7 +197,7 @@ coff_find_section(struct lwp *l, struct vnode *vp, struct coff_filehdr *fp,
for (i = 0; i < fp->f_nscns; i++, pos += sizeof(struct coff_scnhdr)) {
siz = sizeof(struct coff_scnhdr);
error = vn_rdwr(UIO_READ, vp, (caddr_t) sh,
siz, pos, UIO_SYSSPACE, IO_NODELOCKED, l->l_proc->p_cred,
siz, pos, UIO_SYSSPACE, IO_NODELOCKED, l->l_cred,
&resid, NULL);
if (error) {
DPRINTF(("section hdr %d read error %d\n", i, error));
@ -334,7 +334,7 @@ exec_coff_prep_zmagic(struct lwp *l, struct exec_package *epp,
error = vn_rdwr(UIO_READ, epp->ep_vp, (caddr_t) buf,
len, sh.s_scnptr,
UIO_SYSSPACE, IO_NODELOCKED, l->l_proc->p_cred,
UIO_SYSSPACE, IO_NODELOCKED, l->l_cred,
&resid, NULL);
if (error) {
DPRINTF(("shlib section read error %d\n", error));
@ -397,7 +397,7 @@ coff_load_shlib(struct lwp *l, char *path, struct exec_package *epp)
siz = sizeof(struct coff_filehdr);
error = vn_rdwr(UIO_READ, nd.ni_vp, (caddr_t) fhp, siz, 0,
UIO_SYSSPACE, IO_NODELOCKED, l->l_proc->p_cred, &resid, NULL);
UIO_SYSSPACE, IO_NODELOCKED, l->l_cred, &resid, NULL);
if (error) {
DPRINTF(("filehdr read error %d\n", error));
vrele(nd.ni_vp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: mem.c,v 1.20 2006/05/14 21:56:33 elad Exp $ */
/* $NetBSD: mem.c,v 1.21 2006/07/23 22:06:07 ad Exp $ */
/*
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.20 2006/05/14 21:56:33 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.21 2006/07/23 22:06:07 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -188,13 +188,13 @@ mmrw(dev_t dev, struct uio *uio, int flags)
paddr_t
mmmmap(dev_t dev, off_t off, int prot)
{
struct proc *p = curproc;
struct lwp *l = curlwp;
if (minor(dev) != DEV_MEM)
return (-1);
if (!__mm_mem_addr(off) &&
kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag) != 0)
if (!__mm_mem_addr(off) && kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag) != 0)
return (-1);
return (sh3_btop((paddr_t)off));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: scif.c,v 1.19 2006/05/14 21:56:33 elad Exp $ */
/* $NetBSD: scif.c,v 1.20 2006/07/23 22:06:07 ad Exp $ */
/*-
* Copyright (C) 1999 T.Horiuchi and SAITOH Masanobu. All rights reserved.
@ -106,7 +106,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: scif.c,v 1.19 2006/05/14 21:56:33 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: scif.c,v 1.20 2006/07/23 22:06:07 ad Exp $");
#include "opt_kgdb.h"
@ -781,7 +781,7 @@ scifopen(dev_t dev, int flag, int mode, struct lwp *l)
if (ISSET(tp->t_state, TS_ISOPEN) &&
ISSET(tp->t_state, TS_XCLUDE) &&
kauth_cred_geteuid(l->l_proc->p_cred) != 0)
kauth_cred_geteuid(l->l_cred) != 0)
return (EBUSY);
s = spltty();
@ -958,9 +958,8 @@ scifioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
break;
case TIOCSFLAGS:
error = kauth_authorize_generic(l->l_proc->p_cred,
KAUTH_GENERIC_ISSUSER,
&l->l_proc->p_acflag);
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
if (error)
break;
sc->sc_swflags = *(int *)data;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mem.c,v 1.11 2006/05/14 21:56:33 elad Exp $ */
/* $NetBSD: mem.c,v 1.12 2006/07/23 22:06:07 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -74,7 +74,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.11 2006/05/14 21:56:33 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.12 2006/07/23 22:06:07 ad Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@ -200,7 +200,7 @@ mmmmap(dev, off, prot)
off_t off;
int prot;
{
struct proc *p = curlwp->l_proc; /* XXX */
struct lwp *l = curlwp; /* XXX */
/*
* /dev/mem is the only one that makes sense through this
@ -215,8 +215,8 @@ mmmmap(dev, off, prot)
/* minor device 0 is physical memory */
if (off >= ctob(physmem) &&
kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag) != 0)
if (off >= ctob(physmem) && kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag) != 0)
return -1;
return sh5_btop(off);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.40 2006/07/19 21:11:45 ad Exp $ */
/* $NetBSD: trap.c,v 1.41 2006/07/23 22:06:07 ad Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
@ -111,7 +111,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.40 2006/07/19 21:11:45 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.41 2006/07/23 22:06:07 ad Exp $");
#include "opt_ddb.h"
@ -355,8 +355,8 @@ trap(struct lwp *l, struct trapframe *tf)
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
} else
if (rv == EACCES)

View File

@ -1,4 +1,4 @@
/* $NetBSD: pccons.c,v 1.25 2006/05/14 21:56:33 elad Exp $ */
/* $NetBSD: pccons.c,v 1.26 2006/07/23 22:06:07 ad Exp $ */
/*
* Copyright 1997
@ -135,7 +135,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pccons.c,v 1.25 2006/05/14 21:56:33 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: pccons.c,v 1.26 2006/07/23 22:06:07 ad Exp $");
#include "opt_ddb.h"
#include "opt_xserver.h"
@ -1209,7 +1209,8 @@ pcopen(dev_t dev,
ttsetwater(tp);
}
else if ( tp->t_state & TS_XCLUDE &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0 )
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0 )
{
/*
** Don't allow the open if the tty has been set up

View File

@ -1,4 +1,4 @@
/* $NetBSD: kd.c,v 1.39 2006/05/14 21:56:33 elad Exp $ */
/* $NetBSD: kd.c,v 1.40 2006/07/23 22:06:07 ad Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.39 2006/05/14 21:56:33 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.40 2006/07/23 22:06:07 ad Exp $");
#include "opt_kgdb.h"
#include "fb.h"
@ -211,7 +211,8 @@ static int firstopen = 1;
/* It's simpler to do this up here. */
if (((tp->t_state & (TS_ISOPEN | TS_XCLUDE))
== (TS_ISOPEN | TS_XCLUDE))
&& (kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0) )
&& (kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0) )
{
return (EBUSY);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: tctrl.c,v 1.34 2006/05/14 21:56:33 elad Exp $ */
/* $NetBSD: tctrl.c,v 1.35 2006/07/23 22:06:07 ad Exp $ */
/*-
* Copyright (c) 1998, 2005, 2006 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tctrl.c,v 1.34 2006/05/14 21:56:33 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: tctrl.c,v 1.35 2006/07/23 22:06:07 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -1174,8 +1174,8 @@ tctrlioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct lwp *l)
/* this ioctl assumes the caller knows exactly what he is doing */
case TCTRL_CMD_REQ:
reqn = (struct tctrl_req *)data;
if ((i = kauth_authorize_generic(l->l_proc->p_cred,
KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag)) != 0 &&
if ((i = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0 &&
(reqn->cmdbuf[0] == TS102_OP_CTL_BITPORT ||
(reqn->cmdbuf[0] >= TS102_OP_CTL_WATCHDOG &&
reqn->cmdbuf[0] <= TS102_OP_CTL_SECURITY_KEY) ||

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.169 2006/07/19 21:11:46 ad Exp $ */
/* $NetBSD: trap.c,v 1.170 2006/07/23 22:06:07 ad Exp $ */
/*
* Copyright (c) 1996
@ -49,7 +49,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.169 2006/07/19 21:11:46 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.170 2006/07/23 22:06:07 ad Exp $");
#include "opt_ddb.h"
#include "opt_compat_svr4.h"
@ -955,8 +955,8 @@ kfault:
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
ksi.ksi_code = SI_NOINFO;
} else {
@ -1242,8 +1242,8 @@ kfault:
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
ksi.ksi_code = SI_NOINFO;
} else {

View File

@ -1,4 +1,4 @@
/* $NetBSD: kd.c,v 1.38 2006/05/14 21:56:33 elad Exp $ */
/* $NetBSD: kd.c,v 1.39 2006/07/23 22:06:07 ad Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.38 2006/05/14 21:56:33 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.39 2006/07/23 22:06:07 ad Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@ -180,7 +180,8 @@ static int firstopen = 1;
/* It's simpler to do this up here. */
if (((tp->t_state & (TS_ISOPEN | TS_XCLUDE))
== (TS_ISOPEN | TS_XCLUDE))
&& (kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag) != 0) )
&& (kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0) )
{
return (EBUSY);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcons.c,v 1.21 2006/05/14 21:56:33 elad Exp $ */
/* $NetBSD: pcons.c,v 1.22 2006/07/23 22:06:07 ad Exp $ */
/*-
* Copyright (c) 2000 Eduardo E. Horvath
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pcons.c,v 1.21 2006/05/14 21:56:33 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: pcons.c,v 1.22 2006/07/23 22:06:07 ad Exp $");
#include "opt_ddb.h"
@ -148,7 +148,8 @@ pconsopen(dev_t dev, int flag, int mode, struct lwp *l)
pconsparam(tp, &tp->t_termios);
ttsetwater(tp);
} else if ((tp->t_state&TS_XCLUDE) &&
kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag))
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag))
return EBUSY;
tp->t_state |= TS_CARR_ON;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sab.c,v 1.29 2006/05/22 00:09:08 christos Exp $ */
/* $NetBSD: sab.c,v 1.30 2006/07/23 22:06:07 ad Exp $ */
/* $OpenBSD: sab.c,v 1.7 2002/04/08 17:49:42 jason Exp $ */
/*
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sab.c,v 1.29 2006/05/22 00:09:08 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: sab.c,v 1.30 2006/07/23 22:06:07 ad Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -685,7 +685,8 @@ sabopen(dev_t dev, int flags, int mode, struct lwp *l)
else
tp->t_state &= ~TS_CARR_ON;
} else if ((tp->t_state & TS_XCLUDE) &&
(!kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag))) {
(!kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag))) {
return (EBUSY);
} else {
s = spltty();
@ -833,7 +834,8 @@ sabioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct lwp *l)
*((int *)data) = sc->sc_openflags;
break;
case TIOCSFLAGS:
if (kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag))
if (kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag))
error = EPERM;
else
sc->sc_openflags = *((int *)data) &

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.132 2006/07/19 21:11:46 ad Exp $ */
/* $NetBSD: trap.c,v 1.133 2006/07/23 22:06:07 ad Exp $ */
/*
* Copyright (c) 1996-2002 Eduardo Horvath. All rights reserved.
@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.132 2006/07/19 21:11:46 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.133 2006/07/23 22:06:07 ad Exp $");
#define NEW_FPSTATE
@ -1214,8 +1214,8 @@ kfault:
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
ksi.ksi_code = SI_NOINFO;
} else {

View File

@ -1,4 +1,4 @@
/* $NetBSD: kd.c,v 1.12 2006/05/14 21:57:13 elad Exp $ */
/* $NetBSD: kd.c,v 1.13 2006/07/23 22:06:07 ad Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.12 2006/05/14 21:57:13 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.13 2006/07/23 22:06:07 ad Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@ -223,7 +223,8 @@ static int firstopen = 1;
/* It's simpler to do this up here. */
if (((tp->t_state & (TS_ISOPEN | TS_XCLUDE))
== (TS_ISOPEN | TS_XCLUDE))
&& (kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0) )
&& (kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0) )
{
return (EBUSY);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcons.c,v 1.10 2006/05/14 21:57:13 elad Exp $ */
/* $NetBSD: pcons.c,v 1.11 2006/07/23 22:06:07 ad Exp $ */
/*-
* Copyright (c) 2000 Eduardo E. Horvath
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pcons.c,v 1.10 2006/05/14 21:57:13 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: pcons.c,v 1.11 2006/07/23 22:06:07 ad Exp $");
#include "opt_ddb.h"
@ -144,7 +144,8 @@ pconsopen(dev_t dev, int flag, int mode, struct lwp *l)
pconsparam(tp, &tp->t_termios);
ttsetwater(tp);
} else if ((tp->t_state&TS_XCLUDE) &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag))
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag))
return EBUSY;
tp->t_state |= TS_CARR_ON;

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.26 2006/07/19 21:11:47 ad Exp $ */
/* $NetBSD: trap.c,v 1.27 2006/07/23 22:06:07 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -78,7 +78,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.26 2006/07/19 21:11:47 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.27 2006/07/23 22:06:07 ad Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -592,8 +592,8 @@ trap(int type, u_int code, u_int v, struct trapframe tf)
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
} else {
ksi.ksi_signo = SIGSEGV;

View File

@ -1,4 +1,4 @@
/* $NetBSD: kd.c,v 1.45 2006/05/14 21:57:13 elad Exp $ */
/* $NetBSD: kd.c,v 1.46 2006/07/23 22:06:07 ad Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.45 2006/05/14 21:57:13 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.46 2006/07/23 22:06:07 ad Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@ -156,7 +156,8 @@ static int firstopen = 1;
/* It's simpler to do this up here. */
if (((tp->t_state & (TS_ISOPEN | TS_XCLUDE))
== (TS_ISOPEN | TS_XCLUDE))
&& (kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0) )
&& (kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0) )
{
return (EBUSY);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: xd.c,v 1.53 2006/05/14 21:57:13 elad Exp $ */
/* $NetBSD: xd.c,v 1.54 2006/07/23 22:06:07 ad Exp $ */
/*
*
@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.53 2006/05/14 21:57:13 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.54 2006/07/23 22:06:07 ad Exp $");
#undef XDC_DEBUG /* full debug */
#define XDC_DIAG /* extra sanity checks */
@ -874,9 +874,8 @@ xdioctl(dev_t dev, u_long command, caddr_t addr, int flag, struct lwp *l)
case DIOSXDCMD:
xio = (struct xd_iocmd *) addr;
if ((error = kauth_authorize_generic(l->l_proc->p_cred,
KAUTH_GENERIC_ISSUSER,
&l->l_proc->p_acflag)) != 0)
if ((error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0)
return (error);
return (xdc_ioctlcmd(xd, dev, xio));

View File

@ -1,4 +1,4 @@
/* $NetBSD: xy.c,v 1.56 2006/05/14 21:57:13 elad Exp $ */
/* $NetBSD: xy.c,v 1.57 2006/07/23 22:06:07 ad Exp $ */
/*
*
@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.56 2006/05/14 21:57:13 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.57 2006/07/23 22:06:07 ad Exp $");
#undef XYC_DEBUG /* full debug */
#undef XYC_DIAG /* extra sanity checks */
@ -827,9 +827,8 @@ xyioctl(dev_t dev, u_long command, caddr_t addr, int flag, struct lwp *l)
case DIOSXDCMD:
xio = (struct xd_iocmd *) addr;
if ((error = kauth_authorize_generic(l->l_proc->p_cred,
KAUTH_GENERIC_ISSUSER,
&l->l_proc->p_acflag)) != 0)
if ((error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0)
return (error);
return (xyc_ioctlcmd(xy, dev, xio));

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.125 2006/07/19 21:11:47 ad Exp $ */
/* $NetBSD: trap.c,v 1.126 2006/07/23 22:06:07 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -78,7 +78,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.125 2006/07/19 21:11:47 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.126 2006/07/23 22:06:07 ad Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -607,8 +607,8 @@ trap(int type, u_int code, u_int v, struct trapframe tf)
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
} else {
ksi.ksi_signo = SIGSEGV;

View File

@ -1,4 +1,4 @@
/* $NetBSD: gencons.c,v 1.43 2006/05/14 21:57:13 elad Exp $ */
/* $NetBSD: gencons.c,v 1.44 2006/07/23 22:06:07 ad Exp $ */
/*
* Copyright (c) 1994 Gordon W. Ross
@ -36,7 +36,7 @@
/* All bugs are subject to removal without further notice */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: gencons.c,v 1.43 2006/05/14 21:57:13 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: gencons.c,v 1.44 2006/07/23 22:06:07 ad Exp $");
#include "opt_ddb.h"
#include "opt_cputype.h"
@ -98,7 +98,6 @@ gencnopen(dev_t dev, int flag, int mode, struct lwp *l)
{
int unit;
struct tty *tp;
struct proc *p = l->l_proc;
unit = minor(dev);
if (unit >= maxttys)
@ -124,7 +123,8 @@ gencnopen(dev_t dev, int flag, int mode, struct lwp *l)
gencnparam(tp, &tp->t_termios);
ttsetwater(tp);
} else if (tp->t_state & TS_XCLUDE &&
kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag) != 0)
kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag) != 0)
return EBUSY;
tp->t_state |= TS_CARR_ON;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mem.c,v 1.31 2006/05/14 21:57:13 elad Exp $ */
/* $NetBSD: mem.c,v 1.32 2006/07/23 22:06:08 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.31 2006/05/14 21:57:13 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.32 2006/07/23 22:06:08 ad Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@ -187,7 +187,7 @@ mmrw(dev_t dev, struct uio *uio, int flags)
paddr_t
mmmmap(dev_t dev, off_t off, int prot)
{
struct proc *p = curproc; /* XXX */
struct lwp *l = curlwp; /* XXX */
/*
* /dev/mem is the only one that makes sense through this
@ -200,8 +200,8 @@ mmmmap(dev_t dev, off_t off, int prot)
if (minor(dev) != DEV_MEM)
return (-1);
if ((u_int)off > ctob(physmem) &&
kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag) != 0)
if ((u_int)off > ctob(physmem) && kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag) != 0)
return (-1);
return (btop((u_int)off));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.104 2006/07/19 21:11:47 ad Exp $ */
/* $NetBSD: trap.c,v 1.105 2006/07/23 22:06:08 ad Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@ -33,7 +33,7 @@
/* All bugs are subject to removal without further notice */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.104 2006/07/19 21:11:47 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.105 2006/07/23 22:06:08 ad Exp $");
#include "opt_ddb.h"
#include "opt_ktrace.h"
@ -237,8 +237,8 @@ if(faultdebug)printf("trap accflt type %lx, code %lx, pc %lx, psl %lx\n",
printf("UVM: pid %d (%s), uid %d killed: "
"out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
sig = SIGKILL;
} else {
sig = SIGSEGV;

View File

@ -1,4 +1,4 @@
/* $NetBSD: com.c,v 1.39 2006/05/14 21:57:13 elad Exp $ */
/* $NetBSD: com.c,v 1.40 2006/07/23 22:06:08 ad Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.39 2006/05/14 21:57:13 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.40 2006/07/23 22:06:08 ad Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -415,7 +415,8 @@ comopen(dev_t dev, int flag, int mode, struct lwp *l)
if ((tp->t_state & TS_ISOPEN) &&
(tp->t_state & TS_XCLUDE) &&
kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return (EBUSY);
s = spltty();
@ -683,7 +684,8 @@ comioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
case TIOCSFLAGS: {
int userbits, driverbits = 0;
error = kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag);
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
if (error != 0)
return(EPERM);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ite.c,v 1.45 2006/05/14 21:57:13 elad Exp $ */
/* $NetBSD: ite.c,v 1.46 2006/07/23 22:06:08 ad Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
@ -83,7 +83,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.45 2006/05/14 21:57:13 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.46 2006/07/23 22:06:08 ad Exp $");
#include "ite.h"
#if NITE > 0
@ -394,7 +394,8 @@ iteopen(dev_t dev, int mode, int devtype, struct lwp *l)
} else
tp = ite_tty[unit];
if ((tp->t_state&(TS_ISOPEN|TS_XCLUDE)) == (TS_ISOPEN|TS_XCLUDE)
&& kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
&& kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag) != 0)
return (EBUSY);
if ((ip->flags & ITE_ACTIVE) == 0) {
error = iteon(dev, 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.81 2006/07/19 21:11:47 ad Exp $ */
/* $NetBSD: trap.c,v 1.82 2006/07/23 22:06:08 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.81 2006/07/19 21:11:47 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.82 2006/07/23 22:06:08 ad Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -760,8 +760,8 @@ trap(int type, unsigned code, unsigned v, struct frame frame)
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
ksi.ksi_signo = SIGKILL;
} else {
ksi.ksi_signo = SIGSEGV;
@ -854,7 +854,7 @@ writeback(struct frame *fp, int docachepush)
pmap_update(pmap_kernel());
} else
printf("WARNING: pid %d(%s) uid %d: CPUSH not done\n",
p->p_pid, p->p_comm, kauth_cred_geteuid(p->p_cred));
p->p_pid, p->p_comm, kauth_cred_geteuid(l->l_cred));
} else if ((f->f_ssw & (SSW4_RW|SSW4_TTMASK)) == SSW4_TTM16) {
/*
* MOVE16 fault.

View File

@ -1,4 +1,4 @@
/* $NetBSD: sys_machdep.c,v 1.6 2006/05/14 21:57:13 elad Exp $ */
/* $NetBSD: sys_machdep.c,v 1.7 2006/07/23 22:06:08 ad Exp $ */
/* NetBSD: sys_machdep.c,v 1.70 2003/10/27 14:11:47 junyoung Exp */
/*-
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.6 2006/05/14 21:57:13 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.7 2006/07/23 22:06:08 ad Exp $");
#include "opt_compat_netbsd.h"
#include "opt_mtrr.h"
@ -353,7 +353,6 @@ i386_iopl(l, args, retval)
register_t *retval;
{
int error;
struct proc *p = l->l_proc;
struct pcb *pcb = &l->l_addr->u_pcb;
struct i386_iopl_args ua;
@ -363,7 +362,8 @@ i386_iopl(l, args, retval)
if (securelevel > 1)
return EPERM;
if ((error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0)
if ((error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0)
return error;
if ((error = copyin(args, &ua, sizeof(ua))) != 0)
@ -419,14 +419,14 @@ i386_set_ioperm(l, args, retval)
register_t *retval;
{
int error;
struct proc *p = l->l_proc;
struct pcb *pcb = &l->l_addr->u_pcb;
struct i386_set_ioperm_args ua;
if (securelevel > 1)
return EPERM;
if ((error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0)
if ((error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0)
return error;
if ((error = copyin(args, &ua, sizeof(ua))) != 0)
@ -441,7 +441,6 @@ i386_get_mtrr(struct lwp *l, void *args, register_t *retval)
{
struct i386_get_mtrr_args ua;
int error, n;
struct proc *p = l->l_proc;
if (mtrr_funcs == NULL)
return ENOSYS;
@ -454,7 +453,7 @@ i386_get_mtrr(struct lwp *l, void *args, register_t *retval)
if (error != 0)
return error;
error = mtrr_get(ua.mtrrp, &n, p, MTRR_GETSET_USER);
error = mtrr_get(ua.mtrrp, &n, l->l_proc, MTRR_GETSET_USER);
copyout(&n, ua.n, sizeof (int));
@ -466,12 +465,12 @@ i386_set_mtrr(struct lwp *l, void *args, register_t *retval)
{
int error, n;
struct i386_set_mtrr_args ua;
struct proc *p = l->l_proc;
if (mtrr_funcs == NULL)
return ENOSYS;
error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag);
error = kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
&l->l_acflag);
if (error != 0)
return error;
@ -483,7 +482,7 @@ i386_set_mtrr(struct lwp *l, void *args, register_t *retval)
if (error != 0)
return error;
error = mtrr_set(ua.mtrrp, &n, p, MTRR_GETSET_USER);
error = mtrr_set(ua.mtrrp, &n, l->l_proc, MTRR_GETSET_USER);
if (n != 0)
mtrr_commit();

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.12 2006/07/19 21:11:48 ad Exp $ */
/* $NetBSD: trap.c,v 1.13 2006/07/23 22:06:08 ad Exp $ */
/* NetBSD: trap.c,v 1.200 2004/03/14 01:08:48 cl Exp */
/*-
@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.12 2006/07/19 21:11:48 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.13 2006/07/23 22:06:08 ad Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -651,8 +651,8 @@ copyfault:
ksi.ksi_signo = SIGKILL;
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
p->p_pid, p->p_comm,
p->p_cred ?
kauth_cred_geteuid(p->p_cred) : -1);
l->l_cred ?
kauth_cred_geteuid(l->l_cred) : -1);
} else {
ksi.ksi_signo = SIGSEGV;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: xencons.c,v 1.17 2006/05/14 21:57:13 elad Exp $ */
/* $NetBSD: xencons.c,v 1.18 2006/07/23 22:06:08 ad Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@ -63,7 +63,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xencons.c,v 1.17 2006/05/14 21:57:13 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: xencons.c,v 1.18 2006/07/23 22:06:08 ad Exp $");
#include "opt_xen.h"
@ -261,8 +261,8 @@ xencons_open(dev_t dev, int flag, int mode, struct lwp *l)
xencons_param(tp, &tp->t_termios);
ttsetwater(tp);
} else if (tp->t_state&TS_XCLUDE &&
kauth_authorize_generic(l->l_proc->p_cred,
KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) != 0)
kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag) != 0)
return (EBUSY);
tp->t_state |= TS_CARR_ON;

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_util.c,v 1.31 2006/05/14 21:24:49 elad Exp $ */
/* $NetBSD: compat_util.c,v 1.32 2006/07/23 22:06:08 ad Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: compat_util.c,v 1.31 2006/05/14 21:24:49 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: compat_util.c,v 1.32 2006/07/23 22:06:08 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -80,7 +80,6 @@ emul_find(l, sgp, prefix, path, pbuf, sflag)
const char **pbuf;
int sflag;
{
struct proc *p;
struct nameidata nd;
struct nameidata ndroot;
struct vattr vat;
@ -90,7 +89,6 @@ emul_find(l, sgp, prefix, path, pbuf, sflag)
const char *pr;
size_t sz, len;
p = l->l_proc;
tbuf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
*pbuf = path;
@ -170,10 +168,10 @@ emul_find(l, sgp, prefix, path, pbuf, sflag)
if ((error = namei(&ndroot)) != 0)
goto bad2;
if ((error = VOP_GETATTR(nd.ni_vp, &vat, p->p_cred, l)) != 0)
if ((error = VOP_GETATTR(nd.ni_vp, &vat, l->l_cred, l)) != 0)
goto bad3;
if ((error = VOP_GETATTR(ndroot.ni_vp, &vatroot, p->p_cred, l))
if ((error = VOP_GETATTR(ndroot.ni_vp, &vatroot, l->l_cred, l))
!= 0)
goto bad3;
@ -195,7 +193,7 @@ good:
*pbuf = tbuf;
else {
sz = &ptr[len] - tbuf;
*pbuf = stackgap_alloc(p, sgp, sz + 1);
*pbuf = stackgap_alloc(l->l_proc, sgp, sz + 1);
if (*pbuf == NULL) {
error = ENAMETOOLONG;
goto bad;

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_info_43.c,v 1.22 2006/05/14 21:24:49 elad Exp $ */
/* $NetBSD: kern_info_43.c,v 1.23 2006/07/23 22:06:08 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1991, 1993
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_info_43.c,v 1.22 2006/05/14 21:24:49 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_info_43.c,v 1.23 2006/07/23 22:06:08 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -286,10 +286,10 @@ compat_43_sys_sethostid(struct lwp *l, void *v, register_t *retval)
struct compat_43_sys_sethostid_args /* {
syscallarg(int32_t) hostid;
} */ *uap = v;
struct proc *p = l->l_proc;
int error;
if ((error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0)
if ((error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0)
return (error);
hostid = SCARG(uap, hostid);
return (0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_resource_43.c,v 1.14 2005/12/11 12:19:56 christos Exp $ */
/* $NetBSD: kern_resource_43.c,v 1.15 2006/07/23 22:06:08 ad Exp $ */
/*-
* Copyright (c) 1982, 1986, 1991, 1993
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_resource_43.c,v 1.14 2005/12/11 12:19:56 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_resource_43.c,v 1.15 2006/07/23 22:06:08 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -82,7 +82,6 @@ compat_43_sys_setrlimit(struct lwp *l, void *v, register_t *retval)
syscallarg(int) which;
syscallarg(const struct orlimit *) rlp;
} */ *uap = v;
struct proc *p = l->l_proc;
int which = SCARG(uap, which);
struct orlimit olim;
struct rlimit lim;
@ -93,5 +92,5 @@ compat_43_sys_setrlimit(struct lwp *l, void *v, register_t *retval)
return (error);
lim.rlim_cur = olim.rlim_cur;
lim.rlim_max = olim.rlim_max;
return (dosetrlimit(p, p->p_cred, which, &lim));
return (dosetrlimit(l, l->l_proc, which, &lim));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_sig_43.c,v 1.22 2006/05/14 21:24:49 elad Exp $ */
/* $NetBSD: kern_sig_43.c,v 1.23 2006/07/23 22:06:08 ad Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_sig_43.c,v 1.22 2006/05/14 21:24:49 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_sig_43.c,v 1.23 2006/07/23 22:06:08 ad Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -265,7 +265,6 @@ compat_43_sys_killpg(struct lwp *l, void *v, register_t *retval)
syscallarg(int) pgid;
syscallarg(int) signum;
} */ *uap = v;
struct proc *p = l->l_proc;
ksiginfo_t ksi;
#ifdef COMPAT_09
@ -277,7 +276,7 @@ compat_43_sys_killpg(struct lwp *l, void *v, register_t *retval)
memset(&ksi, 0, sizeof(ksi));
ksi.ksi_signo = SCARG(uap, signum);
ksi.ksi_code = SI_USER;
ksi.ksi_pid = p->p_pid;
ksi.ksi_uid = kauth_cred_geteuid(p->p_cred);
return (killpg1(p, &ksi, SCARG(uap, pgid), 0));
ksi.ksi_pid = l->l_proc->p_pid;
ksi.ksi_uid = kauth_cred_geteuid(l->l_cred);
return (killpg1(l, &ksi, SCARG(uap, pgid), 0));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_xxx_12.c,v 1.7 2006/05/14 21:24:49 elad Exp $ */
/* $NetBSD: kern_xxx_12.c,v 1.8 2006/07/23 22:06:08 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_xxx_12.c,v 1.7 2006/05/14 21:24:49 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_xxx_12.c,v 1.8 2006/07/23 22:06:08 ad Exp $");
/*#ifdef COMPAT_12*/
@ -53,10 +53,10 @@ compat_12_sys_reboot(struct lwp *l, void *v, register_t *retval)
struct compat_12_sys_reboot_args /* {
syscallarg(int) opt;
} */ *uap = v;
struct proc *p = l->l_proc;
int error;
if ((error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0)
if ((error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0)
return (error);
cpu_reboot(SCARG(uap, opt), NULL);
return (0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: sysv_msg_14.c,v 1.9 2005/11/11 17:10:42 christos Exp $ */
/* $NetBSD: sysv_msg_14.c,v 1.10 2006/07/23 22:06:08 ad Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sysv_msg_14.c,v 1.9 2005/11/11 17:10:42 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: sysv_msg_14.c,v 1.10 2006/07/23 22:06:08 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -110,7 +110,6 @@ compat_14_sys_msgctl(struct lwp *l, void *v, register_t *retval)
syscallarg(int) cmd;
syscallarg(struct msqid_ds14 *) buf;
} */ *uap = v;
struct proc *p = l->l_proc;
struct msqid_ds msqbuf;
struct msqid_ds14 omsqbuf;
int cmd, error;
@ -124,7 +123,7 @@ compat_14_sys_msgctl(struct lwp *l, void *v, register_t *retval)
msqid_ds14_to_native(&omsqbuf, &msqbuf);
}
error = msgctl1(p, SCARG(uap, msqid), cmd,
error = msgctl1(l, SCARG(uap, msqid), cmd,
(cmd == IPC_SET || cmd == IPC_STAT) ? &msqbuf : NULL);
if (error == 0 && cmd == IPC_STAT) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: sysv_sem_14.c,v 1.9 2005/11/10 18:43:32 christos Exp $ */
/* $NetBSD: sysv_sem_14.c,v 1.10 2006/07/23 22:06:08 ad Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sysv_sem_14.c,v 1.9 2005/11/10 18:43:32 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: sysv_sem_14.c,v 1.10 2006/07/23 22:06:08 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -98,7 +98,6 @@ compat_14_sys___semctl(struct lwp *l, void *v, register_t *retval)
syscallarg(int) cmd;
syscallarg(union __semun *) arg;
} */ *uap = v;
struct proc *p = l->l_proc;
union __semun arg;
struct semid_ds sembuf;
struct semid_ds14 osembuf;
@ -132,7 +131,7 @@ compat_14_sys___semctl(struct lwp *l, void *v, register_t *retval)
}
}
error = semctl1(p, SCARG(uap, semid), SCARG(uap, semnum), cmd,
error = semctl1(l, SCARG(uap, semid), SCARG(uap, semnum), cmd,
pass_arg, retval);
if (error == 0 && cmd == IPC_STAT) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: sysv_shm_14.c,v 1.7 2005/11/10 18:39:30 christos Exp $ */
/* $NetBSD: sysv_shm_14.c,v 1.8 2006/07/23 22:06:08 ad Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sysv_shm_14.c,v 1.7 2005/11/10 18:39:30 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: sysv_shm_14.c,v 1.8 2006/07/23 22:06:08 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -105,7 +105,6 @@ compat_14_sys_shmctl(struct lwp *l, void *v, register_t *retval)
syscallarg(int) cmd;
syscallarg(struct shmid_ds14 *) buf;
} */ *uap = v;
struct proc *p = l->l_proc;
struct shmid_ds shmbuf;
struct shmid_ds14 oshmbuf;
int cmd, error;
@ -119,7 +118,7 @@ compat_14_sys_shmctl(struct lwp *l, void *v, register_t *retval)
shmid_ds14_to_native(&oshmbuf, &shmbuf);
}
error = shmctl1(p, SCARG(uap, shmid), cmd,
error = shmctl1(l, SCARG(uap, shmid), cmd,
(cmd == IPC_SET || cmd == IPC_STAT) ? &shmbuf : NULL);
if (error == 0 && cmd == IPC_STAT) {

Some files were not shown because too many files have changed in this diff Show More