CVS commit: src/sys
Module Name:src Committed By: elad Date: Sat Oct 3 03:59:39 UTC 2009 Modified Files: src/sys/kern: uipc_socket.c src/sys/secmodel/suser: secmodel_suser.c Log Message: Move KAUTH_NETWORK_BIND::KAUTH_REQ_NETWORK_BIND_PORT policy back to the subsystem (or close to it). Note: Revisit KAUTH_REQ_NETWORK_BIND_PRIVPORT. To generate a diff of this commit: cvs rdiff -u -r1.192 -r1.193 src/sys/kern/uipc_socket.c cvs rdiff -u -r1.25 -r1.26 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/uipc_socket.c diff -u src/sys/kern/uipc_socket.c:1.192 src/sys/kern/uipc_socket.c:1.193 --- src/sys/kern/uipc_socket.c:1.192 Sat Oct 3 01:41:39 2009 +++ src/sys/kern/uipc_socket.c Sat Oct 3 03:59:39 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_socket.c,v 1.192 2009/10/03 01:41:39 elad Exp $ */ +/* $NetBSD: uipc_socket.c,v 1.193 2009/10/03 03:59:39 elad Exp $ */ /*- * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.192 2009/10/03 01:41:39 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.193 2009/10/03 03:59:39 elad Exp $"); #include "opt_compat_netbsd.h" #include "opt_sock_counters.h" @@ -440,10 +440,15 @@ result = KAUTH_RESULT_DEFER; req = (enum kauth_network_req)arg0; - if (action != KAUTH_NETWORK_SOCKET) + if ((action != KAUTH_NETWORK_SOCKET) && + (action != KAUTH_NETWORK_BIND)) return result; switch (req) { + case KAUTH_REQ_NETWORK_BIND_PORT: + result = KAUTH_RESULT_ALLOW; + break; + case KAUTH_REQ_NETWORK_SOCKET_DROP: { /* Normal users can only drop their own connections. */ struct socket *so = (struct socket *)arg1; Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.25 src/sys/secmodel/suser/secmodel_suser.c:1.26 --- src/sys/secmodel/suser/secmodel_suser.c:1.25 Sat Oct 3 03:38:31 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Sat Oct 3 03:59:39 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.25 2009/10/03 03:38:31 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.26 2009/10/03 03:59:39 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.25 2009/10/03 03:38:31 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.26 2009/10/03 03:59:39 elad Exp $"); #include #include @@ -611,10 +611,6 @@ case KAUTH_NETWORK_BIND: switch (req) { - case KAUTH_REQ_NETWORK_BIND_PORT: - result = KAUTH_RESULT_ALLOW; - break; - case KAUTH_REQ_NETWORK_BIND_PRIVPORT: if (isroot) result = KAUTH_RESULT_ALLOW;
CVS commit: src/sys
Module Name:src Committed By: elad Date: Sat Oct 3 03:38:31 UTC 2009 Modified Files: src/sys/kern: kern_proc.c src/sys/secmodel/suser: secmodel_suser.c Log Message: Move policies for KAUTH_PROCESS_{CANSEE,CORENAME,STOPFLAG,FORK} back to the subsystem. Note: Consider killing the signal listener and sticking KAUTH_PROCESS_SIGNAL here as well. To generate a diff of this commit: cvs rdiff -u -r1.152 -r1.153 src/sys/kern/kern_proc.c cvs rdiff -u -r1.24 -r1.25 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_proc.c diff -u src/sys/kern/kern_proc.c:1.152 src/sys/kern/kern_proc.c:1.153 --- src/sys/kern/kern_proc.c:1.152 Sat May 23 18:28:06 2009 +++ src/sys/kern/kern_proc.c Sat Oct 3 03:38:31 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_proc.c,v 1.152 2009/05/23 18:28:06 ad Exp $ */ +/* $NetBSD: kern_proc.c,v 1.153 2009/10/03 03:38:31 elad Exp $ */ /*- * Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.152 2009/05/23 18:28:06 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.153 2009/10/03 03:38:31 elad Exp $"); #include "opt_kstack.h" #include "opt_maxuprc.h" @@ -235,6 +235,80 @@ static pool_cache_t proc_cache; +static kauth_listener_t proc_listener; + +static int +proc_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, +void *arg0, void *arg1, void *arg2, void *arg3) +{ + struct proc *p; + int result; + + result = KAUTH_RESULT_DEFER; + p = arg0; + + switch (action) { + case KAUTH_PROCESS_CANSEE: { + enum kauth_process_req req; + + req = (enum kauth_process_req)arg1; + + switch (req) { + case KAUTH_REQ_PROCESS_CANSEE_ARGS: + case KAUTH_REQ_PROCESS_CANSEE_ENTRY: + case KAUTH_REQ_PROCESS_CANSEE_OPENFILES: + result = KAUTH_RESULT_ALLOW; + + break; + + case KAUTH_REQ_PROCESS_CANSEE_ENV: + if (kauth_cred_getuid(cred) != + kauth_cred_getuid(p->p_cred) || + kauth_cred_getuid(cred) != + kauth_cred_getsvuid(p->p_cred)) +break; + + result = KAUTH_RESULT_ALLOW; + + break; + + default: + break; + } + + break; + } + + case KAUTH_PROCESS_FORK: { + int lnprocs = (int)(unsigned long)arg2; + + /* + * Don't allow a nonprivileged user to use the last few + * processes. The variable lnprocs is the current number of + * processes, maxproc is the limit. + */ + if (__predict_false((lnprocs >= maxproc - 5))) + break; + + result = KAUTH_RESULT_ALLOW; + + break; + } + + case KAUTH_PROCESS_CORENAME: + case KAUTH_PROCESS_STOPFLAG: + if (proc_uidmatch(cred, p->p_cred) == 0) + result = KAUTH_RESULT_ALLOW; + + break; + + default: + break; + } + + return result; +} + /* * Initialize global process hashing structures. */ @@ -272,6 +346,9 @@ proc_cache = pool_cache_init(sizeof(struct proc), 0, 0, 0, "procpl", NULL, IPL_NONE, NULL, NULL, NULL); + + proc_listener = kauth_listen_scope(KAUTH_SCOPE_PROCESS, + proc_listener_cb, NULL); } /* Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.24 src/sys/secmodel/suser/secmodel_suser.c:1.25 --- src/sys/secmodel/suser/secmodel_suser.c:1.24 Sat Oct 3 03:02:55 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Sat Oct 3 03:38:31 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.24 2009/10/03 03:02:55 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.25 2009/10/03 03:38:31 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.24 2009/10/03 03:02:55 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.25 2009/10/03 03:38:31 elad Exp $"); #include #include @@ -496,6 +496,9 @@ case KAUTH_PROCESS_SETID: case KAUTH_PROCESS_KEVENT_FILTER: case KAUTH_PROCESS_NICE: + case KAUTH_PROCESS_FORK: + case KAUTH_PROCESS_CORENAME: + case KAUTH_PROCESS_STOPFLAG: if (isroot) result = KAUTH_RESULT_ALLOW; @@ -510,20 +513,20 @@ case KAUTH_REQ_PROCESS_CANSEE_ARGS: case KAUTH_REQ_PROCESS_CANSEE_ENTRY: case KAUTH_REQ_PROCESS_CANSEE_OPENFILES: - if (!secmodel_suser_curtain) -result = KAUTH_RESULT_ALLOW; - else if (isroot || kauth_cred_uidmatch(cred, p->p_cred)) + if (isroot) { result = KAUTH_RESULT_ALLOW; +break; + } + + if (secmodel_suser_curtain) { +if (kauth_cred_uidmatch(cred, p->p_cred) != 0) + result = KAUTH_RESULT_DENY; + } + break; case KAUTH_REQ_PROCESS_CANSEE_ENV: - if (!isroot && - (kauth_cred_getuid(cred) != - kauth_cred_getuid(p->p_cred) || - kauth_cred_getuid(cred) != - kauth_cred_getsvuid(p->p_cred))) -break; - else + if (isroot) result = KAUTH_RESULT_ALLOW; break; @@ -535,28 +538,6 @@ break; } - case KAUTH_PROCESS_CORENAME
CVS commit: src/sys/secmodel/suser
Module Name:src Committed By: elad Date: Sat Oct 3 03:02:55 UTC 2009 Modified Files: src/sys/secmodel/suser: secmodel_suser.c Log Message: One less include. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.23 src/sys/secmodel/suser/secmodel_suser.c:1.24 --- src/sys/secmodel/suser/secmodel_suser.c:1.23 Sat Oct 3 02:06:11 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Sat Oct 3 03:02:55 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.23 2009/10/03 02:06:11 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.24 2009/10/03 03:02:55 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.23 2009/10/03 02:06:11 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.24 2009/10/03 03:02:55 elad Exp $"); #include #include @@ -53,8 +53,6 @@ #include #include -#include - #include MODULE(MODULE_CLASS_SECMODEL, suser, NULL);
CVS commit: src/sbin/modstat
Module Name:src Committed By: elad Date: Sat Oct 3 02:27:43 UTC 2009 Modified Files: src/sbin/modstat: main.c Log Message: Make modstat output look pretty again. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sbin/modstat/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modstat/main.c diff -u src/sbin/modstat/main.c:1.7 src/sbin/modstat/main.c:1.8 --- src/sbin/modstat/main.c:1.7 Fri Oct 2 18:50:14 2009 +++ src/sbin/modstat/main.c Sat Oct 3 02:27:43 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.7 2009/10/02 18:50:14 elad Exp $ */ +/* $NetBSD: main.c,v 1.8 2009/10/03 02:27:43 elad Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.7 2009/10/02 18:50:14 elad Exp $"); +__RCSID("$NetBSD: main.c,v 1.8 2009/10/03 02:27:43 elad Exp $"); #endif /* !lint */ #include @@ -99,7 +99,8 @@ len = iov.iov_len; } - printf("NAME\t\tCLASS\tSOURCE\tREFS\tSIZE\tREQUIRES\n"); + printf("%-16s %-10s %-10s %-5s %-8s %s\n", + "NAME", "CLASS", "SOURCE", "REFS", "SIZE", "REQUIRES"); len = iov.iov_len / sizeof(modstat_t); qsort(iov.iov_base, len, sizeof(modstat_t), modstatcmp); for (ms = iov.iov_base; len != 0; ms++, len--) { @@ -116,7 +117,7 @@ } else { snprintf(sbuf, sizeof(sbuf), "%u", ms->ms_size); } - printf("%-16s%s\t%s\t%d\t%s\t%s\n", + printf("%-16s %-10s %-10s %-5d %-8s %s\n", ms->ms_name, classes[ms->ms_class], sources[ms->ms_source], ms->ms_refcnt, sbuf, ms->ms_required); }
CVS commit: src/sys/net
Module Name:src Committed By: elad Date: Sat Oct 3 02:22:22 UTC 2009 Modified Files: src/sys/net: route.c Log Message: We only care about KAUTH_NETWORK_ROUTE. To generate a diff of this commit: cvs rdiff -u -r1.119 -r1.120 src/sys/net/route.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net/route.c diff -u src/sys/net/route.c:1.119 src/sys/net/route.c:1.120 --- src/sys/net/route.c:1.119 Fri Oct 2 23:16:21 2009 +++ src/sys/net/route.c Sat Oct 3 02:22:22 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: route.c,v 1.119 2009/10/02 23:16:21 elad Exp $ */ +/* $NetBSD: route.c,v 1.120 2009/10/03 02:22:22 elad Exp $ */ /*- * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc. @@ -93,7 +93,7 @@ #include "opt_route.h" #include -__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.119 2009/10/02 23:16:21 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.120 2009/10/03 02:22:22 elad Exp $"); #include #include @@ -273,6 +273,9 @@ result = KAUTH_RESULT_DEFER; rtm = arg1; + if (action != KAUTH_NETWORK_ROUTE) + return result; + if (rtm->rtm_type == RTM_GET) result = KAUTH_RESULT_ALLOW;
CVS commit: src/sys/secmodel/suser
Module Name:src Committed By: elad Date: Sat Oct 3 02:06:11 UTC 2009 Modified Files: src/sys/secmodel/suser: secmodel_suser.c Log Message: Make this file a little bit smaller by collapsing cases. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.22 src/sys/secmodel/suser/secmodel_suser.c:1.23 --- src/sys/secmodel/suser/secmodel_suser.c:1.22 Sat Oct 3 02:01:12 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Sat Oct 3 02:06:11 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.22 2009/10/03 02:01:12 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.23 2009/10/03 02:06:11 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.22 2009/10/03 02:01:12 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.23 2009/10/03 02:06:11 elad Exp $"); #include #include @@ -444,6 +444,8 @@ case KAUTH_SYSTEM_CHROOT: case KAUTH_SYSTEM_FILEHANDLE: case KAUTH_SYSTEM_MKNOD: + case KAUTH_SYSTEM_SETIDCORE: + case KAUTH_SYSTEM_MODULE: if (isroot) result = KAUTH_RESULT_ALLOW; break; @@ -459,18 +461,6 @@ break; - case KAUTH_SYSTEM_SETIDCORE: - if (isroot) - result = KAUTH_RESULT_ALLOW; - - break; - - case KAUTH_SYSTEM_MODULE: - if (isroot) - result = KAUTH_RESULT_ALLOW; - - break; - default: break; } @@ -499,6 +489,15 @@ switch (action) { case KAUTH_PROCESS_SIGNAL: + case KAUTH_PROCESS_KTRACE: + case KAUTH_PROCESS_PROCFS: + case KAUTH_PROCESS_PTRACE: + case KAUTH_PROCESS_SCHEDULER_GETPARAM: + case KAUTH_PROCESS_SCHEDULER_SETPARAM: + case KAUTH_PROCESS_SCHEDULER_SETAFFINITY: + case KAUTH_PROCESS_SETID: + case KAUTH_PROCESS_KEVENT_FILTER: + case KAUTH_PROCESS_NICE: if (isroot) result = KAUTH_RESULT_ALLOW; @@ -538,24 +537,6 @@ break; } - case KAUTH_PROCESS_KTRACE: - if (isroot) - result = KAUTH_RESULT_ALLOW; - - break; - - case KAUTH_PROCESS_PROCFS: - if (isroot) - result = KAUTH_RESULT_ALLOW; - - break; - - case KAUTH_PROCESS_PTRACE: - if (isroot) - result = KAUTH_RESULT_ALLOW; - - break; - case KAUTH_PROCESS_CORENAME: if (isroot || proc_uidmatch(cred, p->p_cred) == 0) result = KAUTH_RESULT_ALLOW; @@ -578,18 +559,6 @@ break; } - case KAUTH_PROCESS_KEVENT_FILTER: - if (isroot) - result = KAUTH_RESULT_ALLOW; - - break; - - case KAUTH_PROCESS_NICE: - if (isroot) - result = KAUTH_RESULT_ALLOW; - - break; - case KAUTH_PROCESS_RLIMIT: { enum kauth_process_req req; @@ -610,19 +579,6 @@ break; } - case KAUTH_PROCESS_SCHEDULER_GETPARAM: - case KAUTH_PROCESS_SCHEDULER_SETPARAM: - case KAUTH_PROCESS_SCHEDULER_SETAFFINITY: - if (isroot) - result = KAUTH_RESULT_ALLOW; - - break; - - case KAUTH_PROCESS_SETID: - if (isroot) - result = KAUTH_RESULT_ALLOW; - break; - case KAUTH_PROCESS_STOPFLAG: if (isroot || proc_uidmatch(cred, p->p_cred) == 0) { result = KAUTH_RESULT_ALLOW; @@ -698,6 +654,7 @@ break; case KAUTH_NETWORK_FORWSRCRT: + case KAUTH_NETWORK_ROUTE: if (isroot) result = KAUTH_RESULT_ALLOW; @@ -782,12 +739,6 @@ } break; - case KAUTH_NETWORK_ROUTE: - if (isroot) - result = KAUTH_RESULT_ALLOW; - - break; - case KAUTH_NETWORK_SOCKET: switch (req) { case KAUTH_REQ_NETWORK_SOCKET_DROP: @@ -893,6 +844,12 @@ case KAUTH_DEVICE_BLUETOOTH_SETPRIV: case KAUTH_DEVICE_BLUETOOTH_SEND: case KAUTH_DEVICE_BLUETOOTH_RECV: + case KAUTH_DEVICE_TTY_OPEN: + case KAUTH_DEVICE_TTY_PRIVSET: + case KAUTH_DEVICE_TTY_STI: + case KAUTH_DEVICE_RND_ADDDATA: + case KAUTH_DEVICE_RND_GETPRIV: + case KAUTH_DEVICE_RND_SETPRIV: if (isroot) result = KAUTH_RESULT_ALLOW; break; @@ -927,31 +884,6 @@ result = KAUTH_RESULT_ALLOW; break; - case KAUTH_DEVICE_TTY_OPEN: - if (isroot) - result = KAUTH_RESULT_ALLOW; - - break; - - case KAUTH_DEVICE_TTY_PRIVSET: - if (isroot) - result = KAUTH_RESULT_ALLOW; - - break; - - case KAUTH_DEVICE_TTY_STI: - if (isroot) - result = KAUTH_RESULT_ALLOW; - - break; - - case KAUTH_DEVICE_RND_ADDDATA: - case KAUTH_DEVICE_RND_GETPRIV: - case KAUTH_DEVICE_RND_SETPRIV: - if (isroot) - result = KAUTH_RESULT_ALLOW; - break; - case KAUTH_DEVICE_GPIO_PINSET: /* * root can access gpio pins, secmodel_securlevel can veto
CVS commit: src/sys
Module Name:src Committed By: elad Date: Sat Oct 3 02:01:12 UTC 2009 Modified Files: src/sys/dev: clockctl.c src/sys/secmodel/suser: secmodel_suser.c Log Message: Move clockctl policy exception back to the subsystem. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/dev/clockctl.c cvs rdiff -u -r1.21 -r1.22 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/clockctl.c diff -u src/sys/dev/clockctl.c:1.27 src/sys/dev/clockctl.c:1.28 --- src/sys/dev/clockctl.c:1.27 Sun Feb 22 13:06:59 2009 +++ src/sys/dev/clockctl.c Sat Oct 3 02:01:12 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: clockctl.c,v 1.27 2009/02/22 13:06:59 nakayama Exp $ */ +/* $NetBSD: clockctl.c,v 1.28 2009/10/03 02:01:12 elad Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: clockctl.c,v 1.27 2009/02/22 13:06:59 nakayama Exp $"); +__KERNEL_RCSID(0, "$NetBSD: clockctl.c,v 1.28 2009/10/03 02:01:12 elad Exp $"); #include "opt_ntp.h" #include "opt_compat_netbsd.h" @@ -47,6 +47,7 @@ #ifdef NTP #include #endif /* NTP */ +#include #include #ifdef COMPAT_50 @@ -64,12 +65,39 @@ nostop, notty, nopoll, nommap, nokqfilter, D_OTHER, }; +static kauth_listener_t clockctl_listener; + +static int +clockctl_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, +void *arg0, void *arg1, void *arg2, void *arg3) +{ + int result; + enum kauth_system_req req; + bool device_context; + + result = KAUTH_RESULT_DEFER; + req = (enum kauth_system_req)arg0; + + if ((action != KAUTH_SYSTEM_TIME) || + (req != KAUTH_REQ_SYSTEM_TIME_SYSTEM)) + return result; + + device_context = (bool)arg3; + + /* Device is controlled by permissions, so allow. */ + if (device_context) + result = KAUTH_RESULT_ALLOW; + + return result; +} + /*ARGSUSED*/ void clockctlattach(int num) { - /* Nothing to set up before open is called */ - return; + + clockctl_listener = kauth_listen_scope(KAUTH_SCOPE_SYSTEM, + clockctl_listener_cb, NULL); } int Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.21 src/sys/secmodel/suser/secmodel_suser.c:1.22 --- src/sys/secmodel/suser/secmodel_suser.c:1.21 Sat Oct 3 01:52:14 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Sat Oct 3 02:01:12 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.21 2009/10/03 01:52:14 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.22 2009/10/03 02:01:12 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.21 2009/10/03 01:52:14 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.22 2009/10/03 02:01:12 elad Exp $"); #include #include @@ -410,19 +410,7 @@ case KAUTH_REQ_SYSTEM_TIME_ADJTIME: case KAUTH_REQ_SYSTEM_TIME_NTPADJTIME: case KAUTH_REQ_SYSTEM_TIME_TIMECOUNTERS: - if (isroot) -result = KAUTH_RESULT_ALLOW; - break; - - case KAUTH_REQ_SYSTEM_TIME_SYSTEM: { - bool device_context = (bool)arg3; - - if (device_context || isroot) -result = KAUTH_RESULT_ALLOW; - - break; - } - + case KAUTH_REQ_SYSTEM_TIME_SYSTEM: case KAUTH_REQ_SYSTEM_TIME_RTCOFFSET: if (isroot) result = KAUTH_RESULT_ALLOW;
CVS commit: src/sys/secmodel/suser
Module Name:src Committed By: elad Date: Sat Oct 3 01:52:14 UTC 2009 Modified Files: src/sys/secmodel/suser: secmodel_suser.c Log Message: secmodel_bsd44_curtain -> secmodel_suser_curtain (static). To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.20 src/sys/secmodel/suser/secmodel_suser.c:1.21 --- src/sys/secmodel/suser/secmodel_suser.c:1.20 Sat Oct 3 01:46:39 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Sat Oct 3 01:52:14 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.20 2009/10/03 01:46:39 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.21 2009/10/03 01:52:14 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.20 2009/10/03 01:46:39 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.21 2009/10/03 01:52:14 elad Exp $"); #include #include @@ -59,7 +59,7 @@ MODULE(MODULE_CLASS_SECMODEL, suser, NULL); -static int secmodel_bsd44_curtain; +static int secmodel_suser_curtain; /* static */ int dovfsusermount; static kauth_listener_t l_generic, l_system, l_process, l_network, l_machdep, @@ -101,7 +101,7 @@ CTLTYPE_INT, "curtain", SYSCTL_DESCR("Curtain information about objects to "\ "users not owning them."), - NULL, 0, &secmodel_bsd44_curtain, 0, + NULL, 0, &secmodel_suser_curtain, 0, CTL_CREATE, CTL_EOL); sysctl_createv(clog, 0, &rnode, NULL, @@ -124,7 +124,7 @@ CTLTYPE_INT, "curtain", SYSCTL_DESCR("Curtain information about objects to "\ "users not owning them."), - NULL, 0, &secmodel_bsd44_curtain, 0, + NULL, 0, &secmodel_suser_curtain, 0, CTL_CREATE, CTL_EOL); /* Compatibility: vfs.generic.usermount */ @@ -153,7 +153,7 @@ void secmodel_suser_init(void) { - secmodel_bsd44_curtain = 0; + secmodel_suser_curtain = 0; dovfsusermount = 0; } @@ -241,7 +241,7 @@ break; case KAUTH_GENERIC_CANSEE: - if (!secmodel_bsd44_curtain) + if (!secmodel_suser_curtain) result = KAUTH_RESULT_ALLOW; else if (isroot || kauth_cred_uidmatch(cred, arg0)) result = KAUTH_RESULT_ALLOW; @@ -525,7 +525,7 @@ case KAUTH_REQ_PROCESS_CANSEE_ARGS: case KAUTH_REQ_PROCESS_CANSEE_ENTRY: case KAUTH_REQ_PROCESS_CANSEE_OPENFILES: - if (!secmodel_bsd44_curtain) + if (!secmodel_suser_curtain) result = KAUTH_RESULT_ALLOW; else if (isroot || kauth_cred_uidmatch(cred, p->p_cred)) result = KAUTH_RESULT_ALLOW; @@ -816,7 +816,7 @@ break; } - if (secmodel_bsd44_curtain) { + if (secmodel_suser_curtain) { struct socket *so; uid_t so_uid;
CVS commit: src/sys
Module Name:src Committed By: elad Date: Sat Oct 3 01:46:39 UTC 2009 Modified Files: src/sys/net: if.c src/sys/secmodel/suser: secmodel_suser.c Log Message: Move default network interface policy back to the subsystem. To generate a diff of this commit: cvs rdiff -u -r1.238 -r1.239 src/sys/net/if.c cvs rdiff -u -r1.19 -r1.20 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net/if.c diff -u src/sys/net/if.c:1.238 src/sys/net/if.c:1.239 --- src/sys/net/if.c:1.238 Sat Sep 19 11:02:07 2009 +++ src/sys/net/if.c Sat Oct 3 01:46:39 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: if.c,v 1.238 2009/09/19 11:02:07 skrll Exp $ */ +/* $NetBSD: if.c,v 1.239 2009/10/03 01:46:39 elad Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc. @@ -90,7 +90,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.238 2009/09/19 11:02:07 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.239 2009/10/03 01:46:39 elad Exp $"); #include "opt_inet.h" @@ -166,6 +166,8 @@ struct pfil_head if_pfil; /* packet filtering hook for interfaces */ #endif +static kauth_listener_t if_listener; + static void if_detach_queues(struct ifnet *, struct ifqueue *); static void sysctl_sndq_setup(struct sysctllog **, const char *, struct ifaltq *); @@ -173,6 +175,26 @@ static void sysctl_net_ifq_setup(struct sysctllog **, int, const char *, int, const char *, int, struct ifqueue *); +static int +if_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, +void *arg0, void *arg1, void *arg2, void *arg3) +{ + int result; + enum kauth_network_req req; + + result = KAUTH_RESULT_DEFER; + req = (enum kauth_network_req)arg1; + + if (action != KAUTH_NETWORK_INTERFACE) + return result; + + if ((req == KAUTH_REQ_NETWORK_INTERFACE_GET) || + (req == KAUTH_REQ_NETWORK_INTERFACE_SET)) + result = KAUTH_RESULT_ALLOW; + + return result; +} + /* * Network interface utility routines. * @@ -195,6 +217,9 @@ callout_init(&if_slowtimo_ch, 0); if_slowtimo(NULL); + + if_listener = kauth_listen_scope(KAUTH_SCOPE_NETWORK, + if_listener_cb, NULL); } /* Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.19 src/sys/secmodel/suser/secmodel_suser.c:1.20 --- src/sys/secmodel/suser/secmodel_suser.c:1.19 Sat Oct 3 01:41:39 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Sat Oct 3 01:46:39 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.19 2009/10/03 01:41:39 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.20 2009/10/03 01:46:39 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.19 2009/10/03 01:41:39 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.20 2009/10/03 01:46:39 elad Exp $"); #include #include @@ -717,11 +717,6 @@ case KAUTH_NETWORK_INTERFACE: switch (req) { - case KAUTH_REQ_NETWORK_INTERFACE_GET: - case KAUTH_REQ_NETWORK_INTERFACE_SET: - result = KAUTH_RESULT_ALLOW; - break; - case KAUTH_REQ_NETWORK_INTERFACE_GETPRIV: case KAUTH_REQ_NETWORK_INTERFACE_SETPRIV: if (isroot)
CVS commit: src/sys
Module Name:src Committed By: elad Date: Sat Oct 3 01:41:39 UTC 2009 Modified Files: src/sys/kern: uipc_socket.c src/sys/secmodel/suser: secmodel_suser.c Log Message: Finish moving socket policy to the subsystem. To generate a diff of this commit: cvs rdiff -u -r1.191 -r1.192 src/sys/kern/uipc_socket.c cvs rdiff -u -r1.18 -r1.19 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/uipc_socket.c diff -u src/sys/kern/uipc_socket.c:1.191 src/sys/kern/uipc_socket.c:1.192 --- src/sys/kern/uipc_socket.c:1.191 Fri Oct 2 23:50:16 2009 +++ src/sys/kern/uipc_socket.c Sat Oct 3 01:41:39 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_socket.c,v 1.191 2009/10/02 23:50:16 elad Exp $ */ +/* $NetBSD: uipc_socket.c,v 1.192 2009/10/03 01:41:39 elad Exp $ */ /*- * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.191 2009/10/02 23:50:16 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.192 2009/10/03 01:41:39 elad Exp $"); #include "opt_compat_netbsd.h" #include "opt_sock_counters.h" @@ -470,6 +470,11 @@ break; + case KAUTH_REQ_NETWORK_SOCKET_CANSEE: + result = KAUTH_RESULT_ALLOW; + + break; + default: break; } Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.18 src/sys/secmodel/suser/secmodel_suser.c:1.19 --- src/sys/secmodel/suser/secmodel_suser.c:1.18 Sat Oct 3 01:30:25 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Sat Oct 3 01:41:39 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.18 2009/10/03 01:30:25 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.19 2009/10/03 01:41:39 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.18 2009/10/03 01:30:25 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.19 2009/10/03 01:41:39 elad Exp $"); #include #include @@ -822,14 +822,14 @@ } if (secmodel_bsd44_curtain) { +struct socket *so; uid_t so_uid; -so_uid = -((struct socket *)arg1)->so_uidinfo->ui_uid; -if (kauth_cred_geteuid(cred) == so_uid) - result = KAUTH_RESULT_ALLOW; - } else -result = KAUTH_RESULT_ALLOW; +so = (struct socket *)arg1; +so_uid = so->so_uidinfo->ui_uid; +if (kauth_cred_geteuid(cred) != so_uid) + result = KAUTH_RESULT_DENY; + } break;
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: christos Date: Sat Oct 3 01:35:20 UTC 2009 Modified Files: src/usr.bin/xlint/lint1: cgram.y Log Message: accept struct { ... } __packed name; To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/usr.bin/xlint/lint1/cgram.y Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/cgram.y diff -u src/usr.bin/xlint/lint1/cgram.y:1.46 src/usr.bin/xlint/lint1/cgram.y:1.47 --- src/usr.bin/xlint/lint1/cgram.y:1.46 Fri Oct 2 15:01:13 2009 +++ src/usr.bin/xlint/lint1/cgram.y Fri Oct 2 21:35:20 2009 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.46 2009/10/02 19:01:13 christos Exp $ */ +/* $NetBSD: cgram.y,v 1.47 2009/10/03 01:35:20 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: cgram.y,v 1.46 2009/10/02 19:01:13 christos Exp $"); +__RCSID("$NetBSD: cgram.y,v 1.47 2009/10/03 01:35:20 christos Exp $"); #endif #include @@ -684,6 +684,7 @@ | noclass_declmods typespec { addtype($2); } + | noclass_declspecs type_attribute | noclass_declspecs T_QUAL { addqual($2); }
CVS commit: src/sys
Module Name:src Committed By: elad Date: Sat Oct 3 01:30:25 UTC 2009 Modified Files: src/sys/kern: kern_synch.c src/sys/secmodel/suser: secmodel_suser.c Log Message: Move sched policy back to the subsystem. To generate a diff of this commit: cvs rdiff -u -r1.267 -r1.268 src/sys/kern/kern_synch.c cvs rdiff -u -r1.17 -r1.18 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_synch.c diff -u src/sys/kern/kern_synch.c:1.267 src/sys/kern/kern_synch.c:1.268 --- src/sys/kern/kern_synch.c:1.267 Sun Jul 19 10:11:55 2009 +++ src/sys/kern/kern_synch.c Sat Oct 3 01:30:25 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_synch.c,v 1.267 2009/07/19 10:11:55 yamt Exp $ */ +/* $NetBSD: kern_synch.c,v 1.268 2009/10/03 01:30:25 elad Exp $ */ /*- * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009 @@ -69,7 +69,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.267 2009/07/19 10:11:55 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.268 2009/10/03 01:30:25 elad Exp $"); #include "opt_kstack.h" #include "opt_perfctrs.h" @@ -97,6 +97,7 @@ #include #include #include +#include #include @@ -127,6 +128,8 @@ unsigned sched_pstats_ticks; kcondvar_t lbolt; /* once a second sleep address */ +kauth_listener_t sched_listener; + /* Preemption event counters */ static struct evcnt kpreempt_ev_crit; static struct evcnt kpreempt_ev_klock; @@ -142,6 +145,55 @@ */ int safepri; +static int +sched_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, +void *arg0, void *arg1, void *arg2, void *arg3) +{ + struct proc *p; + int result; + + result = KAUTH_RESULT_DEFER; + p = arg0; + + switch (action) { + case KAUTH_PROCESS_SCHEDULER_GETPARAM: + if (kauth_cred_uidmatch(cred, p->p_cred)) + result = KAUTH_RESULT_ALLOW; + break; + + case KAUTH_PROCESS_SCHEDULER_SETPARAM: + if (kauth_cred_uidmatch(cred, p->p_cred)) { + struct lwp *l; + int policy; + pri_t priority; + + l = arg1; + policy = (int)(unsigned long)arg2; + priority = (pri_t)(unsigned long)arg3; + + if ((policy == l->l_class || + (policy != SCHED_FIFO && policy != SCHED_RR)) && + priority <= l->l_priority) +result = KAUTH_RESULT_ALLOW; + } + + break; + + case KAUTH_PROCESS_SCHEDULER_GETAFFINITY: + result = KAUTH_RESULT_ALLOW; + break; + + case KAUTH_PROCESS_SCHEDULER_SETAFFINITY: + /* Privileged; we let the secmodel handle this. */ + break; + + default: + break; + } + + return result; +} + void sched_init(void) { @@ -158,6 +210,9 @@ "kpreempt", "immediate"); sched_pstats(NULL); + + sched_listener = kauth_listen_scope(KAUTH_SCOPE_PROCESS, + sched_listener_cb, NULL); } /* Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.17 src/sys/secmodel/suser/secmodel_suser.c:1.18 --- src/sys/secmodel/suser/secmodel_suser.c:1.17 Sat Oct 3 00:37:01 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Sat Oct 3 01:30:25 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.17 2009/10/03 00:37:01 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.18 2009/10/03 01:30:25 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.17 2009/10/03 00:37:01 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.18 2009/10/03 01:30:25 elad Exp $"); #include #include @@ -623,36 +623,7 @@ } case KAUTH_PROCESS_SCHEDULER_GETPARAM: - if (isroot || kauth_cred_uidmatch(cred, p->p_cred)) - result = KAUTH_RESULT_ALLOW; - - break; - case KAUTH_PROCESS_SCHEDULER_SETPARAM: - if (isroot) - result = KAUTH_RESULT_ALLOW; - else if (kauth_cred_uidmatch(cred, p->p_cred)) { - struct lwp *l; - int policy; - pri_t priority; - - l = arg1; - policy = (int)(unsigned long)arg2; - priority = (pri_t)(unsigned long)arg3; - - if ((policy == l->l_class || - (policy != SCHED_FIFO && policy != SCHED_RR)) && - priority <= l->l_priority) -result = KAUTH_RESULT_ALLOW; - } - - break; - - case KAUTH_PROCESS_SCHEDULER_GETAFFINITY: - result = KAUTH_RESULT_ALLOW; - - break; - case KAUTH_PROCESS_SCHEDULER_SETAFFINITY: if (isroot) result = KAUTH_RESULT_ALLOW;
CVS commit: src/sys
Module Name:src Committed By: elad Date: Sat Oct 3 00:37:02 UTC 2009 Modified Files: src/sys/dist/ipf/netinet: ip_fil_netbsd.c src/sys/dist/pf/net: pf_ioctl.c src/sys/secmodel/suser: secmodel_suser.c Log Message: Move firewall/NAT policy back to respective subsystems (pf, ipf). Note: the ipf code contains a lot of ifdefs, some of them for NetBSD versions that are no longer maintained. It won't make the code more readable, but we should consider removing them. To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sys/dist/ipf/netinet/ip_fil_netbsd.c cvs rdiff -u -r1.36 -r1.37 src/sys/dist/pf/net/pf_ioctl.c cvs rdiff -u -r1.16 -r1.17 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dist/ipf/netinet/ip_fil_netbsd.c diff -u src/sys/dist/ipf/netinet/ip_fil_netbsd.c:1.51 src/sys/dist/ipf/netinet/ip_fil_netbsd.c:1.52 --- src/sys/dist/ipf/netinet/ip_fil_netbsd.c:1.51 Wed Aug 19 08:36:10 2009 +++ src/sys/dist/ipf/netinet/ip_fil_netbsd.c Sat Oct 3 00:37:02 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_fil_netbsd.c,v 1.51 2009/08/19 08:36:10 darrenr Exp $ */ +/* $NetBSD: ip_fil_netbsd.c,v 1.52 2009/10/03 00:37:02 elad Exp $ */ /* * Copyright (C) 1993-2003 by Darren Reed. @@ -8,7 +8,7 @@ #if !defined(lint) #if defined(__NetBSD__) #include -__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.51 2009/08/19 08:36:10 darrenr Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.52 2009/10/03 00:37:02 elad Exp $"); #else static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-2000 Darren Reed"; static const char rcsid[] = "@(#)Id: ip_fil_netbsd.c,v 2.55.2.66 2009/05/17 17:45:26 darrenr Exp"; @@ -115,6 +115,11 @@ #if __NetBSD_Version__ < 2 extern struct protosw inetsw[]; #endif + +#if (__NetBSD_Version__ >= 599002000) +static kauth_listener_t ipf_listener; +#endif + #if (__NetBSD_Version__ < 399001400) extern int ip6_getpmtu __P((struct route_in6 *, struct route_in6 *, struct ifnet *, struct in6_addr *, u_long *, @@ -300,6 +305,28 @@ } #endif /* IPFILTER_LKM */ +#if (__NetBSD_Version__ >= 599002000) +static int +ipf_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, +void *arg0, void *arg1, void *arg2, void *arg3) +{ + int result; + enum kauth_network_req req; + + result = KAUTH_RESULT_DEFER; + req = (enum kauth_network_req)arg0; + + if (action != KAUTH_NETWORK_FIREWALL) + return result; + + /* These must have came from device context. */ + if ((req == KAUTH_REQ_NETWORK_FIREWALL_FW) || + (req == KAUTH_REQ_NETWORK_FIREWALL_NAT)) + result = KAUTH_RESULT_ALLOW; + + return result; +} +#endif /* * Try to detect the case when compiling for NetBSD with pseudo-device @@ -453,6 +480,12 @@ #else timeout(fr_slowtimer, NULL, (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT); #endif + +#if (__NetBSD_Version__ >= 599002000) + ipf_listener = kauth_listen_scope(KAUTH_SCOPE_NETWORK, + ipf_listener_cb, NULL); +#endif + return 0; #if __NetBSD_Version__ >= 10511 Index: src/sys/dist/pf/net/pf_ioctl.c diff -u src/sys/dist/pf/net/pf_ioctl.c:1.36 src/sys/dist/pf/net/pf_ioctl.c:1.37 --- src/sys/dist/pf/net/pf_ioctl.c:1.36 Mon Sep 14 10:36:50 2009 +++ src/sys/dist/pf/net/pf_ioctl.c Sat Oct 3 00:37:02 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pf_ioctl.c,v 1.36 2009/09/14 10:36:50 degroote Exp $ */ +/* $NetBSD: pf_ioctl.c,v 1.37 2009/10/03 00:37:02 elad Exp $ */ /* $OpenBSD: pf_ioctl.c,v 1.182 2007/06/24 11:17:13 mcbride Exp $ */ /* @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pf_ioctl.c,v 1.36 2009/09/14 10:36:50 degroote Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pf_ioctl.c,v 1.37 2009/10/03 00:37:02 elad Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -174,6 +174,31 @@ static int pf_pfil_detach(void); static int pf_pfil_attached; + +static kauth_listener_t pf_listener; +#endif /* __NetBSD__ */ + +#ifdef __NetBSD__ +static int +pf_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, +void *arg0, void *arg1, void *arg2, void *arg3) +{ + int result; + enum kauth_network_req req; + + result = KAUTH_RESULT_DEFER; + req = (enum kauth_network_req)arg0; + + if (action != KAUTH_NETWORK_FIREWALL) + return result; + + /* These must have came from device context. */ + if ((req == KAUTH_REQ_NETWORK_FIREWALL_FW) || + (req == KAUTH_REQ_NETWORK_FIREWALL_NAT)) + result = KAUTH_RESULT_ALLOW; + + return result; +} #endif /* __NetBSD__ */ void @@ -277,6 +302,11 @@ #else kthread_create_deferred(pf_thread_create, NULL); #endif /* !__NetBSD__ */ + +#ifdef __NetBSD__ + pf_listener = kauth_listen_scope(KAUTH_SCOPE_NETWORK, + pf_listener_cb, NULL); +#endif /* __NetBSD__ */ } #ifndef __NetBSD__ Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.16 src/sys/secmodel/suser/secmodel_suser.c:1.17 --- src/sy
CVS commit: src/sys
Module Name:src Committed By: elad Date: Sat Oct 3 00:14:07 UTC 2009 Modified Files: src/sys/kern: kern_event.c src/sys/secmodel/suser: secmodel_suser.c Log Message: Move kevent policy back to the subsystem. To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 src/sys/kern/kern_event.c cvs rdiff -u -r1.15 -r1.16 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_event.c diff -u src/sys/kern/kern_event.c:1.65 src/sys/kern/kern_event.c:1.66 --- src/sys/kern/kern_event.c:1.65 Sun May 24 21:41:26 2009 +++ src/sys/kern/kern_event.c Sat Oct 3 00:14:07 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_event.c,v 1.65 2009/05/24 21:41:26 ad Exp $ */ +/* $NetBSD: kern_event.c,v 1.66 2009/10/03 00:14:07 elad Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.65 2009/05/24 21:41:26 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.66 2009/10/03 00:14:07 elad Exp $"); #include #include @@ -173,6 +173,30 @@ static krwlock_t kqueue_filter_lock; /* lock on filter lists */ static kmutex_t kqueue_misc_lock; /* miscellaneous */ +static kauth_listener_t kqueue_listener; + +static int +kqueue_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, +void *arg0, void *arg1, void *arg2, void *arg3) +{ + struct proc *p; + int result; + + result = KAUTH_RESULT_DEFER; + p = arg0; + + if (action != KAUTH_PROCESS_KEVENT_FILTER) + return result; + + if ((kauth_cred_getuid(p->p_cred) != kauth_cred_getuid(cred) || + ISSET(p->p_flag, PK_SUGID))) + return result; + + result = KAUTH_RESULT_ALLOW; + + return result; +} + /* * Initialize the kqueue subsystem. */ @@ -182,6 +206,9 @@ rw_init(&kqueue_filter_lock); mutex_init(&kqueue_misc_lock, MUTEX_DEFAULT, IPL_NONE); + + kqueue_listener = kauth_listen_scope(KAUTH_SCOPE_PROCESS, + kqueue_listener_cb, NULL); } /* Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.15 src/sys/secmodel/suser/secmodel_suser.c:1.16 --- src/sys/secmodel/suser/secmodel_suser.c:1.15 Sat Oct 3 00:06:37 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Sat Oct 3 00:14:07 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.15 2009/10/03 00:06:37 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.16 2009/10/03 00:14:07 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.15 2009/10/03 00:06:37 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.16 2009/10/03 00:14:07 elad Exp $"); #include #include @@ -591,12 +591,7 @@ } case KAUTH_PROCESS_KEVENT_FILTER: - if ((kauth_cred_getuid(p->p_cred) != - kauth_cred_getuid(cred) || - ISSET(p->p_flag, PK_SUGID)) && - !isroot) - break; - else + if (isroot) result = KAUTH_RESULT_ALLOW; break;
CVS commit: src/sys
Module Name:src Committed By: elad Date: Sat Oct 3 00:06:37 UTC 2009 Modified Files: src/sys/kern: kern_module.c src/sys/secmodel/suser: secmodel_suser.c Log Message: Put module loading policy back in the subsystem. Revisit: consider moving kauth_init() above module_init() in main(). To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/sys/kern/kern_module.c cvs rdiff -u -r1.14 -r1.15 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_module.c diff -u src/sys/kern/kern_module.c:1.50 src/sys/kern/kern_module.c:1.51 --- src/sys/kern/kern_module.c:1.50 Fri Oct 2 18:50:14 2009 +++ src/sys/kern/kern_module.c Sat Oct 3 00:06:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_module.c,v 1.50 2009/10/02 18:50:14 elad Exp $ */ +/* $NetBSD: kern_module.c,v 1.51 2009/10/03 00:06:37 elad Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.50 2009/10/02 18:50:14 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.51 2009/10/03 00:06:37 elad Exp $"); #ifdef _KERNEL_OPT #include "opt_ddb.h" @@ -78,6 +78,8 @@ static kmutex_t module_thread_lock; static int module_thread_ticks; +static kauth_listener_t module_listener; + /* Ensure that the kernel's link set isn't empty. */ static modinfo_t module_dummy; __link_set_add_rodata(modules, module_dummy); @@ -163,6 +165,23 @@ #endif } +static int +module_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, +void *arg0, void *arg1, void *arg2, void *arg3) +{ + int result; + + result = KAUTH_RESULT_DEFER; + + if (action != KAUTH_SYSTEM_MODULE) + return result; + + if ((uintptr_t)arg2 != 0) /* autoload */ + result = KAUTH_RESULT_ALLOW; + + return result; +} + /* * module_init2: * @@ -177,6 +196,9 @@ NULL, NULL, "modunload"); if (error != 0) panic("module_init: %d", error); + + module_listener = kauth_listen_scope(KAUTH_SCOPE_SYSTEM, + module_listener_cb, NULL); } SYSCTL_SETUP(sysctl_module_setup, "sysctl module setup") Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.14 src/sys/secmodel/suser/secmodel_suser.c:1.15 --- src/sys/secmodel/suser/secmodel_suser.c:1.14 Fri Oct 2 23:58:53 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Sat Oct 3 00:06:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.14 2009/10/02 23:58:53 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.15 2009/10/03 00:06:37 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.14 2009/10/02 23:58:53 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.15 2009/10/03 00:06:37 elad Exp $"); #include #include @@ -480,8 +480,7 @@ case KAUTH_SYSTEM_MODULE: if (isroot) result = KAUTH_RESULT_ALLOW; - if ((uintptr_t)arg2 != 0) /* autoload */ - result = KAUTH_RESULT_ALLOW; + break; default:
CVS commit: src/external/apache2/mDNSResponder
Module Name:src Committed By: tsarna Date: Sat Oct 3 00:03:05 UTC 2009 Modified Files: src/external/apache2/mDNSResponder/dist/mDNSPosix: PosixDaemon.c src/external/apache2/mDNSResponder/usr.sbin/mdnsd: Makefile Log Message: Make signals match what OS X and the manpage say. Implement toggles for debug and packet trace logging. Make this conditional on HAVE_SIGINFO. Presumably lack of SIGINFO as a standard posix feature is why they went with different signals here in the first place, but since we have it, let's use it. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c cvs rdiff -u -r1.3 -r1.4 \ src/external/apache2/mDNSResponder/usr.sbin/mdnsd/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c diff -u src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c:1.2 src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c:1.3 --- src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c:1.2 Thu Oct 1 16:36:20 2009 +++ src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c Sat Oct 3 00:03:05 2009 @@ -213,6 +213,10 @@ mDNSPosixListenForSignalInEventLoop(SIGINT); mDNSPosixListenForSignalInEventLoop(SIGTERM); mDNSPosixListenForSignalInEventLoop(SIGUSR1); +#ifdef HAVE_SIGINFO + mDNSPosixListenForSignalInEventLoop(SIGUSR2); + mDNSPosixListenForSignalInEventLoop(SIGINFO); +#endif mDNSPosixListenForSignalInEventLoop(SIGPIPE); mDNSPosixListenForSignalInEventLoop(SIGHUP) ; @@ -239,7 +243,22 @@ (void) mDNSPosixRunEventLoopOnce(m, &timeout, &signals, &gotData); if (sigismember(&signals, SIGHUP )) Reconfigure(m); +#ifdef HAVE_SIGINFO +/* use OSX-compatible signals since we can, and gain enhanced debugging */ + if (sigismember(&signals, SIGINFO)) DumpStateLog(m); + if (sigismember(&signals, SIGUSR1)) + { + mDNS_LoggingEnabled = mDNS_LoggingEnabled ? 0 : 1; + LogMsg("SIGUSR1: Logging %s", mDNS_LoggingEnabled ? "Enabled" : "Disabled"); + } + if (sigismember(&signals, SIGUSR2)) + { + mDNS_PacketLoggingEnabled = mDNS_PacketLoggingEnabled ? 0 : 1; + LogMsg("SIGUSR2: Packet Logging %s", mDNS_PacketLoggingEnabled ? "Enabled" : "Disabled"); + } +#else if (sigismember(&signals, SIGUSR1)) DumpStateLog(m); +#endif // SIGPIPE happens when we try to write to a dead client; death should be detected soon in request_callback() and cleaned up. if (sigismember(&signals, SIGPIPE)) LogMsg("Received SIGPIPE - ignoring"); if (sigismember(&signals, SIGINT) || sigismember(&signals, SIGTERM)) break; Index: src/external/apache2/mDNSResponder/usr.sbin/mdnsd/Makefile diff -u src/external/apache2/mDNSResponder/usr.sbin/mdnsd/Makefile:1.3 src/external/apache2/mDNSResponder/usr.sbin/mdnsd/Makefile:1.4 --- src/external/apache2/mDNSResponder/usr.sbin/mdnsd/Makefile:1.3 Thu Oct 1 10:01:14 2009 +++ src/external/apache2/mDNSResponder/usr.sbin/mdnsd/Makefile Sat Oct 3 00:03:05 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2009/10/01 10:01:14 tron Exp $ +# $NetBSD: Makefile,v 1.4 2009/10/03 00:03:05 tsarna Exp $ PROG= mdnsd @@ -6,7 +6,8 @@ .PATH: ${DIST}/mDNSPosix ${DIST}/mDNSCore ${DIST}/mDNSShared -CPPFLAGS+=-I${DIST}/mDNSCore -I${DIST}/mDNSShared -DPROGRAM_NAME=\"mdnsd\" +CPPFLAGS+=-I${DIST}/mDNSCore -I${DIST}/mDNSShared \ + -DPROGRAM_NAME=\"mdnsd\" -DHAVE_SIGINFO SRCS= PosixDaemon.c mDNSPosix.c mDNSUNP.c mDNS.c DNSDigest.c uDNS.c \ DNSCommon.c uds_daemon.c mDNSDebug.c dnssd_ipc.c GenLinkedList.c \ PlatformCommon.c
CVS commit: src/sys
Module Name:src Committed By: elad Date: Fri Oct 2 23:58:54 UTC 2009 Modified Files: src/sys/kern: tty.c src/sys/secmodel/suser: secmodel_suser.c Log Message: Put the tty opening policy back in the subsystem. Remove include we don't need from the secmodel code. To generate a diff of this commit: cvs rdiff -u -r1.232 -r1.233 src/sys/kern/tty.c cvs rdiff -u -r1.13 -r1.14 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/tty.c diff -u src/sys/kern/tty.c:1.232 src/sys/kern/tty.c:1.233 --- src/sys/kern/tty.c:1.232 Sat Aug 1 23:07:05 2009 +++ src/sys/kern/tty.c Fri Oct 2 23:58:53 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: tty.c,v 1.232 2009/08/01 23:07:05 christos Exp $ */ +/* $NetBSD: tty.c,v 1.233 2009/10/02 23:58:53 elad Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.232 2009/08/01 23:07:05 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.233 2009/10/02 23:58:53 elad Exp $"); #include #include @@ -206,6 +206,8 @@ uint64_t tk_nout; uint64_t tk_rawcc; +static kauth_listener_t tty_listener; + SYSCTL_SETUP(sysctl_kern_tkstat_setup, "sysctl kern.tkstat subtree setup") { @@ -2717,6 +2719,36 @@ va_end(ap); } +static int +tty_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, +void *arg0, void *arg1, void *arg2, void *arg3) +{ + struct tty *tty; + int result; + + result = KAUTH_RESULT_DEFER; + + if (action != KAUTH_DEVICE_TTY_OPEN) + return result; + + tty = arg0; + + /* If it's not opened, we allow. */ + if ((tty->t_state & TS_ISOPEN) == 0) + result = KAUTH_RESULT_ALLOW; + else { + /* + * If it's opened, we can only allow if it's not exclusively + * opened; otherwise, that's a privileged operation and we + * let the secmodel handle it. + */ + if ((tty->t_state & TS_XCLUDE) == 0) + result = KAUTH_RESULT_ALLOW; + } + + return result; +} + /* * Initialize the tty subsystem. */ @@ -2728,6 +2760,9 @@ rw_init(&ttcompat_lock); tty_sigsih = softint_establish(SOFTINT_CLOCK, ttysigintr, NULL); KASSERT(tty_sigsih != NULL); + + tty_listener = kauth_listen_scope(KAUTH_SCOPE_DEVICE, + tty_listener_cb, NULL); } /* Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.13 src/sys/secmodel/suser/secmodel_suser.c:1.14 --- src/sys/secmodel/suser/secmodel_suser.c:1.13 Fri Oct 2 23:50:16 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Fri Oct 2 23:58:53 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.13 2009/10/02 23:50:16 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.14 2009/10/02 23:58:53 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.13 2009/10/02 23:50:16 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.14 2009/10/02 23:58:53 elad Exp $"); #include #include @@ -48,7 +48,6 @@ #include #include #include -#include #include #include #include @@ -955,7 +954,6 @@ secmodel_suser_device_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, void *arg0, void *arg1, void *arg2, void *arg3) { - struct tty *tty; bool isroot; int result; @@ -1001,14 +999,7 @@ break; case KAUTH_DEVICE_TTY_OPEN: - tty = arg0; - - if (!(tty->t_state & TS_ISOPEN)) - result = KAUTH_RESULT_ALLOW; - else if (tty->t_state & TS_XCLUDE) { - if (isroot) -result = KAUTH_RESULT_ALLOW; - } else + if (isroot) result = KAUTH_RESULT_ALLOW; break;
CVS commit: src/sys
Module Name:src Committed By: elad Date: Fri Oct 2 23:50:16 UTC 2009 Modified Files: src/sys/kern: uipc_socket.c src/sys/secmodel/suser: secmodel_suser.c Log Message: Move some of the socket policy back to the subsystem. Remove include we don't need in the secmodel code. To generate a diff of this commit: cvs rdiff -u -r1.190 -r1.191 src/sys/kern/uipc_socket.c cvs rdiff -u -r1.12 -r1.13 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/uipc_socket.c diff -u src/sys/kern/uipc_socket.c:1.190 src/sys/kern/uipc_socket.c:1.191 --- src/sys/kern/uipc_socket.c:1.190 Fri Sep 11 22:06:29 2009 +++ src/sys/kern/uipc_socket.c Fri Oct 2 23:50:16 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_socket.c,v 1.190 2009/09/11 22:06:29 dyoung Exp $ */ +/* $NetBSD: uipc_socket.c,v 1.191 2009/10/02 23:50:16 elad Exp $ */ /*- * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.190 2009/09/11 22:06:29 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.191 2009/10/02 23:50:16 elad Exp $"); #include "opt_compat_netbsd.h" #include "opt_sock_counters.h" @@ -151,6 +151,8 @@ static int socurkva; static kcondvar_t socurkva_cv; +static kauth_listener_t socket_listener; + #define SOCK_LOAN_CHUNK 65536 static size_t sodopendfree(void); @@ -428,6 +430,53 @@ return m; } +static int +socket_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, +void *arg0, void *arg1, void *arg2, void *arg3) +{ + int result; + enum kauth_network_req req; + + result = KAUTH_RESULT_DEFER; + req = (enum kauth_network_req)arg0; + + if (action != KAUTH_NETWORK_SOCKET) + return result; + + switch (req) { + case KAUTH_REQ_NETWORK_SOCKET_DROP: { + /* Normal users can only drop their own connections. */ + struct socket *so = (struct socket *)arg1; + uid_t sockuid = so->so_uidinfo->ui_uid; + + if (sockuid == kauth_cred_getuid(cred) || + sockuid == kauth_cred_geteuid(cred)) + result = KAUTH_RESULT_ALLOW; + + break; + } + + case KAUTH_REQ_NETWORK_SOCKET_OPEN: + /* We allow "raw" routing/bluetooth sockets to anyone. */ + if ((u_long)arg1 == PF_ROUTE || (u_long)arg1 == PF_BLUETOOTH) + result = KAUTH_RESULT_ALLOW; + else { + /* Privileged, let secmodel handle this. */ + if ((u_long)arg2 == SOCK_RAW) +break; + } + + result = KAUTH_RESULT_ALLOW; + + break; + + default: + break; + } + + return result; +} + void soinit(void) { @@ -445,6 +494,9 @@ callback_register(&vm_map_to_kernel(kernel_map)->vmk_reclaim_callback, &sokva_reclaimerentry, NULL, sokva_reclaim_callback); + + socket_listener = kauth_listen_scope(KAUTH_SCOPE_NETWORK, + socket_listener_cb, NULL); } /* @@ -499,6 +551,7 @@ so->so_snd.sb_mowner = &prp->pr_domain->dom_mowner; so->so_mowner = &prp->pr_domain->dom_mowner; #endif + /* so->so_cred = kauth_cred_dup(l->l_cred); */ uid = kauth_cred_geteuid(l->l_cred); so->so_uidinfo = uid_find(uid); so->so_egid = kauth_cred_getegid(l->l_cred); @@ -641,6 +694,7 @@ /* Remove acccept filter if one is present. */ if (so->so_accf != NULL) (void)accept_filt_clear(so); + /* kauth_cred_free(so->so_cred); */ sounlock(so); if (refs == 0) /* XXX */ soput(so); Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.12 src/sys/secmodel/suser/secmodel_suser.c:1.13 --- src/sys/secmodel/suser/secmodel_suser.c:1.12 Fri Oct 2 23:24:15 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Fri Oct 2 23:50:16 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.12 2009/10/02 23:24:15 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.13 2009/10/02 23:50:16 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.12 2009/10/02 23:24:15 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.13 2009/10/02 23:50:16 elad Exp $"); #include #include @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include @@ -864,55 +863,29 @@ case KAUTH_NETWORK_SOCKET: switch (req) { case KAUTH_REQ_NETWORK_SOCKET_DROP: - /* - * The superuser can drop any connection. Normal users - * can only drop their own connections. - */ - if (isroot) -result = KAUTH_RESULT_ALLOW; - else { -struct socket *so = (struct socket *)arg1; -uid_t sockuid = so->so_uidinfo->ui_uid; - -if (sockuid == kauth_cred_getuid(cred) || -sockuid == kauth_cred_geteuid(cred)) - result = KAUTH_RESULT_ALLOW; - } - - - break; - case KAUTH_REQ_NETWORK_SOCKET_OPEN: - if ((u_long)arg1 == PF_ROUTE || (u_long)arg1 == PF_BLUETOOTH) -result = KAUTH_RESULT_ALLOW; - else if ((u_long)arg2 == SOCK_RAW) { -if (i
CVS commit: src/sys
Module Name:src Committed By: elad Date: Fri Oct 2 23:24:15 UTC 2009 Modified Files: src/sys/kern: kern_sig.c src/sys/secmodel/suser: secmodel_suser.c Log Message: Put signal delivery policy back in the subsystem. To generate a diff of this commit: cvs rdiff -u -r1.298 -r1.299 src/sys/kern/kern_sig.c cvs rdiff -u -r1.11 -r1.12 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_sig.c diff -u src/sys/kern/kern_sig.c:1.298 src/sys/kern/kern_sig.c:1.299 --- src/sys/kern/kern_sig.c:1.298 Sun May 24 21:41:26 2009 +++ src/sys/kern/kern_sig.c Fri Oct 2 23:24:15 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_sig.c,v 1.298 2009/05/24 21:41:26 ad Exp $ */ +/* $NetBSD: kern_sig.c,v 1.299 2009/10/02 23:24:15 elad Exp $ */ /*- * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.298 2009/05/24 21:41:26 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.299 2009/10/02 23:24:15 elad Exp $"); #include "opt_ptrace.h" #include "opt_compat_sunos.h" @@ -140,6 +140,29 @@ static const char lognocoredump[] = "pid %d (%s), uid %d: exited on signal %d (core not dumped, err = %d)\n"; +static kauth_listener_t signal_listener; + +static int +signal_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, +void *arg0, void *arg1, void *arg2, void *arg3) +{ + struct proc *p; + int result, signum; + + result = KAUTH_RESULT_DEFER; + p = arg0; + signum = (int)(unsigned long)arg1; + + if (action != KAUTH_PROCESS_SIGNAL) + return result; + + if (kauth_cred_uidmatch(cred, p->p_cred) || + (signum == SIGCONT && (curproc->p_session == p->p_session))) + result = KAUTH_RESULT_ALLOW; + + return result; +} + /* * signal_init: * @@ -165,6 +188,9 @@ callout_init(&proc_stop_ch, CALLOUT_MPSAFE); callout_setfunc(&proc_stop_ch, proc_stop_callout, NULL); + + signal_listener = kauth_listen_scope(KAUTH_SCOPE_PROCESS, + signal_listener_cb, NULL); } /* Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.11 src/sys/secmodel/suser/secmodel_suser.c:1.12 --- src/sys/secmodel/suser/secmodel_suser.c:1.11 Fri Oct 2 23:18:12 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Fri Oct 2 23:24:15 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.11 2009/10/02 23:18:12 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.12 2009/10/02 23:24:15 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.11 2009/10/02 23:18:12 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.12 2009/10/02 23:24:15 elad Exp $"); #include #include @@ -513,16 +513,11 @@ p = arg0; switch (action) { - case KAUTH_PROCESS_SIGNAL: { - int signum; - - signum = (int)(unsigned long)arg1; - - if (isroot || kauth_cred_uidmatch(cred, p->p_cred) || - (signum == SIGCONT && (curproc->p_session == p->p_session))) + case KAUTH_PROCESS_SIGNAL: + if (isroot) result = KAUTH_RESULT_ALLOW; + break; - } case KAUTH_PROCESS_CANSEE: { unsigned long req;
CVS commit: src/sys/secmodel/suser
Module Name:src Committed By: elad Date: Fri Oct 2 23:18:12 UTC 2009 Modified Files: src/sys/secmodel/suser: secmodel_suser.c Log Message: Remove includes we don't need. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.10 src/sys/secmodel/suser/secmodel_suser.c:1.11 --- src/sys/secmodel/suser/secmodel_suser.c:1.10 Fri Oct 2 23:16:21 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Fri Oct 2 23:18:12 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.10 2009/10/02 23:16:21 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.11 2009/10/02 23:18:12 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,22 +38,18 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.10 2009/10/02 23:16:21 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.11 2009/10/02 23:18:12 elad Exp $"); #include #include #include -#include #include -#include #include -#include #include #include #include #include -#include #include #include #include
CVS commit: src/sys
Module Name:src Committed By: elad Date: Fri Oct 2 23:16:22 UTC 2009 Modified Files: src/sys/net: route.c src/sys/secmodel/suser: secmodel_suser.c Log Message: Move routing socket security policy back to the subsystem. To generate a diff of this commit: cvs rdiff -u -r1.118 -r1.119 src/sys/net/route.c cvs rdiff -u -r1.9 -r1.10 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net/route.c diff -u src/sys/net/route.c:1.118 src/sys/net/route.c:1.119 --- src/sys/net/route.c:1.118 Wed Sep 16 15:23:04 2009 +++ src/sys/net/route.c Fri Oct 2 23:16:21 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: route.c,v 1.118 2009/09/16 15:23:04 pooka Exp $ */ +/* $NetBSD: route.c,v 1.119 2009/10/02 23:16:21 elad Exp $ */ /*- * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc. @@ -93,7 +93,7 @@ #include "opt_route.h" #include -__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.118 2009/09/16 15:23:04 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.119 2009/10/02 23:16:21 elad Exp $"); #include #include @@ -108,6 +108,7 @@ #include #include #include +#include #include #include @@ -138,6 +139,8 @@ static int _rtcache_debug = 0; #endif /* RTFLUSH_DEBUG */ +static kauth_listener_t route_listener; + static int rtdeletemsg(struct rtentry *); static int rtflushclone1(struct rtentry *, void *); static void rtflushclone(sa_family_t family, struct rtentry *); @@ -260,6 +263,22 @@ dom->dom_rtoffset); } +static int +route_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, +void *arg0, void *arg1, void *arg2, void *arg3) +{ + struct rt_msghdr *rtm; + int result; + + result = KAUTH_RESULT_DEFER; + rtm = arg1; + + if (rtm->rtm_type == RTM_GET) + result = KAUTH_RESULT_ALLOW; + + return result; +} + void route_init(void) { @@ -276,6 +295,9 @@ rt_init(); rn_init(); /* initialize all zeroes, all ones, mask table */ rtable_init((void **)rt_tables); + + route_listener = kauth_listen_scope(KAUTH_SCOPE_NETWORK, + route_listener_cb, NULL); } void Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.9 src/sys/secmodel/suser/secmodel_suser.c:1.10 --- src/sys/secmodel/suser/secmodel_suser.c:1.9 Fri Oct 2 23:06:33 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Fri Oct 2 23:16:21 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.9 2009/10/02 23:06:33 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.10 2009/10/02 23:16:21 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.9 2009/10/02 23:06:33 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.10 2009/10/02 23:16:21 elad Exp $"); #include #include @@ -865,16 +865,9 @@ break; case KAUTH_NETWORK_ROUTE: - switch (((struct rt_msghdr *)arg1)->rtm_type) { - case RTM_GET: + if (isroot) result = KAUTH_RESULT_ALLOW; - break; - default: - if (isroot) -result = KAUTH_RESULT_ALLOW; - break; - } break; case KAUTH_NETWORK_SOCKET:
CVS commit: src/sys/secmodel/suser
Module Name:src Committed By: elad Date: Fri Oct 2 23:06:33 UTC 2009 Modified Files: src/sys/secmodel/suser: secmodel_suser.c Log Message: - Squeeze function declarations where possible, - KAUTH_RESULT_DEFER is the default (set at the beginning of each listener) and as such does not need to be set explicitly in the switches. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.8 src/sys/secmodel/suser/secmodel_suser.c:1.9 --- src/sys/secmodel/suser/secmodel_suser.c:1.8 Fri Oct 2 23:00:02 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Fri Oct 2 23:06:33 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.8 2009/10/02 23:00:02 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.9 2009/10/02 23:06:33 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.8 2009/10/02 23:00:02 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.9 2009/10/02 23:06:33 elad Exp $"); #include #include @@ -232,8 +232,7 @@ */ int secmodel_suser_generic_cb(kauth_cred_t cred, kauth_action_t action, -void *cookie, void *arg0, void *arg1, -void *arg2, void *arg3) +void *cookie, void *arg0, void *arg1, void *arg2, void *arg3) { bool isroot; int result; @@ -256,7 +255,6 @@ break; default: - result = KAUTH_RESULT_DEFER; break; } @@ -272,8 +270,7 @@ */ int secmodel_suser_system_cb(kauth_cred_t cred, kauth_action_t action, -void *cookie, void *arg0, void *arg1, -void *arg2, void *arg3) +void *cookie, void *arg0, void *arg1, void *arg2, void *arg3) { bool isroot; int result; @@ -392,7 +389,6 @@ break; default: - result = KAUTH_RESULT_DEFER; break; } @@ -439,7 +435,6 @@ break; default: - result = KAUTH_RESULT_DEFER; break; } break; @@ -496,7 +491,6 @@ break; default: - result = KAUTH_RESULT_DEFER; break; } @@ -695,7 +689,6 @@ break; default: - result = KAUTH_RESULT_DEFER; break; } @@ -711,8 +704,7 @@ */ int secmodel_suser_network_cb(kauth_cred_t cred, kauth_action_t action, -void *cookie, void *arg0, void *arg1, void *arg2, -void *arg3) +void *cookie, void *arg0, void *arg1, void *arg2, void *arg3) { bool isroot; int result; @@ -742,7 +734,6 @@ break; default: - result = KAUTH_RESULT_DEFER; break; } @@ -803,7 +794,6 @@ break; default: - result = KAUTH_RESULT_DEFER; break; } break; @@ -870,7 +860,6 @@ break; default: - result = KAUTH_RESULT_DEFER; break; } break; @@ -950,7 +939,6 @@ default: - result = KAUTH_RESULT_DEFER; break; } @@ -966,8 +954,7 @@ */ int secmodel_suser_machdep_cb(kauth_cred_t cred, kauth_action_t action, -void *cookie, void *arg0, void *arg1, void *arg2, -void *arg3) +void *cookie, void *arg0, void *arg1, void *arg2, void *arg3) { bool isroot; int result; @@ -994,7 +981,6 @@ break; default: - result = KAUTH_RESULT_DEFER; break; } @@ -1010,8 +996,7 @@ */ int secmodel_suser_device_cb(kauth_cred_t cred, kauth_action_t action, -void *cookie, void *arg0, void *arg1, void *arg2, -void *arg3) +void *cookie, void *arg0, void *arg1, void *arg2, void *arg3) { struct tty *tty; bool isroot; @@ -1100,7 +1085,6 @@ break; default: - result = KAUTH_RESULT_DEFER; break; }
CVS commit: src/sys
Module Name:src Committed By: elad Date: Fri Oct 2 23:00:02 UTC 2009 Modified Files: src/sys/miscfs/procfs: procfs_vfsops.c src/sys/secmodel/suser: secmodel_suser.c Log Message: Put procfs policy back in the subsystem. To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/sys/miscfs/procfs/procfs_vfsops.c cvs rdiff -u -r1.7 -r1.8 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/miscfs/procfs/procfs_vfsops.c diff -u src/sys/miscfs/procfs/procfs_vfsops.c:1.83 src/sys/miscfs/procfs/procfs_vfsops.c:1.84 --- src/sys/miscfs/procfs/procfs_vfsops.c:1.83 Sun Mar 15 17:22:38 2009 +++ src/sys/miscfs/procfs/procfs_vfsops.c Fri Oct 2 23:00:02 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: procfs_vfsops.c,v 1.83 2009/03/15 17:22:38 cegger Exp $ */ +/* $NetBSD: procfs_vfsops.c,v 1.84 2009/10/02 23:00:02 elad Exp $ */ /* * Copyright (c) 1993 @@ -76,7 +76,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.83 2009/03/15 17:22:38 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.84 2009/10/02 23:00:02 elad Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -110,6 +110,8 @@ static struct sysctllog *procfs_sysctl_log; +static kauth_listener_t procfs_listener; + /* * VFS Operations. * @@ -305,6 +307,45 @@ }; static int +procfs_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, +void *arg0, void *arg1, void *arg2, void *arg3) +{ + struct proc *p; + struct pfsnode *pfs; + enum kauth_process_req req; + int result; + + result = KAUTH_RESULT_DEFER; + p = arg0; + pfs = arg1; + req = (enum kauth_process_req)(unsigned long)arg2; + + if (action != KAUTH_PROCESS_PROCFS) + return result; + + /* Privileged; let secmodel handle that. */ + if (req == KAUTH_REQ_PROCESS_PROCFS_CTL) + return result; + + switch (pfs->pfs_type) { + case PFSregs: + case PFSfpregs: + case PFSmem: + if (kauth_cred_getuid(cred) != kauth_cred_getuid(p->p_cred) || + ISSET(p->p_flag, PK_SUGID)) + break; + + /*FALLTHROUGH*/ + default: + result = KAUTH_RESULT_ALLOW; + break; + } + + return result; +} + + +static int procfs_modcmd(modcmd_t cmd, void *arg) { int error; @@ -330,12 +371,17 @@ * one more instance of the "number to vfs" mapping problem, * but "12" is the order as taken from sys/mount.h */ + + procfs_listener = kauth_listen_scope(KAUTH_SCOPE_PROCESS, + procfs_listener_cb, NULL); + break; case MODULE_CMD_FINI: error = vfs_detach(&procfs_vfsops); if (error != 0) break; sysctl_teardown(&procfs_sysctl_log); + kauth_unlisten_scope(procfs_listener); break; default: error = ENOTTY; Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.7 src/sys/secmodel/suser/secmodel_suser.c:1.8 --- src/sys/secmodel/suser/secmodel_suser.c:1.7 Fri Oct 2 22:46:18 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Fri Oct 2 23:00:02 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.7 2009/10/02 22:46:18 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.8 2009/10/02 23:00:02 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.7 2009/10/02 22:46:18 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.8 2009/10/02 23:00:02 elad Exp $"); #include #include @@ -574,36 +574,11 @@ break; - case KAUTH_PROCESS_PROCFS: { - enum kauth_process_req req = (enum kauth_process_req)arg2; - struct pfsnode *pfs = arg1; - - if (isroot) { - result = KAUTH_RESULT_ALLOW; - break; - } - - if (req == KAUTH_REQ_PROCESS_PROCFS_CTL) { - break; - } - - switch (pfs->pfs_type) { - case PFSregs: - case PFSfpregs: - case PFSmem: - if (kauth_cred_getuid(cred) != - kauth_cred_getuid(p->p_cred) || - ISSET(p->p_flag, PK_SUGID)) { -break; - } - /*FALLTHROUGH*/ - default: + case KAUTH_PROCESS_PROCFS: + if (isroot) result = KAUTH_RESULT_ALLOW; - break; - } break; - } case KAUTH_PROCESS_PTRACE: if (isroot)
CVS commit: src/sys
Module Name:src Committed By: elad Date: Fri Oct 2 22:46:18 UTC 2009 Modified Files: src/sys/kern: kern_resource.c src/sys/secmodel/suser: secmodel_suser.c Log Message: Stick nice policy in its own subsystem and call the listener "resource" rather than "rlimit"... To generate a diff of this commit: cvs rdiff -u -r1.153 -r1.154 src/sys/kern/kern_resource.c cvs rdiff -u -r1.6 -r1.7 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_resource.c diff -u src/sys/kern/kern_resource.c:1.153 src/sys/kern/kern_resource.c:1.154 --- src/sys/kern/kern_resource.c:1.153 Fri Oct 2 22:38:45 2009 +++ src/sys/kern/kern_resource.c Fri Oct 2 22:46:18 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_resource.c,v 1.153 2009/10/02 22:38:45 elad Exp $ */ +/* $NetBSD: kern_resource.c,v 1.154 2009/10/02 22:46:18 elad Exp $ */ /*- * Copyright (c) 1982, 1986, 1991, 1993 @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_resource.c,v 1.153 2009/10/02 22:38:45 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_resource.c,v 1.154 2009/10/02 22:46:18 elad Exp $"); #include #include @@ -69,38 +69,66 @@ static pool_cache_t plimit_cache; static pool_cache_t pstats_cache; -static kauth_listener_t rlimit_listener; +static kauth_listener_t resource_listener; static int -rlimit_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, +resource_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, void *arg0, void *arg1, void *arg2, void *arg3) { struct proc *p; int result; - enum kauth_process_req req; result = KAUTH_RESULT_DEFER; p = arg0; - req = (enum kauth_process_req)(unsigned long)arg1; - if (action != KAUTH_PROCESS_RLIMIT) - return result; + switch (action) { + case KAUTH_PROCESS_NICE: + if (kauth_cred_geteuid(cred) != kauth_cred_geteuid(p->p_cred) && +kauth_cred_getuid(cred) != kauth_cred_geteuid(p->p_cred)) { +break; +} - if (req == KAUTH_REQ_PROCESS_RLIMIT_SET) { - struct rlimit *new_rlimit; - u_long which; +if ((u_long)arg1 >= p->p_nice) +result = KAUTH_RESULT_ALLOW; - if ((p != curlwp->l_proc) && - (proc_uidmatch(cred, p->p_cred) != 0)) - return result; + break; + + case KAUTH_PROCESS_RLIMIT: { + enum kauth_process_req req; - new_rlimit = arg2; - which = (u_long)arg3; + req = (enum kauth_process_req)(unsigned long)arg1; - if (new_rlimit->rlim_max <= p->p_rlimit[which].rlim_max) + switch (req) { + case KAUTH_REQ_PROCESS_RLIMIT_GET: result = KAUTH_RESULT_ALLOW; - } else if (req == KAUTH_REQ_PROCESS_RLIMIT_GET) { - result = KAUTH_RESULT_ALLOW; + break; + + case KAUTH_REQ_PROCESS_RLIMIT_SET: { + struct rlimit *new_rlimit; + u_long which; + + if ((p != curlwp->l_proc) && + (proc_uidmatch(cred, p->p_cred) != 0)) +break; + + new_rlimit = arg2; + which = (u_long)arg3; + + if (new_rlimit->rlim_max <= p->p_rlimit[which].rlim_max) +result = KAUTH_RESULT_ALLOW; + + break; + } + + default: + break; + } + + break; + } + + default: + break; } return result; @@ -115,8 +143,8 @@ pstats_cache = pool_cache_init(sizeof(struct pstats), 0, 0, 0, "pstatspl", NULL, IPL_NONE, NULL, NULL, NULL); - rlimit_listener = kauth_listen_scope(KAUTH_SCOPE_PROCESS, - rlimit_listener_cb, NULL); + resource_listener = kauth_listen_scope(KAUTH_SCOPE_PROCESS, + resource_listener_cb, NULL); } /* Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.6 src/sys/secmodel/suser/secmodel_suser.c:1.7 --- src/sys/secmodel/suser/secmodel_suser.c:1.6 Fri Oct 2 22:38:45 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Fri Oct 2 22:46:18 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.6 2009/10/02 22:38:45 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.7 2009/10/02 22:46:18 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.6 2009/10/02 22:38:45 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.7 2009/10/02 22:46:18 elad Exp $"); #include #include @@ -645,19 +645,7 @@ break; case KAUTH_PROCESS_NICE: - if (isroot) { - result = KAUTH_RESULT_ALLOW; - break; - } - - if (kauth_cred_geteuid(cred) != - kauth_cred_geteuid(p->p_cred) && - kauth_cred_getuid(cred) != - kauth_cred_geteuid(p->p_cred)) { - break; - } - - if ((u_long)arg1 >= p->p_nice) + if (isroot) result = KAUTH_RESULT_ALLOW; break;
CVS commit: src/sys
Module Name:src Committed By: elad Date: Fri Oct 2 22:38:45 UTC 2009 Modified Files: src/sys/kern: kern_resource.c sys_process.c src/sys/secmodel/suser: secmodel_suser.c src/sys/sys: proc.h Log Message: Move rlimit policy back to the subsystem. For this we needed proc_uidmatch() exposed, which makes a lot of sense, so put it back in sys_process.c for use in other places as well. To generate a diff of this commit: cvs rdiff -u -r1.152 -r1.153 src/sys/kern/kern_resource.c cvs rdiff -u -r1.148 -r1.149 src/sys/kern/sys_process.c cvs rdiff -u -r1.5 -r1.6 src/sys/secmodel/suser/secmodel_suser.c cvs rdiff -u -r1.290 -r1.291 src/sys/sys/proc.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_resource.c diff -u src/sys/kern/kern_resource.c:1.152 src/sys/kern/kern_resource.c:1.153 --- src/sys/kern/kern_resource.c:1.152 Tue May 26 06:57:38 2009 +++ src/sys/kern/kern_resource.c Fri Oct 2 22:38:45 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_resource.c,v 1.152 2009/05/26 06:57:38 elad Exp $ */ +/* $NetBSD: kern_resource.c,v 1.153 2009/10/02 22:38:45 elad Exp $ */ /*- * Copyright (c) 1982, 1986, 1991, 1993 @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_resource.c,v 1.152 2009/05/26 06:57:38 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_resource.c,v 1.153 2009/10/02 22:38:45 elad Exp $"); #include #include @@ -69,6 +69,43 @@ static pool_cache_t plimit_cache; static pool_cache_t pstats_cache; +static kauth_listener_t rlimit_listener; + +static int +rlimit_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, +void *arg0, void *arg1, void *arg2, void *arg3) +{ + struct proc *p; + int result; + enum kauth_process_req req; + + result = KAUTH_RESULT_DEFER; + p = arg0; + req = (enum kauth_process_req)(unsigned long)arg1; + + if (action != KAUTH_PROCESS_RLIMIT) + return result; + + if (req == KAUTH_REQ_PROCESS_RLIMIT_SET) { + struct rlimit *new_rlimit; + u_long which; + + if ((p != curlwp->l_proc) && + (proc_uidmatch(cred, p->p_cred) != 0)) + return result; + + new_rlimit = arg2; + which = (u_long)arg3; + + if (new_rlimit->rlim_max <= p->p_rlimit[which].rlim_max) + result = KAUTH_RESULT_ALLOW; + } else if (req == KAUTH_REQ_PROCESS_RLIMIT_GET) { + result = KAUTH_RESULT_ALLOW; + } + + return result; +} + void resource_init(void) { @@ -77,6 +114,9 @@ "plimitpl", NULL, IPL_NONE, NULL, NULL, NULL); pstats_cache = pool_cache_init(sizeof(struct pstats), 0, 0, 0, "pstatspl", NULL, IPL_NONE, NULL, NULL, NULL); + + rlimit_listener = kauth_listen_scope(KAUTH_SCOPE_PROCESS, + rlimit_listener_cb, NULL); } /* Index: src/sys/kern/sys_process.c diff -u src/sys/kern/sys_process.c:1.148 src/sys/kern/sys_process.c:1.149 --- src/sys/kern/sys_process.c:1.148 Fri Oct 2 22:18:57 2009 +++ src/sys/kern/sys_process.c Fri Oct 2 22:38:45 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_process.c,v 1.148 2009/10/02 22:18:57 elad Exp $ */ +/* $NetBSD: sys_process.c,v 1.149 2009/10/02 22:38:45 elad Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -118,7 +118,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.148 2009/10/02 22:18:57 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.149 2009/10/02 22:38:45 elad Exp $"); #include "opt_ptrace.h" #include "opt_ktrace.h" @@ -1033,3 +1033,38 @@ } #endif /* KTRACE || PTRACE */ +/* + * common code for corename, rlimit, and stopflag. + */ +int +proc_uidmatch(kauth_cred_t cred, kauth_cred_t target) +{ + int r = 0; + + if (kauth_cred_getuid(cred) != kauth_cred_getuid(target) || + kauth_cred_getuid(cred) != kauth_cred_getsvuid(target)) { + /* + * suid proc of ours or proc not ours + */ + r = EPERM; + } else if (kauth_cred_getgid(target) != kauth_cred_getsvgid(target)) { + /* + * sgid proc has sgid back to us temporarily + */ + r = EPERM; + } else { + /* + * our rgid must be in target's group list (ie, + * sub-processes started by a sgid process) + */ + int ismember = 0; + + if (kauth_cred_ismember_gid(cred, + kauth_cred_getgid(target), &ismember) != 0 || + !ismember) + r = EPERM; + } + + return (r); +} + Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.5 src/sys/secmodel/suser/secmodel_suser.c:1.6 --- src/sys/secmodel/suser/secmodel_suser.c:1.5 Fri Oct 2 22:18:57 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Fri Oct 2 22:38:45 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.5 2009/10/02 22:18:57 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.6 2009/10/02 22:38:45 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.5 2009/10/02 22:18:57 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.6 2009/10/02 22:
CVS commit: src/sys
Module Name:src Committed By: elad Date: Fri Oct 2 22:18:57 UTC 2009 Modified Files: src/sys/kern: init_main.c sys_process.c src/sys/secmodel/suser: secmodel_suser.c src/sys/sys: ptrace.h Log Message: Move ptrace's security policy back to the subsystem itself. Add a ptrace_init() so we have a place to register the listener; called next to ktrinit(). To generate a diff of this commit: cvs rdiff -u -r1.403 -r1.404 src/sys/kern/init_main.c cvs rdiff -u -r1.147 -r1.148 src/sys/kern/sys_process.c cvs rdiff -u -r1.4 -r1.5 src/sys/secmodel/suser/secmodel_suser.c cvs rdiff -u -r1.40 -r1.41 src/sys/sys/ptrace.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/init_main.c diff -u src/sys/kern/init_main.c:1.403 src/sys/kern/init_main.c:1.404 --- src/sys/kern/init_main.c:1.403 Fri Oct 2 18:50:14 2009 +++ src/sys/kern/init_main.c Fri Oct 2 22:18:57 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: init_main.c,v 1.403 2009/10/02 18:50:14 elad Exp $ */ +/* $NetBSD: init_main.c,v 1.404 2009/10/02 22:18:57 elad Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.403 2009/10/02 18:50:14 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.404 2009/10/02 22:18:57 elad Exp $"); #include "opt_ddb.h" #include "opt_ipsec.h" @@ -112,6 +112,7 @@ #include "opt_pax.h" #include "opt_compat_netbsd.h" #include "opt_wapbl.h" +#include "opt_ptrace.h" #include "drvctl.h" #include "ksyms.h" @@ -201,6 +202,9 @@ #include #endif #include +#ifdef PTRACE +#include +#endif /* PTRACE */ #include #include @@ -550,6 +554,11 @@ ktrinit(); #endif +#ifdef PTRACE + /* Initialize ptrace. */ + ptrace_init(); +#endif /* PTRACE */ + /* Initialize the UUID system calls. */ uuid_init(); Index: src/sys/kern/sys_process.c diff -u src/sys/kern/sys_process.c:1.147 src/sys/kern/sys_process.c:1.148 --- src/sys/kern/sys_process.c:1.147 Sun Jun 28 11:42:07 2009 +++ src/sys/kern/sys_process.c Fri Oct 2 22:18:57 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_process.c,v 1.147 2009/06/28 11:42:07 yamt Exp $ */ +/* $NetBSD: sys_process.c,v 1.148 2009/10/02 22:18:57 elad Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -118,7 +118,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.147 2009/06/28 11:42:07 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.148 2009/10/02 22:18:57 elad Exp $"); #include "opt_ptrace.h" #include "opt_ktrace.h" @@ -141,6 +141,80 @@ #include #ifdef PTRACE +static kauth_listener_t ptrace_listener; + +static int +ptrace_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, +void *arg0, void *arg1, void *arg2, void *arg3) +{ + struct proc *p; + int result; + + result = KAUTH_RESULT_DEFER; + p = arg0; + + if (action != KAUTH_PROCESS_PTRACE) + return result; + + switch ((u_long)arg1) { + case PT_TRACE_ME: + case PT_ATTACH: + case PT_WRITE_I: + case PT_WRITE_D: + case PT_READ_I: + case PT_READ_D: + case PT_IO: +#ifdef PT_GETREGS + case PT_GETREGS: +#endif +#ifdef PT_SETREGS + case PT_SETREGS: +#endif +#ifdef PT_GETFPREGS + case PT_GETFPREGS: +#endif +#ifdef PT_SETFPREGS + case PT_SETFPREGS: +#endif +#ifdef __HAVE_PTRACE_MACHDEP + PTRACE_MACHDEP_REQUEST_CASES +#endif + if (kauth_cred_getuid(cred) != kauth_cred_getuid(p->p_cred) || + ISSET(p->p_flag, PK_SUGID)) { + break; + } + + result = KAUTH_RESULT_ALLOW; + + break; + +#ifdef PT_STEP + case PT_STEP: +#endif + case PT_CONTINUE: + case PT_KILL: + case PT_DETACH: + case PT_LWPINFO: + case PT_SYSCALL: + case PT_DUMPCORE: + result = KAUTH_RESULT_ALLOW; + break; + + default: + break; + } + + return result; +} + +void +ptrace_init(void) +{ + + ptrace_listener = kauth_listen_scope(KAUTH_SCOPE_PROCESS, + ptrace_listener_cb, NULL); +} + /* * Process debugging system call. */ @@ -958,3 +1032,4 @@ KERNEL_LOCK(l->l_biglocks, l); } #endif /* KTRACE || PTRACE */ + Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.4 src/sys/secmodel/suser/secmodel_suser.c:1.5 --- src/sys/secmodel/suser/secmodel_suser.c:1.4 Fri Oct 2 22:05:52 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Fri Oct 2 22:18:57 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.4 2009/10/02 22:05:52 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.5 2009/10/02 22:18:57 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.4 2009/10/02 22:05:52 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.5 2009/10/02 22:18:57 elad Exp $"); #include #include @@ -640,63 +640,11 @@ break; } - case KAUTH_PROCESS_PTRACE: { - switch ((u_long)arg1) { - case PT_TRACE_ME: - case PT_ATTACH: - case PT_WRITE_I:
CVS commit: src/sys
Module Name:src Committed By: elad Date: Fri Oct 2 22:05:52 UTC 2009 Modified Files: src/sys/ipkdb: ipkdb_ipkdb.c src/sys/secmodel/suser: secmodel_suser.c Log Message: Let the ipkdb subsystem allow operations related to it rather than wrongly doing so in the suser secmodel. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/ipkdb/ipkdb_ipkdb.c cvs rdiff -u -r1.3 -r1.4 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/ipkdb/ipkdb_ipkdb.c diff -u src/sys/ipkdb/ipkdb_ipkdb.c:1.26 src/sys/ipkdb/ipkdb_ipkdb.c:1.27 --- src/sys/ipkdb/ipkdb_ipkdb.c:1.26 Sun Apr 12 22:37:50 2009 +++ src/sys/ipkdb/ipkdb_ipkdb.c Fri Oct 2 22:05:52 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: ipkdb_ipkdb.c,v 1.26 2009/04/12 22:37:50 elad Exp $ */ +/* $NetBSD: ipkdb_ipkdb.c,v 1.27 2009/10/02 22:05:52 elad Exp $ */ /* * Copyright (C) 1993-2000 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ipkdb_ipkdb.c,v 1.26 2009/04/12 22:37:50 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ipkdb_ipkdb.c,v 1.27 2009/10/02 22:05:52 elad Exp $"); #include "opt_ipkdb.h" @@ -70,6 +70,8 @@ static struct ipkdb_if ipkdb_if; +static kauth_listener_t ipkdb_listener; + static u_char *ipkdbaddr(u_char *, int *, void **); static void peekmem(struct ipkdb_if *, u_char *, void *, long); static void pokemem(struct ipkdb_if *, u_char *, void *, long); @@ -89,6 +91,25 @@ static int connectipkdb(struct ipkdb_if *, char *, int); static int hmac_init(void); +static int +ipkdb_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, +void *arg0, void *arg1, void *arg2, void *arg3) +{ + enum kauth_system_req req; + int result; + + req = (enum kauth_system_req)arg0; + result = KAUTH_RESULT_DEFER; + + if ((action != KAUTH_SYSTEM_DEBUG) || + (req != KAUTH_REQ_SYSTEM_DEBUG_IPKDB)) + return result; + + result = KAUTH_RESULT_ALLOW; + + return result; +} + void ipkdb_init(void) { @@ -100,6 +121,9 @@ printf("IPKDB: No interface found!\n"); boothowto &= ~RB_KDB; } + + ipkdb_listener = kauth_listen_scope(KAUTH_SCOPE_SYSTEM, + ipkdb_listener_cb, NULL); } void Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.3 src/sys/secmodel/suser/secmodel_suser.c:1.4 --- src/sys/secmodel/suser/secmodel_suser.c:1.3 Fri Oct 2 21:56:28 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Fri Oct 2 22:05:52 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.3 2009/10/02 21:56:28 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.4 2009/10/02 22:05:52 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.3 2009/10/02 21:56:28 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.4 2009/10/02 22:05:52 elad Exp $"); #include #include @@ -471,17 +471,6 @@ result = KAUTH_RESULT_ALLOW; break; - case KAUTH_SYSTEM_DEBUG: - switch (req) { - case KAUTH_REQ_SYSTEM_DEBUG_IPKDB: - default: - /* Decisions are root-agnostic. */ - result = KAUTH_RESULT_ALLOW; - break; - } - - break; - case KAUTH_SYSTEM_CHSYSFLAGS: /* * Needs to be checked in conjunction with the immutable and
CVS commit: src/sys
Module Name:src Committed By: elad Date: Fri Oct 2 21:56:29 UTC 2009 Modified Files: src/sys/kern: sys_pset.c src/sys/secmodel/suser: secmodel_suser.c Log Message: Move psets security policy back to the subsystem and keep suser logic only in the suser secmodel code. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/kern/sys_pset.c cvs rdiff -u -r1.2 -r1.3 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/sys_pset.c diff -u src/sys/kern/sys_pset.c:1.12 src/sys/kern/sys_pset.c:1.13 --- src/sys/kern/sys_pset.c:1.12 Tue Mar 3 21:55:06 2009 +++ src/sys/kern/sys_pset.c Fri Oct 2 21:56:28 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_pset.c,v 1.12 2009/03/03 21:55:06 rmind Exp $ */ +/* $NetBSD: sys_pset.c,v 1.13 2009/10/02 21:56:28 elad Exp $ */ /* * Copyright (c) 2008, Mindaugas Rasiukevicius @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sys_pset.c,v 1.12 2009/03/03 21:55:06 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_pset.c,v 1.13 2009/10/02 21:56:28 elad Exp $"); #include @@ -56,12 +56,37 @@ static pset_info_t ** psets; static u_int psets_max; static u_int psets_count; +static kauth_listener_t psets_listener; static int psets_realloc(int); static int psid_validate(psetid_t, bool); static int kern_pset_create(psetid_t *); static int kern_pset_destroy(psetid_t); +static int +psets_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, +void *arg0, void *arg1, void *arg2, void *arg3) +{ + psetid_t id; + enum kauth_system_req req; + int result; + + result = KAUTH_RESULT_DEFER; + req = (enum kauth_system_req)arg0; + id = (psetid_t)(unsigned long)arg1; + + if (action != KAUTH_SYSTEM_PSET) + return result; + + if ((req == KAUTH_REQ_SYSTEM_PSET_ASSIGN) || + (req == KAUTH_REQ_SYSTEM_PSET_BIND)) { + if (id == PS_QUERY) + result = KAUTH_RESULT_ALLOW; + } + + return result; +} + /* * Initialization of the processor-sets. */ @@ -72,6 +97,9 @@ psets_max = max(MAXCPUS, 32); psets = kmem_zalloc(psets_max * sizeof(void *), KM_SLEEP); psets_count = 0; + + psets_listener = kauth_listen_scope(KAUTH_SCOPE_SYSTEM, + psets_listener_cb, NULL); } /* Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.2 src/sys/secmodel/suser/secmodel_suser.c:1.3 --- src/sys/secmodel/suser/secmodel_suser.c:1.2 Fri Oct 2 21:47:35 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Fri Oct 2 21:56:28 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.2 2009/10/02 21:47:35 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.3 2009/10/02 21:56:28 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.2 2009/10/02 21:47:35 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.3 2009/10/02 21:56:28 elad Exp $"); #include #include @@ -398,19 +398,10 @@ break; - case KAUTH_SYSTEM_PSET: { - psetid_t id; - - id = (psetid_t)(unsigned long)arg1; - + case KAUTH_SYSTEM_PSET: switch (req) { case KAUTH_REQ_SYSTEM_PSET_ASSIGN: case KAUTH_REQ_SYSTEM_PSET_BIND: - if (isroot || id == PS_QUERY) -result = KAUTH_RESULT_ALLOW; - - break; - case KAUTH_REQ_SYSTEM_PSET_CREATE: case KAUTH_REQ_SYSTEM_PSET_DESTROY: if (isroot) @@ -423,7 +414,6 @@ } break; - } case KAUTH_SYSTEM_TIME: switch (req) {
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: christos Date: Fri Oct 2 21:49:30 UTC 2009 Modified Files: src/usr.bin/xlint/lint1: decl.c Log Message: handle bit fields in packed structures. To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/usr.bin/xlint/lint1/decl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/decl.c diff -u src/usr.bin/xlint/lint1/decl.c:1.50 src/usr.bin/xlint/lint1/decl.c:1.51 --- src/usr.bin/xlint/lint1/decl.c:1.50 Fri Oct 2 17:04:03 2009 +++ src/usr.bin/xlint/lint1/decl.c Fri Oct 2 17:49:30 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.50 2009/10/02 21:04:03 christos Exp $ */ +/* $NetBSD: decl.c,v 1.51 2009/10/02 21:49:30 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: decl.c,v 1.50 2009/10/02 21:04:03 christos Exp $"); +__RCSID("$NetBSD: decl.c,v 1.51 2009/10/02 21:49:30 christos Exp $"); #endif #include @@ -495,19 +495,26 @@ switch (tp->t_tspec) { case STRUCT: - sp = tp->t_str; - sp->size = 0; - for (mem = sp->memb; mem != NULL; mem = mem->s_nxt) { - size_t x = (size_t)tsize(mem->s_type); - sp->size += x; - } - break; case UNION: sp = tp->t_str; sp->size = 0; for (mem = sp->memb; mem != NULL; mem = mem->s_nxt) { + if (mem->s_type->t_isfield) { +size_t len = mem->s_type->t_flen; +while (mem && mem->s_type->t_isfield) { + len += mem->s_type->t_flen; + mem = mem->s_nxt; +} +len = ((len + INT_SIZE - 1) / +INT_SIZE) * INT_SIZE; +sp->size += len; +if (mem == NULL) + break; + } size_t x = (size_t)tsize(mem->s_type); - if (x > sp->size) + if (tp->t_tspec == STRUCT) +sp->size += x; + else if (x > sp->size) sp->size = x; } break;
CVS commit: src/sys
Module Name:src Committed By: elad Date: Fri Oct 2 21:47:35 UTC 2009 Modified Files: src/sys/kern: kern_ktrace.c src/sys/secmodel/suser: secmodel_suser.c Log Message: Move ktrace's subsystem security policy to the subsystem itself, and keep just the suser-related logic in the suser secmodel. To generate a diff of this commit: cvs rdiff -u -r1.149 -r1.150 src/sys/kern/kern_ktrace.c cvs rdiff -u -r1.1 -r1.2 src/sys/secmodel/suser/secmodel_suser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_ktrace.c diff -u src/sys/kern/kern_ktrace.c:1.149 src/sys/kern/kern_ktrace.c:1.150 --- src/sys/kern/kern_ktrace.c:1.149 Wed Aug 5 19:53:42 2009 +++ src/sys/kern/kern_ktrace.c Fri Oct 2 21:47:35 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_ktrace.c,v 1.149 2009/08/05 19:53:42 dsl Exp $ */ +/* $NetBSD: kern_ktrace.c,v 1.150 2009/10/02 21:47:35 elad Exp $ */ /*- * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_ktrace.c,v 1.149 2009/08/05 19:53:42 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_ktrace.c,v 1.150 2009/10/02 21:47:35 elad Exp $"); #include #include @@ -179,6 +179,8 @@ static TAILQ_HEAD(, ktr_desc) ktdq = TAILQ_HEAD_INITIALIZER(ktdq); static pool_cache_t kte_cache; +static kauth_listener_t ktrace_listener; + static void ktd_wakeup(struct ktr_desc *ktd) { @@ -237,6 +239,39 @@ l->l_pflag &= ~LP_KTRACTIVE; } +static int +ktrace_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, +void *arg0, void *arg1, void *arg2, void *arg3) +{ + struct proc *p; + int result; + enum kauth_process_req req; + + result = KAUTH_RESULT_DEFER; + p = arg0; + + if (action != KAUTH_PROCESS_KTRACE) + return result; + + req = (enum kauth_process_req)(unsigned long)arg1; + + /* Privileged; secmodel should handle these. */ + if (req == KAUTH_REQ_PROCESS_KTRACE_PERSISTENT) + return result; + + if ((p->p_traceflag & KTRFAC_PERSISTENT) || + (p->p_flag & PK_SUGID)) + return result; + + if (kauth_cred_geteuid(cred) == kauth_cred_getuid(p->p_cred) && + kauth_cred_getuid(cred) == kauth_cred_getsvuid(p->p_cred) && + kauth_cred_getgid(cred) == kauth_cred_getgid(p->p_cred) && + kauth_cred_getgid(cred) == kauth_cred_getsvgid(p->p_cred)) + result = KAUTH_RESULT_ALLOW; + + return result; +} + /* * Initialise the ktrace system. */ @@ -247,6 +282,9 @@ mutex_init(&ktrace_lock, MUTEX_DEFAULT, IPL_NONE); kte_cache = pool_cache_init(sizeof(struct ktrace_entry), 0, 0, 0, "ktrace", &pool_allocator_nointr, IPL_NONE, NULL, NULL, NULL); + + ktrace_listener = kauth_listen_scope(KAUTH_SCOPE_PROCESS, + ktrace_listener_cb, NULL); } /* Index: src/sys/secmodel/suser/secmodel_suser.c diff -u src/sys/secmodel/suser/secmodel_suser.c:1.1 src/sys/secmodel/suser/secmodel_suser.c:1.2 --- src/sys/secmodel/suser/secmodel_suser.c:1.1 Fri Oct 2 18:50:13 2009 +++ src/sys/secmodel/suser/secmodel_suser.c Fri Oct 2 21:47:35 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.1 2009/10/02 18:50:13 elad Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.2 2009/10/02 21:47:35 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.1 2009/10/02 18:50:13 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.2 2009/10/02 21:47:35 elad Exp $"); #include #include @@ -624,33 +624,11 @@ break; } - case KAUTH_PROCESS_KTRACE: { - enum kauth_process_req req; - - req = (enum kauth_process_req)(unsigned long)arg1; - - if (isroot) { - result = KAUTH_RESULT_ALLOW; - break; - } else if (req == KAUTH_REQ_PROCESS_KTRACE_PERSISTENT) { - break; - } - - if ((p->p_traceflag & KTRFAC_PERSISTENT) || - (p->p_flag & PK_SUGID)) { - break; - } - - if (kauth_cred_geteuid(cred) == kauth_cred_getuid(p->p_cred) && - kauth_cred_getuid(cred) == kauth_cred_getsvuid(p->p_cred) && - kauth_cred_getgid(cred) == kauth_cred_getgid(p->p_cred) && - kauth_cred_getgid(cred) == kauth_cred_getsvgid(p->p_cred)) { + case KAUTH_PROCESS_KTRACE: + if (isroot) result = KAUTH_RESULT_ALLOW; - break; - } break; - } case KAUTH_PROCESS_PROCFS: { enum kauth_process_req req = (enum kauth_process_req)arg2;
CVS commit: src/doc
Module Name:src Committed By: roy Date: Fri Oct 2 21:44:02 UTC 2009 Modified Files: src/doc: 3RDPARTY CHANGES Log Message: Import dhcpcd-5.1.1 To generate a diff of this commit: cvs rdiff -u -r1.718 -r1.719 src/doc/3RDPARTY cvs rdiff -u -r1.1302 -r1.1303 src/doc/CHANGES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/3RDPARTY diff -u src/doc/3RDPARTY:1.718 src/doc/3RDPARTY:1.719 --- src/doc/3RDPARTY:1.718 Tue Sep 29 23:56:27 2009 +++ src/doc/3RDPARTY Fri Oct 2 21:44:02 2009 @@ -1,4 +1,4 @@ -# $NetBSD: 3RDPARTY,v 1.718 2009/09/29 23:56:27 tsarna Exp $ +# $NetBSD: 3RDPARTY,v 1.719 2009/10/02 21:44:02 roy Exp $ # # This file contains a list of the software that has been integrated into # NetBSD where we are not the primary maintainer. @@ -271,8 +271,8 @@ top of the current tree. Package: dhcpcd -Version: 5.0.7 -Current Vers: 5.0.7 +Version: 5.1.1 +Current Vers: 5.1.1 Maintainer: roy Archive Site: ftp://roy.marples.name/pub/dhcpcd/ Home Page: http://roy.marples.name/projects/dhcpcd/ Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.1302 src/doc/CHANGES:1.1303 --- src/doc/CHANGES:1.1302 Fri Oct 2 18:52:13 2009 +++ src/doc/CHANGES Fri Oct 2 21:44:02 2009 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1302 $> +# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1303 $> # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -416,3 +416,4 @@ acpiwmi(4): Add a driver for the ACPI WMI Mapper interface. [jmcneill 20091002] i386: Add support for VIA C7 temperature sensors. [jmcneill 20091002] + dhcpcd(8): Import dhcpcd-5.1.1. [roy 20091002]
CVS commit: src/external/bsd/dhcpcd/sbin/dhcpcd
Module Name:src Committed By: roy Date: Fri Oct 2 21:40:16 UTC 2009 Modified Files: src/external/bsd/dhcpcd/sbin/dhcpcd: Makefile Log Message: Fix building dhcpcd-5.1.1 To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile diff -u src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.5 src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.6 --- src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.5 Tue Apr 28 22:47:23 2009 +++ src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile Fri Oct 2 21:40:16 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.5 2009/04/28 22:47:23 roy Exp $ +# $NetBSD: Makefile,v 1.6 2009/10/02 21:40:16 roy Exp $ # PROG= dhcpcd @@ -7,10 +7,13 @@ signals.c SRCS+= bpf.c if-bsd.c +# getline is only available in NetBSD-6, so build the compat shim +SRCS+= getline.c + .include -DIST= ${NETBSDSRCDIR}/external/bsd/dhcpcd/dist -.PATH: ${DIST} +DIST= ${NETBSDSRCDIR}/external/bsd/dhcpcd/dist +.PATH: ${DIST} ${DIST}/compat CPPFLAGS+= -I${DIST}
CVS commit: src/external/bsd/dhcpcd/dist
Module Name:src Committed By: roy Date: Fri Oct 2 21:36:41 UTC 2009 Modified Files: src/external/bsd/dhcpcd/dist: dhcpcd.conf Log Message: Add back dhcpcd.conf To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/bsd/dhcpcd/dist/dhcpcd.conf Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/dhcpcd/dist/dhcpcd.conf diff -u src/external/bsd/dhcpcd/dist/dhcpcd.conf:1.3 src/external/bsd/dhcpcd/dist/dhcpcd.conf:1.4 --- src/external/bsd/dhcpcd/dist/dhcpcd.conf:1.3 Fri Jul 3 22:20:09 2009 +++ src/external/bsd/dhcpcd/dist/dhcpcd.conf Fri Oct 2 21:36:41 2009 @@ -1,10 +1,14 @@ -# $NetBSD: dhcpcd.conf,v 1.3 2009/07/03 22:20:09 roy Exp $ +# $NetBSD: dhcpcd.conf,v 1.4 2009/10/02 21:36:41 roy Exp $ # # A sample configuration for dhcpcd. # See dhcpcd.conf(5) for details. # Inform the DHCP server of our hostname for DDNS. hostname +# To share the DHCP lease across OSX and Windows a ClientID is needed. +# Enabling this may get a different lease than the kernel DHCP client. +# Some upstream DHCP servers may also require a ClientID, such as FRITZ!Box. +#clientid # A list of options to request from the DHCP server. option domain_name_servers, domain_name, domain_search, host_name @@ -12,11 +16,7 @@ option ntp_servers # Respect the network MTU. option interface_mtu - # A ServerID is required by RFC2131. -# Some broken DHCP servers do not send one and dhcpcd can work without it. -# Some broken DHCP servers NAK incorrectly and do not include a ServerID -# either so the default is to require a ServerID. require dhcp_server_identifier # A hook script is provided to lookup the hostname if not set by the DHCP
CVS commit: src/external/bsd/dhcpcd/dist
Module Name:src Committed By: roy Date: Fri Oct 2 21:31:09 UTC 2009 Update of /cvsroot/src/external/bsd/dhcpcd/dist In directory ivanova.netbsd.org:/tmp/cvs-serv7354 Log Message: Import dhcpcd-5.1.1 Changes from dhcpcd-5.0.7 include * Only allow hardware families we know by default (over-ridable) * Fix persistent and timeout 0 options * Fix parsing of escape code sequencies * Don't bring up interfaces brought down when handling new interfaces * Allow un-encapsulated vendor option * Don't null terminate gratuitously when handling quotes * Fix various typos and grammatical errors * dhcpcd.conf simplified a little Status: Vendor Tag: roy Release Tags: dhcpcd-5-1-1 U src/external/bsd/dhcpcd/dist/arp.c C src/external/bsd/dhcpcd/dist/dhcpcd.8.in U src/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.in U src/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.8.in U src/external/bsd/dhcpcd/dist/if-bsd.c U src/external/bsd/dhcpcd/dist/bpf.c U src/external/bsd/dhcpcd/dist/configure.c U src/external/bsd/dhcpcd/dist/signals.c U src/external/bsd/dhcpcd/dist/net.c U src/external/bsd/dhcpcd/dist/ipv4ll.c U src/external/bsd/dhcpcd/dist/if-pref.c U src/external/bsd/dhcpcd/dist/if-options.c U src/external/bsd/dhcpcd/dist/eloop.c U src/external/bsd/dhcpcd/dist/duid.c U src/external/bsd/dhcpcd/dist/dhcpcd.c U src/external/bsd/dhcpcd/dist/dhcp.c U src/external/bsd/dhcpcd/dist/control.c U src/external/bsd/dhcpcd/dist/common.c U src/external/bsd/dhcpcd/dist/bind.c U src/external/bsd/dhcpcd/dist/dhcpcd.conf.5.in U src/external/bsd/dhcpcd/dist/arp.h U src/external/bsd/dhcpcd/dist/net.h U src/external/bsd/dhcpcd/dist/ipv4ll.h U src/external/bsd/dhcpcd/dist/if-pref.h U src/external/bsd/dhcpcd/dist/if-options.h U src/external/bsd/dhcpcd/dist/eloop.h U src/external/bsd/dhcpcd/dist/duid.h U src/external/bsd/dhcpcd/dist/dhcpcd.h U src/external/bsd/dhcpcd/dist/dhcp.h N src/external/bsd/dhcpcd/dist/defs.h U src/external/bsd/dhcpcd/dist/control.h U src/external/bsd/dhcpcd/dist/configure.h U src/external/bsd/dhcpcd/dist/common.h U src/external/bsd/dhcpcd/dist/bpf-filter.h U src/external/bsd/dhcpcd/dist/bind.h U src/external/bsd/dhcpcd/dist/signals.h U src/external/bsd/dhcpcd/dist/config.h N src/external/bsd/dhcpcd/dist/compat/getline.h N src/external/bsd/dhcpcd/dist/compat/getline.c U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ntp.conf U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/30-hostname U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/29-lookup-hostname U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/20-resolv.conf U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/10-mtu U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/01-test 1 conflicts created by this import. Use the following command to help the merge: cvs checkout -jroy:yesterday -jroy src/external/bsd/dhcpcd/dist
CVS commit: src/sys/arch/i386/pci
Module Name:src Committed By: jmcneill Date: Fri Oct 2 21:27:45 UTC 2009 Modified Files: src/sys/arch/i386/pci: viapcib.c Log Message: match VT8237A To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/pci/viapcib.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/pci/viapcib.c diff -u src/sys/arch/i386/pci/viapcib.c:1.11 src/sys/arch/i386/pci/viapcib.c:1.12 --- src/sys/arch/i386/pci/viapcib.c:1.11 Sun Jul 20 16:59:53 2008 +++ src/sys/arch/i386/pci/viapcib.c Fri Oct 2 21:27:45 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: viapcib.c,v 1.11 2008/07/20 16:59:53 martin Exp $ */ +/* $NetBSD: viapcib.c,v 1.12 2009/10/02 21:27:45 jmcneill Exp $ */ /* $FreeBSD: src/sys/pci/viapm.c,v 1.10 2005/05/29 04:42:29 nyan Exp $ */ /*- @@ -55,7 +55,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: viapcib.c,v 1.11 2008/07/20 16:59:53 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: viapcib.c,v 1.12 2009/10/02 21:27:45 jmcneill Exp $"); #include #include @@ -148,6 +148,7 @@ switch (PCI_PRODUCT(pa->pa_id)) { case PCI_PRODUCT_VIATECH_VT8235: case PCI_PRODUCT_VIATECH_VT8237: + case PCI_PRODUCT_VIATECH_VT8237A_ISA: return 2; /* match above generic pcib(4) */ }
CVS commit: src/sys/sys
Module Name:src Committed By: christos Date: Fri Oct 2 21:05:28 UTC 2009 Modified Files: src/sys/sys: cdefs.h Log Message: lint knows __packed now. To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/sys/sys/cdefs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/sys/cdefs.h diff -u src/sys/sys/cdefs.h:1.77 src/sys/sys/cdefs.h:1.78 --- src/sys/sys/cdefs.h:1.77 Sat Aug 8 17:23:15 2009 +++ src/sys/sys/cdefs.h Fri Oct 2 17:05:28 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.77 2009/08/08 21:23:15 christos Exp $ */ +/* $NetBSD: cdefs.h,v 1.78 2009/10/02 21:05:28 christos Exp $ */ /* * Copyright (c) 1991, 1993 @@ -228,7 +228,11 @@ #define __used __unused #endif -#if __GNUC_PREREQ__(2, 7) +#if defined(__lint__) +#define __packed __packed +#define __aligned(x) /* delete */ +#define __section(x) /* delete */ +#elif __GNUC_PREREQ__(2, 7) #define __packed __attribute__((__packed__)) #define __aligned(x) __attribute__((__aligned__(x))) #define __section(x) __attribute__((__section__(x))) @@ -236,10 +240,6 @@ #define __packed _Pragma("packed 1") #define __aligned(x) _Pragma("aligned " __STRING(x)) #define __section(x) _Pragma("section " ## x) -#elif defined(__lint__) -#define __packed /* delete */ -#define __aligned(x) /* delete */ -#define __section(x) /* delete */ #else #define __packed error: no __packed for this compiler #define __aligned(x) error: no __aligned for this compiler
CVS commit: src/external/apache2/mDNSResponder/dist
Module Name:src Committed By: christos Date: Fri Oct 2 21:05:10 UTC 2009 Modified Files: src/external/apache2/mDNSResponder/dist/mDNSCore: mDNSEmbeddedAPI.h src/external/apache2/mDNSResponder/dist/mDNSShared: dnssd_ipc.h Log Message: if __packed exists, use it. I might revert this later when I fully implement attribute for lint. To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 \ src/external/apache2/mDNSResponder/dist/mDNSCore/mDNSEmbeddedAPI.h cvs rdiff -u -r1.1.1.1 -r1.2 \ src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_ipc.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/apache2/mDNSResponder/dist/mDNSCore/mDNSEmbeddedAPI.h diff -u src/external/apache2/mDNSResponder/dist/mDNSCore/mDNSEmbeddedAPI.h:1.1.1.1 src/external/apache2/mDNSResponder/dist/mDNSCore/mDNSEmbeddedAPI.h:1.2 --- src/external/apache2/mDNSResponder/dist/mDNSCore/mDNSEmbeddedAPI.h:1.1.1.1 Tue Sep 29 18:14:06 2009 +++ src/external/apache2/mDNSResponder/dist/mDNSCore/mDNSEmbeddedAPI.h Fri Oct 2 17:05:10 2009 @@ -1040,7 +1040,10 @@ // In the event that structures are not packed correctly, mDNS_Init() will detect this and report an error, so the // developer will know what's wrong, and can investigate what needs to be done on that compiler to provide proper packing. #ifndef packedstruct - #if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 9))) + #ifdef __packed + #define packedstruct struct __packed + #define packedunion union __packed + #elif ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 9))) #define packedstruct struct __attribute__((__packed__)) #define packedunion union __attribute__((__packed__)) #else Index: src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_ipc.h diff -u src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_ipc.h:1.1.1.1 src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_ipc.h:1.2 --- src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_ipc.h:1.1.1.1 Tue Sep 29 18:14:16 2009 +++ src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_ipc.h Fri Oct 2 17:05:10 2009 @@ -234,7 +234,10 @@ // structures correctly anyway, so a plain "struct" is usually fine. In the event that structures are not packed // correctly, our compile-time assertion checks will catch it and prevent inadvertent generation of non-working code. #ifndef packedstruct - #if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 9))) + #ifdef __packed + #define packedstruct struct __packed + #define packedunion union __packed + #elif ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 9))) #define packedstruct struct __attribute__((__packed__)) #define packedunion union __attribute__((__packed__)) #else
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: christos Date: Fri Oct 2 21:04:03 UTC 2009 Modified Files: src/usr.bin/xlint/lint1: decl.c externs1.h tree.c Log Message: compute sizes by the new tsize() function. To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.28 -r1.29 src/usr.bin/xlint/lint1/externs1.h cvs rdiff -u -r1.61 -r1.62 src/usr.bin/xlint/lint1/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/decl.c diff -u src/usr.bin/xlint/lint1/decl.c:1.49 src/usr.bin/xlint/lint1/decl.c:1.50 --- src/usr.bin/xlint/lint1/decl.c:1.49 Fri Oct 2 16:45:06 2009 +++ src/usr.bin/xlint/lint1/decl.c Fri Oct 2 17:04:03 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.49 2009/10/02 20:45:06 christos Exp $ */ +/* $NetBSD: decl.c,v 1.50 2009/10/02 21:04:03 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: decl.c,v 1.49 2009/10/02 20:45:06 christos Exp $"); +__RCSID("$NetBSD: decl.c,v 1.50 2009/10/02 21:04:03 christos Exp $"); #endif #include @@ -497,14 +497,16 @@ case STRUCT: sp = tp->t_str; sp->size = 0; - for (mem = sp->memb; mem != NULL; mem = mem->s_nxt) - sp->size += size(mem->s_type->t_tspec); + for (mem = sp->memb; mem != NULL; mem = mem->s_nxt) { + size_t x = (size_t)tsize(mem->s_type); + sp->size += x; + } break; case UNION: sp = tp->t_str; sp->size = 0; for (mem = sp->memb; mem != NULL; mem = mem->s_nxt) { - size_t x = size(mem->s_type->t_tspec); + size_t x = (size_t)tsize(mem->s_type); if (x > sp->size) sp->size = x; } Index: src/usr.bin/xlint/lint1/externs1.h diff -u src/usr.bin/xlint/lint1/externs1.h:1.28 src/usr.bin/xlint/lint1/externs1.h:1.29 --- src/usr.bin/xlint/lint1/externs1.h:1.28 Fri Oct 2 11:03:45 2009 +++ src/usr.bin/xlint/lint1/externs1.h Fri Oct 2 17:04:03 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: externs1.h,v 1.28 2009/10/02 15:03:45 christos Exp $ */ +/* $NetBSD: externs1.h,v 1.29 2009/10/02 21:04:03 christos Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -210,6 +210,7 @@ extern void chkmisc(tnode_t *, int, int, int, int, int, int); extern int conaddr(tnode_t *, sym_t **, ptrdiff_t *); extern strg_t *catstrg(strg_t *, strg_t *); +extern int64_t tsize(type_t *); /* * func.c Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.61 src/usr.bin/xlint/lint1/tree.c:1.62 --- src/usr.bin/xlint/lint1/tree.c:1.61 Fri Oct 2 15:02:16 2009 +++ src/usr.bin/xlint/lint1/tree.c Fri Oct 2 17:04:03 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.61 2009/10/02 19:02:16 christos Exp $ */ +/* $NetBSD: tree.c,v 1.62 2009/10/02 21:04:03 christos Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: tree.c,v 1.61 2009/10/02 19:02:16 christos Exp $"); +__RCSID("$NetBSD: tree.c,v 1.62 2009/10/02 21:04:03 christos Exp $"); #endif #include @@ -3030,14 +3030,26 @@ return (getcnode(tn->tn_type, v)); } + /* * Create a constant node for sizeof. */ tnode_t * bldszof(type_t *tp) { - int elem, elsz; tspec_t st; +#if SIZEOF_IS_ULONG + st = ULONG; +#else + st = UINT; +#endif + return getinode(st, tsize(tp) / CHAR_BIT); +} + +int64_t +tsize(type_t *tp) +{ + int elem, elsz; elem = 1; while (tp->t_tspec == ARRAY) { @@ -3088,12 +3100,7 @@ break; } -#if SIZEOF_IS_ULONG - st = ULONG; -#else - st = UINT; -#endif - return (getinode(st, (int64_t)(elem * elsz / CHAR_BIT))); + return (int64_t)(elem * elsz); } /*
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: christos Date: Fri Oct 2 20:45:06 UTC 2009 Modified Files: src/usr.bin/xlint/lint1: decl.c Log Message: fix typedef struct __packed To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/usr.bin/xlint/lint1/decl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/decl.c diff -u src/usr.bin/xlint/lint1/decl.c:1.48 src/usr.bin/xlint/lint1/decl.c:1.49 --- src/usr.bin/xlint/lint1/decl.c:1.48 Fri Oct 2 15:01:13 2009 +++ src/usr.bin/xlint/lint1/decl.c Fri Oct 2 16:45:06 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.48 2009/10/02 19:01:13 christos Exp $ */ +/* $NetBSD: decl.c,v 1.49 2009/10/02 20:45:06 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: decl.c,v 1.48 2009/10/02 19:01:13 christos Exp $"); +__RCSID("$NetBSD: decl.c,v 1.49 2009/10/02 20:45:06 christos Exp $"); #endif #include @@ -254,8 +254,10 @@ addtype(type_t *tp) { tspec_t t; -// char buf[1024]; -// printf("addtype %s\n", tyname(buf, sizeof(buf), tp)); +#ifdef DEBUG + char buf[1024]; + printf("addtype %s\n", tyname(buf, sizeof(buf), tp)); +#endif if (tp->t_typedef) { if (dcs->d_type != NULL || dcs->d_atyp != NOTSPEC || dcs->d_lmod != NOTSPEC || dcs->d_smod != NOTSPEC) { @@ -516,9 +518,9 @@ void addpacked(void) { - if (dcs->d_type == NULL) { + if (dcs->d_type == NULL) dcs->d_ispacked = 1; - } else + else setpackedsize(dcs->d_type); } @@ -1639,6 +1641,7 @@ tag->s_scl = scl; tag->s_blklev = -1; tag->s_type = tp = getblk(sizeof (type_t)); + tp->t_ispacked = dcs->d_ispacked; dcs->d_nxt->d_nedecl = 1; }
CVS commit: src
Module Name:src Committed By: elad Date: Fri Oct 2 20:31:19 UTC 2009 Modified Files: src/sbin/mount: mount.8 src/share/man/man7: sysctl.7 src/share/man/man9: secmodel_securelevel.9 secmodel_suser.9 Log Message: Centralize documentation about exported sysctl variables in the relevant secmodel's man-page. To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/sbin/mount/mount.8 cvs rdiff -u -r1.24 -r1.25 src/share/man/man7/sysctl.7 cvs rdiff -u -r1.6 -r1.7 src/share/man/man9/secmodel_securelevel.9 cvs rdiff -u -r1.2 -r1.3 src/share/man/man9/secmodel_suser.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.8 diff -u src/sbin/mount/mount.8:1.67 src/sbin/mount/mount.8:1.68 --- src/sbin/mount/mount.8:1.67 Mon Feb 23 08:14:53 2009 +++ src/sbin/mount/mount.8 Fri Oct 2 20:31:19 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount.8,v 1.67 2009/02/23 08:14:53 wiz Exp $ +.\" $NetBSD: mount.8,v 1.68 2009/10/02 20:31:19 elad Exp $ .\" .\" Copyright (c) 1980, 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 .\" -.Dd February 22, 2009 +.Dd October 2, 2009 .Dt MOUNT 8 .Os .Sh NAME @@ -133,23 +133,10 @@ .Pp In .Nx , -a file system can only be mounted by an ordinary user who owns the -point -.Ar node -and has access to the -.Ar special -device (at least read permissions). -Also, the -.Em vfs.generic.usermount -.Xr sysctl 3 -must be set to 1 to permit file system mounting by ordinary users, -see -.Xr sysctl 8 . -Finally, the flags -.Cm nosuid -and -.Cm nodev -must be given for non-superuser mounts. +the file-system mounting policy is dictated by the running security models. +The default security model may allow unprivileged mounting; see +.Xr secmodel_suser 9 +for details. .Pp The options are as follows: .Bl -tag -width indent Index: src/share/man/man7/sysctl.7 diff -u src/share/man/man7/sysctl.7:1.24 src/share/man/man7/sysctl.7:1.25 --- src/share/man/man7/sysctl.7:1.24 Fri Sep 11 19:43:26 2009 +++ src/share/man/man7/sysctl.7 Fri Oct 2 20:31:19 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: sysctl.7,v 1.24 2009/09/11 19:43:26 wiz Exp $ +.\" $NetBSD: sysctl.7,v 1.25 2009/10/02 20:31:19 elad Exp $ .\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95 .\" -.Dd September 11, 2009 +.Dd October 2, 2009 .Dt SYSCTL 7 .Os .Sh NAME @@ -713,9 +713,8 @@ Maximum socket buffer size. .\" XXX units? .It Li kern.securelevel ( KERN_SECURELVL ) -The system security level. -This level may be raised by processes with appropriate privilege. -It may only be lowered by process 1. +See +.Xr secmodel_securelevel 9 . .It Li kern.somaxkva ( KERN_SOMAXKVA ) Maximum amount of kernel memory to be used for socket buffers. .\" XXX units? Index: src/share/man/man9/secmodel_securelevel.9 diff -u src/share/man/man9/secmodel_securelevel.9:1.6 src/share/man/man9/secmodel_securelevel.9:1.7 --- src/share/man/man9/secmodel_securelevel.9:1.6 Sat Jul 25 16:20:11 2009 +++ src/share/man/man9/secmodel_securelevel.9 Fri Oct 2 20:31:19 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: secmodel_securelevel.9,v 1.6 2009/07/25 16:20:11 mbalmer Exp $ +.\" $NetBSD: secmodel_securelevel.9,v 1.7 2009/10/02 20:31:19 elad Exp $ .\" .\" Copyright (c) 2006 Elad Efrat .\" Copyright (c) 2000 Hugh Graham @@ -180,6 +180,16 @@ interpreter, through any mechanism) and the kernel itself are "programs that run while the security level is 0" and must be considered part of the TCB. +.Pp +The following +.Xr sysctl 3 +variables are exported: +.Bl -tag -width compact +.It security.models.securelevel.securelevel +The system security level. +This level may be raised by processes with appropriate privilege. +It may only be lowered by process 1 (init). +.El .Sh SEE ALSO .Xr kauth 9 , .Xr secmodel 9 , Index: src/share/man/man9/secmodel_suser.9 diff -u src/share/man/man9/secmodel_suser.9:1.2 src/share/man/man9/secmodel_suser.9:1.3 --- src/share/man/man9/secmodel_suser.9:1.2 Fri Oct 2 19:50:37 2009 +++ src/share/man/man9/secmodel_suser.9 Fri Oct 2 20:31:19 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: secmodel_suser.9,v 1.2 2009/10/02 19:50:37 elad Exp $ +.\" $NetBSD: secmodel_suser.9,v 1.3 2009/10/02 20:31:19 elad Exp $ .\" .\" Copyright (c) 2009 Elad Efrat .\" All rights reserved. @@ -41,6 +41,43 @@ .Em super-user is the host administrator, considered to have higher privileges than other users. +.Pp +The following +.Xr sysctl 3 +variables are exported: +.Bl -tag -width compact +.It security.models.suser.curtain +If non-zero, will filter returned objects according to the user-id +requesting information about them, preventing from users any access to +objects they don't own. +.Pp +At the moment, it affects +.Xr ps 1 , +.Xr netstat
CVS commit: src/sys/secmodel/securelevel
Module Name:src Committed By: elad Date: Fri Oct 2 20:15:07 UTC 2009 Modified Files: src/sys/secmodel/securelevel: secmodel_securelevel.c Log Message: Create securelevel variable under securelevel node. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 \ src/sys/secmodel/securelevel/secmodel_securelevel.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/secmodel/securelevel/secmodel_securelevel.c diff -u src/sys/secmodel/securelevel/secmodel_securelevel.c:1.14 src/sys/secmodel/securelevel/secmodel_securelevel.c:1.15 --- src/sys/secmodel/securelevel/secmodel_securelevel.c:1.14 Fri Oct 2 18:50:14 2009 +++ src/sys/secmodel/securelevel/secmodel_securelevel.c Fri Oct 2 20:15:07 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_securelevel.c,v 1.14 2009/10/02 18:50:14 elad Exp $ */ +/* $NetBSD: secmodel_securelevel.c,v 1.15 2009/10/02 20:15:07 elad Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_securelevel.c,v 1.14 2009/10/02 18:50:14 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_securelevel.c,v 1.15 2009/10/02 20:15:07 elad Exp $"); #ifdef _KERNEL_OPT #include "opt_insecure.h" @@ -118,6 +118,13 @@ NULL, 0, __UNCONST("Traditional NetBSD: Securelevel"), 0, CTL_CREATE, CTL_EOL); + sysctl_createv(clog, 0, &rnode, NULL, + CTLFLAG_PERMANENT|CTLFLAG_READWRITE, + CTLTYPE_INT, "securelevel", + SYSCTL_DESCR("System security level"), + secmodel_securelevel_sysctl, 0, NULL, 0, + CTL_CREATE, CTL_EOL); + /* Compatibility: kern.securelevel */ sysctl_createv(clog, 0, NULL, NULL, CTLFLAG_PERMANENT,
CVS commit: src
Module Name:src Committed By: elad Date: Fri Oct 2 19:50:37 UTC 2009 Modified Files: src/sbin/modstat: modstat.8 src/share/man/man9: secmodel_bsd44.9 secmodel_suser.9 Log Message: Bump date to today's date (rather than when the changes were made). To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sbin/modstat/modstat.8 cvs rdiff -u -r1.12 -r1.13 src/share/man/man9/secmodel_bsd44.9 cvs rdiff -u -r1.1 -r1.2 src/share/man/man9/secmodel_suser.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modstat/modstat.8 diff -u src/sbin/modstat/modstat.8:1.4 src/sbin/modstat/modstat.8:1.5 --- src/sbin/modstat/modstat.8:1.4 Fri Oct 2 18:50:14 2009 +++ src/sbin/modstat/modstat.8 Fri Oct 2 19:50:37 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: modstat.8,v 1.4 2009/10/02 18:50:14 elad Exp $ +.\" $NetBSD: modstat.8,v 1.5 2009/10/02 19:50:37 elad Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -32,7 +32,7 @@ .\" .\" <> .\" -.Dd September 29, 2009 +.Dd October 2, 2009 .Dt MODSTAT 8 .Os .Sh NAME Index: src/share/man/man9/secmodel_bsd44.9 diff -u src/share/man/man9/secmodel_bsd44.9:1.12 src/share/man/man9/secmodel_bsd44.9:1.13 --- src/share/man/man9/secmodel_bsd44.9:1.12 Fri Oct 2 18:50:13 2009 +++ src/share/man/man9/secmodel_bsd44.9 Fri Oct 2 19:50:37 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: secmodel_bsd44.9,v 1.12 2009/10/02 18:50:13 elad Exp $ +.\" $NetBSD: secmodel_bsd44.9,v 1.13 2009/10/02 19:50:37 elad Exp $ .\" .\" Copyright (c) 2006 Elad Efrat .\" All rights reserved. @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd September 29, 2009 +.Dd October 2, 2009 .Dt SECMODEL_BSD44 9 .Os .Sh NAME Index: src/share/man/man9/secmodel_suser.9 diff -u src/share/man/man9/secmodel_suser.9:1.1 src/share/man/man9/secmodel_suser.9:1.2 --- src/share/man/man9/secmodel_suser.9:1.1 Fri Oct 2 18:50:13 2009 +++ src/share/man/man9/secmodel_suser.9 Fri Oct 2 19:50:37 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: secmodel_suser.9,v 1.1 2009/10/02 18:50:13 elad Exp $ +.\" $NetBSD: secmodel_suser.9,v 1.2 2009/10/02 19:50:37 elad Exp $ .\" .\" Copyright (c) 2009 Elad Efrat .\" All rights reserved. @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd September 29, 2009 +.Dd October 2, 2009 .Dt SECMODEL_SUSER 9 .Os .Sh NAME
CVS commit: src/sys/secmodel
Module Name:src Committed By: elad Date: Fri Oct 2 19:41:45 UTC 2009 Removed Files: src/sys/secmodel: secmodel.h Log Message: Remove secmodel.h, forgotten in previous commit: http://mail-index.netbsd.org/source-changes/2009/10/02/msg001437.html To generate a diff of this commit: cvs rdiff -u -r1.2 -r0 src/sys/secmodel/secmodel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: christos Date: Fri Oct 2 19:02:16 UTC 2009 Modified Files: src/usr.bin/xlint/lint1: tree.c Log Message: remove debugging To generate a diff of this commit: cvs rdiff -u -r1.60 -r1.61 src/usr.bin/xlint/lint1/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.60 src/usr.bin/xlint/lint1/tree.c:1.61 --- src/usr.bin/xlint/lint1/tree.c:1.60 Fri Oct 2 15:01:14 2009 +++ src/usr.bin/xlint/lint1/tree.c Fri Oct 2 15:02:16 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.60 2009/10/02 19:01:14 christos Exp $ */ +/* $NetBSD: tree.c,v 1.61 2009/10/02 19:02:16 christos Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: tree.c,v 1.60 2009/10/02 19:01:14 christos Exp $"); +__RCSID("$NetBSD: tree.c,v 1.61 2009/10/02 19:02:16 christos Exp $"); #endif #include @@ -3093,7 +3093,6 @@ #else st = UINT; #endif -printf("size %p = %ld\n", tp, (int64_t)(elem * elsz / CHAR_BIT)); return (getinode(st, (int64_t)(elem * elsz / CHAR_BIT))); }
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: christos Date: Fri Oct 2 19:01:14 UTC 2009 Modified Files: src/usr.bin/xlint/lint1: cgram.y decl.c lint1.h tree.c Log Message: recognize struct __packed x { }; in addition to struct x { } __packed; To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/usr.bin/xlint/lint1/cgram.y cvs rdiff -u -r1.47 -r1.48 src/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.23 -r1.24 src/usr.bin/xlint/lint1/lint1.h cvs rdiff -u -r1.59 -r1.60 src/usr.bin/xlint/lint1/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/cgram.y diff -u src/usr.bin/xlint/lint1/cgram.y:1.45 src/usr.bin/xlint/lint1/cgram.y:1.46 --- src/usr.bin/xlint/lint1/cgram.y:1.45 Fri Oct 2 11:03:45 2009 +++ src/usr.bin/xlint/lint1/cgram.y Fri Oct 2 15:01:13 2009 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.45 2009/10/02 15:03:45 christos Exp $ */ +/* $NetBSD: cgram.y,v 1.46 2009/10/02 19:01:13 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: cgram.y,v 1.45 2009/10/02 15:03:45 christos Exp $"); +__RCSID("$NetBSD: cgram.y,v 1.46 2009/10/02 19:01:13 christos Exp $"); #endif #include @@ -591,7 +591,8 @@ ; struct: - T_SOU { + struct type_attribute + | T_SOU { symtyp = FTAG; pushdecl($1 == STRUCT ? MOS : MOU); dcs->d_offset = 0; Index: src/usr.bin/xlint/lint1/decl.c diff -u src/usr.bin/xlint/lint1/decl.c:1.47 src/usr.bin/xlint/lint1/decl.c:1.48 --- src/usr.bin/xlint/lint1/decl.c:1.47 Fri Oct 2 11:03:45 2009 +++ src/usr.bin/xlint/lint1/decl.c Fri Oct 2 15:01:13 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.47 2009/10/02 15:03:45 christos Exp $ */ +/* $NetBSD: decl.c,v 1.48 2009/10/02 19:01:13 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: decl.c,v 1.47 2009/10/02 15:03:45 christos Exp $"); +__RCSID("$NetBSD: decl.c,v 1.48 2009/10/02 19:01:13 christos Exp $"); #endif #include @@ -484,19 +484,13 @@ } } -void -addpacked(void) +static void +setpackedsize(type_t *tp) { str_t *sp; sym_t *mem; - type_t *tp = dcs->d_type; char buf[256]; - if (tp == NULL) - LERROR("no type attr"); - - tp->t_ispacked = 1; - switch (tp->t_tspec) { case STRUCT: sp = tp->t_str; @@ -519,6 +513,15 @@ } } +void +addpacked(void) +{ + if (dcs->d_type == NULL) { + dcs->d_ispacked = 1; + } else + setpackedsize(dcs->d_type); +} + /* * Remember a qualifier which is part of the declaration specifiers * (and not the declarator) in the top element of the declaration stack. @@ -1624,6 +1627,7 @@ if (tag->s_scl == NOSCL) { tag->s_scl = scl; tag->s_type = tp = getblk(sizeof (type_t)); + tp->t_ispacked = dcs->d_ispacked; } else { tp = tag->s_type; } @@ -1733,7 +1737,6 @@ } /* - * Completes the type of a tag in a struct/union/enum declaration. * tp points to the type of the, tag, fmem to the list of members/enums. */ type_t * @@ -1751,8 +1754,11 @@ align(dcs->d_stralign, 0); sp = tp->t_str; sp->align = dcs->d_stralign; - sp->size = dcs->d_offset; sp->memb = fmem; + if (tp->t_ispacked) + setpackedsize(tp); + else + sp->size = dcs->d_offset; if (sp->size == 0) { /* zero sized %s */ (void)c99ism(47, ttab[t].tt_name); Index: src/usr.bin/xlint/lint1/lint1.h diff -u src/usr.bin/xlint/lint1/lint1.h:1.23 src/usr.bin/xlint/lint1/lint1.h:1.24 --- src/usr.bin/xlint/lint1/lint1.h:1.23 Fri Oct 2 11:03:45 2009 +++ src/usr.bin/xlint/lint1/lint1.h Fri Oct 2 15:01:14 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: lint1.h,v 1.23 2009/10/02 15:03:45 christos Exp $ */ +/* $NetBSD: lint1.h,v 1.24 2009/10/02 19:01:14 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -329,6 +329,7 @@ u_int d_proto : 1; /* current funct. decl. is prototype */ u_int d_notyp : 1; /* set if no type specifier was present */ u_int d_asm : 1; /* set if d_ctx == AUTO and asm() present */ + u_int d_ispacked : 1; /* packed */ type_t *d_tagtyp; /* tag during member declaration */ sym_t *d_fargs; /* list of arguments during function def. */ pos_t d_fdpos; /* position of function definition */ Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.59 src/usr.bin/xlint/lint1/tree.c:1.60 --- src/usr.bin/xlint/lint1/tree.c:1.59 Sat May 2 12:10:49 2009 +++ src/usr.bin/xlint/lint1/tree.c Fri Oct 2 15:01:14 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.59 2009/05/02 16:10:49 christos Exp $ */ +/* $NetBSD: tree.c,v 1.60 2009/10/02 19:01:14 christos Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: tree.c,v 1.59 2009/05/02 16:10:
CVS commit: src/doc
Module Name:src Committed By: jmcneill Date: Fri Oct 2 18:52:14 UTC 2009 Modified Files: src/doc: CHANGES Log Message: i386: Add support for VIA C7 temperature sensors. To generate a diff of this commit: cvs rdiff -u -r1.1301 -r1.1302 src/doc/CHANGES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.1301 src/doc/CHANGES:1.1302 --- src/doc/CHANGES:1.1301 Fri Oct 2 16:57:22 2009 +++ src/doc/CHANGES Fri Oct 2 18:52:13 2009 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1301 $> +# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1302 $> # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -415,3 +415,4 @@ [jmcneill 20091002] acpiwmi(4): Add a driver for the ACPI WMI Mapper interface. [jmcneill 20091002] + i386: Add support for VIA C7 temperature sensors. [jmcneill 20091002]
CVS commit: src/sys/arch/i386/conf
Module Name:src Committed By: jmcneill Date: Fri Oct 2 18:50:49 UTC 2009 Modified Files: src/sys/arch/i386/conf: ALL GENERIC Log Message: Add and enable options VIA_C7TEMP To generate a diff of this commit: cvs rdiff -u -r1.217 -r1.218 src/sys/arch/i386/conf/ALL cvs rdiff -u -r1.948 -r1.949 src/sys/arch/i386/conf/GENERIC Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/conf/ALL diff -u src/sys/arch/i386/conf/ALL:1.217 src/sys/arch/i386/conf/ALL:1.218 --- src/sys/arch/i386/conf/ALL:1.217 Fri Oct 2 16:47:52 2009 +++ src/sys/arch/i386/conf/ALL Fri Oct 2 18:50:49 2009 @@ -1,4 +1,4 @@ -# $NetBSD: ALL,v 1.217 2009/10/02 16:47:52 jmcneill Exp $ +# $NetBSD: ALL,v 1.218 2009/10/02 18:50:49 jmcneill Exp $ # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp # # ALL machine description file @@ -17,7 +17,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "ALL-$Revision: 1.217 $" +#ident "ALL-$Revision: 1.218 $" maxusers 32 # estimated number of users @@ -638,6 +638,9 @@ # Intel Core's on-die Thermal sensor options INTEL_CORETEMP +# VIA C7 Temperature sensor +options VIA_C7TEMP + # Intel ICH SMBus controller ichsmb* at pci? dev ? function ? iic* at ichsmb? Index: src/sys/arch/i386/conf/GENERIC diff -u src/sys/arch/i386/conf/GENERIC:1.948 src/sys/arch/i386/conf/GENERIC:1.949 --- src/sys/arch/i386/conf/GENERIC:1.948 Fri Oct 2 16:47:52 2009 +++ src/sys/arch/i386/conf/GENERIC Fri Oct 2 18:50:49 2009 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.948 2009/10/02 16:47:52 jmcneill Exp $ +# $NetBSD: GENERIC,v 1.949 2009/10/02 18:50:49 jmcneill Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.948 $" +#ident "GENERIC-$Revision: 1.949 $" maxusers 64 # estimated number of users @@ -622,6 +622,9 @@ # Intel Core's on-die Thermal sensor options INTEL_CORETEMP +# VIA C7 Temperature sensor +options VIA_C7TEMP + # Intel ICH SMBus controller ichsmb* at pci? dev ? function ? iic* at ichsmb?
CVS commit: src/sys/arch/x86
Module Name:src Committed By: jmcneill Date: Fri Oct 2 18:50:03 UTC 2009 Modified Files: src/sys/arch/x86/conf: files.x86 src/sys/arch/x86/include: cpuvar.h src/sys/arch/x86/x86: identcpu.c Added Files: src/sys/arch/x86/x86: viac7temp.c Log Message: Add support for VIA C7 temperature sensors (options VIA_C7TEMP) To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/sys/arch/x86/conf/files.x86 cvs rdiff -u -r1.30 -r1.31 src/sys/arch/x86/include/cpuvar.h cvs rdiff -u -r1.16 -r1.17 src/sys/arch/x86/x86/identcpu.c cvs rdiff -u -r0 -r1.1 src/sys/arch/x86/x86/viac7temp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/conf/files.x86 diff -u src/sys/arch/x86/conf/files.x86:1.52 src/sys/arch/x86/conf/files.x86:1.53 --- src/sys/arch/x86/conf/files.x86:1.52 Thu Apr 30 00:07:23 2009 +++ src/sys/arch/x86/conf/files.x86 Fri Oct 2 18:50:03 2009 @@ -1,4 +1,4 @@ -# $NetBSD: files.x86,v 1.52 2009/04/30 00:07:23 rmind Exp $ +# $NetBSD: files.x86,v 1.53 2009/10/02 18:50:03 jmcneill Exp $ # options for MP configuration through the MP spec defflag opt_mpbios.h MPBIOS MPVERBOSE MPDEBUG MPBIOS_SCANPCI @@ -26,6 +26,9 @@ # AMD Powernow/Cool`n'Quiet Technology defflag opt_powernow_k8.h POWERNOW_K8 +# VIA C7 Temperature sensor +defflag opt_via_c7temp.h VIA_C7TEMP: sysmon_envsys + # VIA PadLock support defflag opt_viapadlock.h VIA_PADLOCK: opencrypto file arch/x86/x86/via_padlock.c via_padlock @@ -104,6 +107,9 @@ # Intel On-Die Temperature sensor file arch/x86/x86/coretemp.c intel_coretemp +# VIA C7 Temperature sensor +file arch/x86/x86/viac7temp.c via_c7temp + # IPMI device device ipmi: sysmon_envsys, sysmon_wdog attach ipmi at ipmibus Index: src/sys/arch/x86/include/cpuvar.h diff -u src/sys/arch/x86/include/cpuvar.h:1.30 src/sys/arch/x86/include/cpuvar.h:1.31 --- src/sys/arch/x86/include/cpuvar.h:1.30 Fri Oct 2 15:05:42 2009 +++ src/sys/arch/x86/include/cpuvar.h Fri Oct 2 18:50:03 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: cpuvar.h,v 1.30 2009/10/02 15:05:42 jmcneill Exp $ */ +/* $NetBSD: cpuvar.h,v 1.31 2009/10/02 18:50:03 jmcneill Exp $ */ /*- * Copyright (c) 2000, 2007 The NetBSD Foundation, Inc. @@ -92,6 +92,7 @@ #ifndef XEN #include "opt_intel_coretemp.h" #include "opt_intel_odcm.h" +#include "opt_via_c7temp.h" #endif #endif /* defined(_KERNEL_OPT) */ @@ -118,6 +119,10 @@ void x86_cpu_idle_xen(void); #endif +#ifdef VIA_C7TEMP +void viac7temp_register(struct cpu_info *); +#endif + #ifdef INTEL_CORETEMP void coretemp_register(struct cpu_info *); #endif Index: src/sys/arch/x86/x86/identcpu.c diff -u src/sys/arch/x86/x86/identcpu.c:1.16 src/sys/arch/x86/x86/identcpu.c:1.17 --- src/sys/arch/x86/x86/identcpu.c:1.16 Thu Apr 30 00:07:23 2009 +++ src/sys/arch/x86/x86/identcpu.c Fri Oct 2 18:50:03 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: identcpu.c,v 1.16 2009/04/30 00:07:23 rmind Exp $ */ +/* $NetBSD: identcpu.c,v 1.17 2009/10/02 18:50:03 jmcneill Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -30,11 +30,12 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.16 2009/04/30 00:07:23 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.17 2009/10/02 18:50:03 jmcneill Exp $"); #include "opt_enhanced_speedstep.h" #include "opt_intel_odcm.h" #include "opt_intel_coretemp.h" +#include "opt_via_c7temp.h" #include "opt_powernow_k8.h" #include "opt_xen.h" #ifdef i386 /* XXX */ @@ -751,6 +752,18 @@ coretemp_register(ci); #endif +#ifdef VIA_C7TEMP + if (cpu_vendor == CPUVENDOR_IDT && + CPUID2FAMILY(ci->ci_signature) == 6 && + CPUID2MODEL(ci->ci_signature) >= 0x9) { + uint32_t descs[4]; + + x86_cpuid(0xc000, descs); + if (descs[0] >= 0xc002) /* has temp sensor */ + viac7temp_register(ci); + } +#endif + #if defined(POWERNOW_K7) || defined(POWERNOW_K8) if (cpu_vendor == CPUVENDOR_AMD && powernow_probe(ci)) { switch (CPUID2FAMILY(ci->ci_signature)) { Added files: Index: src/sys/arch/x86/x86/viac7temp.c diff -u /dev/null src/sys/arch/x86/x86/viac7temp.c:1.1 --- /dev/null Fri Oct 2 18:50:03 2009 +++ src/sys/arch/x86/x86/viac7temp.c Fri Oct 2 18:50:03 2009 @@ -0,0 +1,115 @@ +/* $NetBSD: viac7temp.c,v 1.1 2009/10/02 18:50:03 jmcneill Exp $ */ + +/*- + * Copyright (c) 2009 Jared D. McNeill + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTW
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: christos Date: Fri Oct 2 18:17:16 UTC 2009 Modified Files: src/usr.bin/xlint/lint1: init.c Log Message: change initialization from non const of regular variables to c99 instead of gnu since c99 now has it. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/usr.bin/xlint/lint1/init.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/init.c diff -u src/usr.bin/xlint/lint1/init.c:1.23 src/usr.bin/xlint/lint1/init.c:1.24 --- src/usr.bin/xlint/lint1/init.c:1.23 Sat Apr 26 12:14:23 2008 +++ src/usr.bin/xlint/lint1/init.c Fri Oct 2 14:17:16 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: init.c,v 1.23 2008/04/26 16:14:23 christos Exp $ */ +/* $NetBSD: init.c,v 1.24 2009/10/02 18:17:16 christos Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: init.c,v 1.23 2008/04/26 16:14:23 christos Exp $"); +__RCSID("$NetBSD: init.c,v 1.24 2009/10/02 18:17:16 christos Exp $"); #endif #include @@ -587,7 +587,7 @@ if (conaddr(tn, &sym, &offs) == -1) { if (sc == AUTO || sc == REG) { /* non-constant initializer */ -(void)gnuism(177); +(void)c99ism(177); } else { /* non-constant initializer */ error(177);
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Fri Oct 2 18:03:19 UTC 2009 Modified Files: src/tools/compat: compat_defs.h Log Message: split all the password and group translation functions into individual ifdefs instead of having a large one. To generate a diff of this commit: cvs rdiff -u -r1.72 -r1.73 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.72 src/tools/compat/compat_defs.h:1.73 --- src/tools/compat/compat_defs.h:1.72 Tue Feb 24 17:25:24 2009 +++ src/tools/compat/compat_defs.h Fri Oct 2 14:03:19 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.72 2009/02/24 22:25:24 sketch Exp $ */ +/* $NetBSD: compat_defs.h,v 1.73 2009/10/02 18:03:19 christos Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -345,36 +345,60 @@ * XXX host system has all of these functions, all of their interfaces * XXX and interactions are exactly the same as in our libc/libutil -- ugh. */ -#if !HAVE_USER_FROM_UID || !HAVE_UID_FROM_USER || !HAVE_GROUP_FROM_GID || \ -!HAVE_GID_FROM_GROUP || !HAVE_PWCACHE_USERDB || !HAVE_PWCACHE_GROUDB -/* Make them use our version */ -# define user_from_uid __nbcompat_user_from_uid -# define uid_from_user __nbcompat_uid_from_user -# define pwcache_userdb __nbcompat_pwcache_userdb -# define group_from_gid __nbcompat_group_from_gid -# define gid_from_group __nbcompat_gid_from_group -# define pwcache_groupdb __nbcompat_pwcache_groupdb +#if !HAVE_USER_FROM_UID +# define user_from_uid __nbcompat_user_from_uid +# undef HAVE_DECL_USER_FROM_UID +#endif + +#if !HAVE_UID_FROM_USER +# define uid_from_user __nbcompat_uid_from_user +# undef HAVE_DECL_UID_FROM_USER +#endif + +#if !HAVE_PWCACHE_USERDB +# define pwcache_userdb __nbcompat_pwcache_userdb +# undef HAVE_DECL_PWCACHE_USERDB +#endif + +#if !HAVE_GROUP_FROM_GID +# define group_from_gid __nbcompat_group_from_gid +# undef HAVE_DECL_GROUP_FROM_GID +#endif + +#if !HAVE_GID_FROM_GROUP +# define gid_from_group __nbcompat_gid_from_group +# undef HAVE_DECL_GID_FROM_GROUP +#endif + +#if !HAVE_PWCACHE_GROUDB +# define pwcache_groupdb __nbcompat_pwcache_groupdb +# undef HAVE_DECL_PWCACHE_GROUPDB #endif #if !HAVE_DECL_UID_FROM_USER int uid_from_user(const char *, uid_t *); #endif + #if !HAVE_DECL_USER_FROM_UID const char *user_from_uid(uid_t, int); #endif + #if !HAVE_DECL_PWCACHE_USERDB int pwcache_userdb(int (*)(int), void (*)(void), -struct passwd * (*)(const char *), struct passwd * (*)(uid_t)); +struct passwd * (*)(const char *), struct passwd * (*)(uid_t)); #endif + #if !HAVE_DECL_GID_FROM_GROUP int gid_from_group(const char *, gid_t *); #endif + #if !HAVE_DECL_GROUP_FROM_GID const char *group_from_gid(gid_t, int); #endif + #if !HAVE_DECL_PWCACHE_GROUPDB int pwcache_groupdb(int (*)(int), void (*)(void), -struct group * (*)(const char *), struct group * (*)(gid_t)); +struct group * (*)(const char *), struct group * (*)(gid_t)); #endif #if !HAVE_DECL_STRNDUP
CVS commit: src/share/man/man4/man4.sparc64
Module Name:src Committed By: wiz Date: Fri Oct 2 17:48:39 UTC 2009 Modified Files: src/share/man/man4/man4.sparc64: lom.4 Log Message: Fix Dd argument. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/man4.sparc64/lom.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/man4.sparc64/lom.4 diff -u src/share/man/man4/man4.sparc64/lom.4:1.1 src/share/man/man4/man4.sparc64/lom.4:1.2 --- src/share/man/man4/man4.sparc64/lom.4:1.1 Fri Oct 2 15:09:16 2009 +++ src/share/man/man4/man4.sparc64/lom.4 Fri Oct 2 17:48:39 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: lom.4,v 1.1 2009/10/02 15:09:16 nakayama Exp $ +.\" $NetBSD: lom.4,v 1.2 2009/10/02 17:48:39 wiz Exp $ .\" $OpenBSD: lom.4,v 1.4 2009/09/23 22:08:07 kettenis Exp $ .\" .\" Copyright (c) 2009 Mark Kettenis @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: October 2 2009 $ +.Dd October 2, 2009 .Dt LOM 4 sparc64 .Os .Sh NAME
CVS commit: src/doc
Module Name:src Committed By: jmcneill Date: Fri Oct 2 16:57:22 UTC 2009 Modified Files: src/doc: CHANGES Log Message: acpiwmi(4): Add a driver for the ACPI WMI Mapper interface. To generate a diff of this commit: cvs rdiff -u -r1.1300 -r1.1301 src/doc/CHANGES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.1300 src/doc/CHANGES:1.1301 --- src/doc/CHANGES:1.1300 Fri Oct 2 16:19:19 2009 +++ src/doc/CHANGES Fri Oct 2 16:57:22 2009 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1300 $> +# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1301 $> # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -413,3 +413,5 @@ hardware monitor and watchdog timer. [nakayama 20091002] i386: Add support for enhanced speedstep on VIA C7 Esther CPUs. [jmcneill 20091002] + acpiwmi(4): Add a driver for the ACPI WMI Mapper interface. + [jmcneill 20091002]
CVS commit: src/sys
Module Name:src Committed By: jmcneill Date: Fri Oct 2 16:47:52 UTC 2009 Modified Files: src/sys/arch/amd64/conf: GENERIC src/sys/arch/i386/conf: ALL GENERIC src/sys/dev/acpi: files.acpi Added Files: src/sys/dev/acpi: wmi_acpi.c wmi_acpivar.h Log Message: PR# kern/42139: ACPI WMI: new driver Import acpiwmi(4) from Jukka Ruohonen. From the PR: Attached is a driver that implements ACPI WMI API: http://www.microsoft.com/whdc/system/pnppwr/wmi/wmi-acpi.mspx The WMI is used to provide a generic interface for OEMs to use certain platform/laptop-specific additions to the standard ACPI in a somewhat portable way. These can be hotkeys for additional buttons, different event handlers (wireless kill switch, lid switch, etc.), and so on. At least HP and Acer use it by default nowadays. The benefit of this interface would be portability. For an example, instead of hpqlb(4) that works only with certain HP models, we could have a generic HP WMI-driver that should work in theory across all HP laptops. On many new laptops WMI may also be the only way to access laptop/manufacturer-specific features. To generate a diff of this commit: cvs rdiff -u -r1.256 -r1.257 src/sys/arch/amd64/conf/GENERIC cvs rdiff -u -r1.216 -r1.217 src/sys/arch/i386/conf/ALL cvs rdiff -u -r1.947 -r1.948 src/sys/arch/i386/conf/GENERIC cvs rdiff -u -r1.59 -r1.60 src/sys/dev/acpi/files.acpi cvs rdiff -u -r0 -r1.1 src/sys/dev/acpi/wmi_acpi.c \ src/sys/dev/acpi/wmi_acpivar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/conf/GENERIC diff -u src/sys/arch/amd64/conf/GENERIC:1.256 src/sys/arch/amd64/conf/GENERIC:1.257 --- src/sys/arch/amd64/conf/GENERIC:1.256 Wed Sep 30 22:19:27 2009 +++ src/sys/arch/amd64/conf/GENERIC Fri Oct 2 16:47:52 2009 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.256 2009/09/30 22:19:27 jmcneill Exp $ +# $NetBSD: GENERIC,v 1.257 2009/10/02 16:47:52 jmcneill Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.256 $" +#ident "GENERIC-$Revision: 1.257 $" maxusers 64 # estimated number of users @@ -279,6 +279,7 @@ acpiecdt* at acpi? # ACPI Embedded Controller (early binding) acpilid* at acpi? # ACPI Lid Switch acpitz* at acpi? # ACPI Thermal Zone +acpiwmi* at acpi? # ACPI WMI Mapper # Mainboard devices aiboost* at acpi? # ASUS AI Booster Hardware monitor Index: src/sys/arch/i386/conf/ALL diff -u src/sys/arch/i386/conf/ALL:1.216 src/sys/arch/i386/conf/ALL:1.217 --- src/sys/arch/i386/conf/ALL:1.216 Wed Sep 30 22:19:00 2009 +++ src/sys/arch/i386/conf/ALL Fri Oct 2 16:47:52 2009 @@ -1,4 +1,4 @@ -# $NetBSD: ALL,v 1.216 2009/09/30 22:19:00 jmcneill Exp $ +# $NetBSD: ALL,v 1.217 2009/10/02 16:47:52 jmcneill Exp $ # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp # # ALL machine description file @@ -17,7 +17,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "ALL-$Revision: 1.216 $" +#ident "ALL-$Revision: 1.217 $" maxusers 32 # estimated number of users @@ -351,6 +351,7 @@ acpiecdt* at acpi? # ACPI Embedded Controller (early binding) acpilid* at acpi? # ACPI Lid Switch acpitz* at acpi? # ACPI Thermal Zone +acpiwmi* at acpi? # ACPI WMI Mapper # Mainboard devices aiboost* at acpi? # ASUS AI Booster Hardware monitor Index: src/sys/arch/i386/conf/GENERIC diff -u src/sys/arch/i386/conf/GENERIC:1.947 src/sys/arch/i386/conf/GENERIC:1.948 --- src/sys/arch/i386/conf/GENERIC:1.947 Wed Sep 30 22:19:00 2009 +++ src/sys/arch/i386/conf/GENERIC Fri Oct 2 16:47:52 2009 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.947 2009/09/30 22:19:00 jmcneill Exp $ +# $NetBSD: GENERIC,v 1.948 2009/10/02 16:47:52 jmcneill Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.947 $" +#ident "GENERIC-$Revision: 1.948 $" maxusers 64 # estimated number of users @@ -361,6 +361,7 @@ acpiecdt* at acpi? # ACPI Embedded Controller (early binding) acpilid* at acpi? # ACPI Lid Switch acpitz* at acpi? # ACPI Thermal Zone +acpiwmi* at acpi? # ACPI WMI Mapper # Mainboard devices aiboost* at acpi? # ASUS AI Booster Hardware Monitor Index: src/sys/dev/acpi/files.acpi diff -u src/sys/dev/acpi/files.acpi:1.59 src/sys/dev/acpi/files.acpi:1.60 --- src/sys/dev/acpi/files.acpi:1.59 Wed Sep 30 20:44:50 2009 +++ src/sys/dev/acpi/files.acpi Fri Oct 2 16:47:52 2009 @@ -1,4 +1,4 @@ -# $NetBSD: files.acpi,v 1.59 2009/09/30 20:44:50 jmcneill Exp $ +# $NetBSD: files.acpi,v 1.60 2009/10/02 16:47:52 jmcneill Exp $ include "dev/acpi/acpica/files.acpica" @@ -145,3 +145,8 @@ # Winbond Integrated Media Reader attach wb at acpinodebus with wb_acpi file dev/acpi/wb_acpi.c wb_acpi + +# ACPI-WM
CVS commit: src/doc
Module Name:src Committed By: jmcneill Date: Fri Oct 2 16:19:19 UTC 2009 Modified Files: src/doc: CHANGES Log Message: i386: Add support for enhanced speedstep on VIA C7 Esther CPUs. To generate a diff of this commit: cvs rdiff -u -r1.1299 -r1.1300 src/doc/CHANGES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.1299 src/doc/CHANGES:1.1300 --- src/doc/CHANGES:1.1299 Fri Oct 2 15:12:48 2009 +++ src/doc/CHANGES Fri Oct 2 16:19:19 2009 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1299 $> +# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1300 $> # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -411,3 +411,5 @@ [tsarna 20090929] lom(4), sparc64: Add a driver for LOMlite lights out management hardware monitor and watchdog timer. [nakayama 20091002] + i386: Add support for enhanced speedstep on VIA C7 Esther CPUs. + [jmcneill 20091002]
CVS commit: src/sys/rump/librump/rumpkern
Module Name:src Committed By: pooka Date: Fri Oct 2 15:51:26 UTC 2009 Modified Files: src/sys/rump/librump/rumpkern: Makefile.rumpkern Log Message: Include humanize and extent support in rumpkern. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sys/rump/librump/rumpkern/Makefile.rumpkern Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/rump/librump/rumpkern/Makefile.rumpkern diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.48 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.49 --- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.48 Wed Sep 16 15:10:23 2009 +++ src/sys/rump/librump/rumpkern/Makefile.rumpkern Fri Oct 2 15:51:26 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rumpkern,v 1.48 2009/09/16 15:10:23 pooka Exp $ +# $NetBSD: Makefile.rumpkern,v 1.49 2009/10/02 15:51:26 pooka Exp $ # .include "${RUMPTOP}/Makefile.rump" @@ -35,9 +35,10 @@ sys_descrip.c sys_generic.c syscalls.c # sys/kern subr (misc) -SRCS+= subr_devsw.c subr_callback.c subr_evcnt.c subr_hash.c \ - subr_iostat.c subr_kobj.c subr_log.c subr_once.c subr_prf.c \ - subr_specificdata.c subr_time.c subr_workqueue.c +SRCS+= subr_devsw.c subr_callback.c subr_evcnt.c subr_extent.c \ + subr_hash.c subr_humanize.c subr_iostat.c subr_kobj.c \ + subr_log.c subr_once.c subr_prf.c subr_specificdata.c \ + subr_time.c subr_workqueue.c # 4.4BSD secmodel. selection is hardcoded for now SRCS+= secmodel_bsd44.c secmodel_bsd44_logic.c secmodel_bsd44_suser.c
CVS commit: src/sys
Module Name:src Committed By: pooka Date: Fri Oct 2 15:48:42 UTC 2009 Modified Files: src/sys/conf: files src/sys/kern: kern_subr.c Added Files: src/sys/kern: subr_humanize.c Log Message: Give humanize_number & format_bytes their own spots in the sun and move from kern_subr to subr_humanize. To generate a diff of this commit: cvs rdiff -u -r1.958 -r1.959 src/sys/conf/files cvs rdiff -u -r1.200 -r1.201 src/sys/kern/kern_subr.c cvs rdiff -u -r0 -r1.1 src/sys/kern/subr_humanize.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/conf/files diff -u src/sys/conf/files:1.958 src/sys/conf/files:1.959 --- src/sys/conf/files:1.958 Wed Sep 30 20:44:49 2009 +++ src/sys/conf/files Fri Oct 2 15:48:41 2009 @@ -1,4 +1,4 @@ -# $NetBSD: files,v 1.958 2009/09/30 20:44:49 jmcneill Exp $ +# $NetBSD: files,v 1.959 2009/10/02 15:48:41 pooka Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 version 20090313 @@ -1483,6 +1483,7 @@ file kern/subr_exec_fd.c file kern/subr_extent.c file kern/subr_hash.c +file kern/subr_humanize.c file kern/subr_kmem.c file kern/subr_kobj.c file kern/subr_lockdebug.c Index: src/sys/kern/kern_subr.c diff -u src/sys/kern/kern_subr.c:1.200 src/sys/kern/kern_subr.c:1.201 --- src/sys/kern/kern_subr.c:1.200 Fri Sep 25 19:21:09 2009 +++ src/sys/kern/kern_subr.c Fri Oct 2 15:48:41 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_subr.c,v 1.200 2009/09/25 19:21:09 dyoung Exp $ */ +/* $NetBSD: kern_subr.c,v 1.201 2009/10/02 15:48:41 pooka Exp $ */ /*- * Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008 The NetBSD Foundation, Inc. @@ -79,7 +79,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.200 2009/09/25 19:21:09 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.201 2009/10/02 15:48:41 pooka Exp $"); #include "opt_ddb.h" #include "opt_md.h" @@ -1220,78 +1220,6 @@ } /* - * snprintf() `bytes' into `buf', reformatting it so that the number, - * plus a possible `x' + suffix extension) fits into len bytes (including - * the terminating NUL). - * Returns the number of bytes stored in buf, or -1 if there was a problem. - * E.g, given a len of 9 and a suffix of `B': - * bytes result - * - -- - * 9 `9 B' - * 10 `97 kB' - * 66715648 `65152 kB' - * 252215296 `240 MB' - */ -int -humanize_number(char *buf, size_t len, uint64_t bytes, const char *suffix, -int divisor) -{ - /* prefixes are: (none), kilo, Mega, Giga, Tera, Peta, Exa */ - const char *prefixes; - int r; - uint64_t umax; - size_t i, suffixlen; - - if (buf == NULL || suffix == NULL) - return (-1); - if (len > 0) - buf[0] = '\0'; - suffixlen = strlen(suffix); - /* check if enough room for `x y' + suffix + `\0' */ - if (len < 4 + suffixlen) - return (-1); - - if (divisor == 1024) { - /* - * binary multiplies - * XXX IEC 60027-2 recommends Ki, Mi, Gi... - */ - prefixes = " KMGTPE"; - } else - prefixes = " kMGTPE"; /* SI for decimal multiplies */ - - umax = 1; - for (i = 0; i < len - suffixlen - 3; i++) { - umax *= 10; - if (umax > bytes) - break; - } - for (i = 0; bytes >= umax && prefixes[i + 1]; i++) - bytes /= divisor; - - r = snprintf(buf, len, "%qu%s%c%s", (unsigned long long)bytes, - i == 0 ? "" : " ", prefixes[i], suffix); - - return (r); -} - -int -format_bytes(char *buf, size_t len, uint64_t bytes) -{ - int rv; - size_t nlen; - - rv = humanize_number(buf, len, bytes, "B", 1024); - if (rv != -1) { - /* nuke the trailing ` B' if it exists */ - nlen = strlen(buf) - 2; - if (strcmp(&buf[nlen], " B") == 0) - buf[nlen] = '\0'; - } - return (rv); -} - -/* * Return true if system call tracing is enabled for the specified process. */ bool Added files: Index: src/sys/kern/subr_humanize.c diff -u /dev/null src/sys/kern/subr_humanize.c:1.1 --- /dev/null Fri Oct 2 15:48:42 2009 +++ src/sys/kern/subr_humanize.c Fri Oct 2 15:48:41 2009 @@ -0,0 +1,108 @@ +/* $NetBSD: subr_humanize.c,v 1.1 2009/10/02 15:48:41 pooka Exp $ */ + +/*- + * Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Luke Mewburn. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPL
CVS commit: src/sys/rump/dev/wip/librumpusbhc
Module Name:src Committed By: pooka Date: Fri Oct 2 15:35:46 UTC 2009 Added Files: src/sys/rump/dev/wip/librumpusbhc: Makefile rumpusbhc.c shlib_version Log Message: Checkpoint rump usb host controller implementation. It's pretty barebones, but manages to succesfully probe and attach the two USB memory sticks I own. (I don't own much USB junk, *hint hint*) "dmesg": pain-rustique:50:~> ./rumpusbprobe mainbus0 (root) rumpusbhc0 at mainbus0 usb0 at rumpusbhc0: USB revision 2.0 uhub0 at usb0: vendor 0x product 0x, class 9/0, rev 0.00/0.00, addr 1 umass0 at uhub0 port 1 configuration 1 interface 0 umass0: vendor 0x1221 product 0x3234, rev 2.00/0.00, addr 2 scsibus0 at umass0: 2 targets, 1 lun per target sd0 at scsibus0 target 0 lun 0: disk removable sd0: fabricating a geometry sd0: 2023 MB, 2023 cyl, 64 head, 32 sec, 512 bytes/sect x 4143104 sectors [switch the other stick in] pain-rustique:51:~> ./rumpusbprobe mainbus0 (root) rumpusbhc0 at mainbus0 usb0 at rumpusbhc0: USB revision 2.0 uhub0 at usb0: vendor 0x product 0x, class 9/0, rev 0.00/0.00, addr 1 umass0 at uhub0 port 1 configuration 1 interface 0 umass0: Kingston Technology product 0x1603, rev 2.00/2.00, addr 2 scsibus0 at umass0: 2 targets, 1 lun per target sd0 at scsibus0 target 0 lun 0: disk removable sd0: fabricating a geometry sd0: 974 MB, 974 cyl, 64 head, 32 sec, 512 bytes/sect x 1994752 sectors pain-rustique:52:~> To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/rump/dev/wip/librumpusbhc/Makefile \ src/sys/rump/dev/wip/librumpusbhc/rumpusbhc.c \ src/sys/rump/dev/wip/librumpusbhc/shlib_version Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/rump/dev/wip/librumpusbhc/Makefile diff -u /dev/null src/sys/rump/dev/wip/librumpusbhc/Makefile:1.1 --- /dev/null Fri Oct 2 15:35:46 2009 +++ src/sys/rump/dev/wip/librumpusbhc/Makefile Fri Oct 2 15:35:46 2009 @@ -0,0 +1,9 @@ +# $NetBSD: Makefile,v 1.1 2009/10/02 15:35:46 pooka Exp $ +# + +LIB= rumpdev_usbhc + +SRCS= rumpusbhc.c + +.include +.include Index: src/sys/rump/dev/wip/librumpusbhc/rumpusbhc.c diff -u /dev/null src/sys/rump/dev/wip/librumpusbhc/rumpusbhc.c:1.1 --- /dev/null Fri Oct 2 15:35:46 2009 +++ src/sys/rump/dev/wip/librumpusbhc/rumpusbhc.c Fri Oct 2 15:35:46 2009 @@ -0,0 +1,851 @@ +/* $NetBSD: rumpusbhc.c,v 1.1 2009/10/02 15:35:46 pooka Exp $ */ + +/* + * Copyright (c) 2009 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Lennart Augustsson (lenn...@augustsson.net) at + * Carlstedt Research & Technology. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXE
CVS commit: src/sys/dev
Module Name:src Committed By: nakayama Date: Fri Oct 2 15:15:21 UTC 2009 Modified Files: src/sys/dev: DEVNAMES Log Message: Add lom(4) for sparc64. To generate a diff of this commit: cvs rdiff -u -r1.251 -r1.252 src/sys/dev/DEVNAMES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/DEVNAMES diff -u src/sys/dev/DEVNAMES:1.251 src/sys/dev/DEVNAMES:1.252 --- src/sys/dev/DEVNAMES:1.251 Sun Aug 9 14:32:07 2009 +++ src/sys/dev/DEVNAMES Fri Oct 2 15:15:21 2009 @@ -1,4 +1,4 @@ -# $NetBSD: DEVNAMES,v 1.251 2009/08/09 14:32:07 haad Exp $ +# $NetBSD: DEVNAMES,v 1.252 2009/10/02 15:15:21 nakayama Exp $ # # This file contains all used device names and defined attributes in # alphabetical order. New devices added to the system somewhere should first @@ -732,6 +732,7 @@ lms bebox lms i386 lockstat MI +lom sparc64 lp atari lp vax lpa vax
CVS commit: src/doc
Module Name:src Committed By: nakayama Date: Fri Oct 2 15:12:48 UTC 2009 Modified Files: src/doc: CHANGES Log Message: Note about lom(4). To generate a diff of this commit: cvs rdiff -u -r1.1298 -r1.1299 src/doc/CHANGES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.1298 src/doc/CHANGES:1.1299 --- src/doc/CHANGES:1.1298 Fri Oct 2 07:17:16 2009 +++ src/doc/CHANGES Fri Oct 2 15:12:48 2009 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1298 $> +# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1299 $> # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -409,3 +409,5 @@ [jmcneill 20090930] mdnsd(8), dns-sd(1), libdns_sd: import mDNSResponder 212.1 [tsarna 20090929] + lom(4), sparc64: Add a driver for LOMlite lights out management + hardware monitor and watchdog timer. [nakayama 20091002]
CVS commit: src
Module Name:src Committed By: nakayama Date: Fri Oct 2 15:09:16 UTC 2009 Modified Files: src/distrib/sets/lists/man: mi src/share/man/man4/man4.sparc64: Makefile src/sys/arch/sparc64/conf: GENERIC files.sparc64 Added Files: src/share/man/man4/man4.sparc64: lom.4 src/sys/arch/sparc64/dev: lom.c Log Message: Port lom(4) driver for LOMlite lights out management hardware monitor and watchdog timer from OpenBSD. It supports the LOMlite found on Sun Netra t1 and the LOMlite2 found on Sun Netra T1/X1 and Sun Fire V100/V120. To generate a diff of this commit: cvs rdiff -u -r1.1160 -r1.1161 src/distrib/sets/lists/man/mi cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/man4.sparc64/Makefile cvs rdiff -u -r0 -r1.1 src/share/man/man4/man4.sparc64/lom.4 cvs rdiff -u -r1.110 -r1.111 src/sys/arch/sparc64/conf/GENERIC cvs rdiff -u -r1.120 -r1.121 src/sys/arch/sparc64/conf/files.sparc64 cvs rdiff -u -r0 -r1.1 src/sys/arch/sparc64/dev/lom.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/man/mi diff -u src/distrib/sets/lists/man/mi:1.1160 src/distrib/sets/lists/man/mi:1.1161 --- src/distrib/sets/lists/man/mi:1.1160 Wed Sep 30 22:32:04 2009 +++ src/distrib/sets/lists/man/mi Fri Oct 2 15:09:16 2009 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1160 2009/09/30 22:32:04 jmcneill Exp $ +# $NetBSD: mi,v 1.1161 2009/10/02 15:09:16 nakayama Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -1461,6 +1461,7 @@ ./usr/share/man/cat4/sparc64/envctrl.0 man-sys-catman .cat ./usr/share/man/cat4/sparc64/fdc.0 man-sys-catman .cat ./usr/share/man/cat4/sparc64/intro.0 man-sys-catman .cat +./usr/share/man/cat4/sparc64/lom.0 man-sys-catman .cat ./usr/share/man/cat4/sparc64/sab.0 man-sys-catman .cat ./usr/share/man/cat4/sparc64/sabtty.0 man-sys-catman .cat ./usr/share/man/cat4/spc.0 man-sys-catman .cat @@ -4012,6 +4013,7 @@ ./usr/share/man/html4/sparc64/envctrl.html man-sys-htmlman html ./usr/share/man/html4/sparc64/fdc.html man-sys-htmlman html ./usr/share/man/html4/sparc64/intro.html man-sys-htmlman html +./usr/share/man/html4/sparc64/lom.html man-sys-htmlman html ./usr/share/man/html4/sparc64/sab.html man-sys-htmlman html ./usr/share/man/html4/sparc64/sabtty.html man-sys-htmlman html ./usr/share/man/html4/spc.html man-sys-htmlman html @@ -6479,6 +6481,7 @@ ./usr/share/man/man4/sparc64/envctrl.4 man-sys-man .man ./usr/share/man/man4/sparc64/fdc.4 man-sys-man .man ./usr/share/man/man4/sparc64/intro.4 man-sys-man .man +./usr/share/man/man4/sparc64/lom.4 man-sys-man .man ./usr/share/man/man4/sparc64/sab.4 man-sys-man .man ./usr/share/man/man4/sparc64/sabtty.4 man-sys-man .man ./usr/share/man/man4/spc.4 man-sys-man .man Index: src/share/man/man4/man4.sparc64/Makefile diff -u src/share/man/man4/man4.sparc64/Makefile:1.4 src/share/man/man4/man4.sparc64/Makefile:1.5 --- src/share/man/man4/man4.sparc64/Makefile:1.4 Tue May 8 19:23:18 2007 +++ src/share/man/man4/man4.sparc64/Makefile Fri Oct 2 15:09:16 2009 @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.4 2007/05/08 19:23:18 jnemeth Exp $ +# $NetBSD: Makefile,v 1.5 2009/10/02 15:09:16 nakayama Exp $ MANSUBDIR=/sparc64 -MAN= envctrl.4 fdc.4 intro.4 sab.4 +MAN= envctrl.4 fdc.4 intro.4 lom.4 sab.4 MLINKS+= sab.4 sabtty.4 Index: src/sys/arch/sparc64/conf/GENERIC diff -u src/sys/arch/sparc64/conf/GENERIC:1.110 src/sys/arch/sparc64/conf/GENERIC:1.111 --- src/sys/arch/sparc64/conf/GENERIC:1.110 Fri Mar 6 20:31:52 2009 +++ src/sys/arch/sparc64/conf/GENERIC Fri Oct 2 15:09:16 2009 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.110 2009/03/06 20:31:52 joerg Exp $ +# $NetBSD: GENERIC,v 1.111 2009/10/02 15:09:16 nakayama Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.110 $" +#ident "GENERIC-$Revision: 1.111 $" maxusers 64 @@ -884,6 +884,7 @@ psm* at ebus? # Ultrabook IIi microcontroller envctrl* at ebus? # Ultra E450 environmental monitoring +lom* at ebus? # LOMlite lights out management # Netra X1 / T1 style environmental monitoring alipm* at pci? Index: src/sys/arch/sparc64/conf/files.sparc64 diff -u src/sys/arch/sparc64/conf/files.sparc64:1.120 src/sys/arch/sparc64/conf/files.sparc64:1.121 --- src/sys/arch/sparc64/conf/files.sparc64:1.120 Wed Dec 10 05:56:22 2008 +++ src/sys/arch/sparc64/conf/files.sparc64 Fri Oct 2 15:09:16 2009 @@ -1,4 +1,4 @@ -# $NetBSD: files.sparc64,v 1.120 2008/12/10 05:56:22 mrg Exp $ +# $NetBSD: files.sparc64,v 1.121 2009/10/02 15:09:16 nakayama Exp $ # @(#)files.sparc64 8.1 (Berkeley) 7/19/93 # sparc64-specific configuration info @@ -67,6 +67,10 @@ attach envctrl at ebus file arch/sparc64/dev/envctrl.c envctrl +device lom: sysmon_envsys, sysmon_wdog +attach lom at ebus +file arch
CVS commit: src/sys/arch/x86
Module Name:src Committed By: jmcneill Date: Fri Oct 2 15:05:42 UTC 2009 Modified Files: src/sys/arch/x86/include: cpuvar.h src/sys/arch/x86/x86: est.c intel_busclock.c Log Message: Use the TSC and current multiplier to calculate bus clock on VIA C7 Esther. Probably needed for all C7 and Nano processors, but to be safe only use this alternate method on Esther for now. Now est on my C7-M 1.6GHz properly reports frequencies from 1600 to 400, instead of 2133 to 533. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/arch/x86/include/cpuvar.h cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x86/x86/est.c cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x86/x86/intel_busclock.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/include/cpuvar.h diff -u src/sys/arch/x86/include/cpuvar.h:1.29 src/sys/arch/x86/include/cpuvar.h:1.30 --- src/sys/arch/x86/include/cpuvar.h:1.29 Wed Aug 5 20:15:36 2009 +++ src/sys/arch/x86/include/cpuvar.h Fri Oct 2 15:05:42 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: cpuvar.h,v 1.29 2009/08/05 20:15:36 jym Exp $ */ +/* $NetBSD: cpuvar.h,v 1.30 2009/10/02 15:05:42 jmcneill Exp $ */ /*- * Copyright (c) 2000, 2007 The NetBSD Foundation, Inc. @@ -129,6 +129,7 @@ #ifdef ENHANCED_SPEEDSTEP void est_init(int); int via_get_bus_clock(struct cpu_info *); +int viac7_get_bus_clock(struct cpu_info *); int p3_get_bus_clock(struct cpu_info *); int p4_get_bus_clock(struct cpu_info *); #endif Index: src/sys/arch/x86/x86/est.c diff -u src/sys/arch/x86/x86/est.c:1.11 src/sys/arch/x86/x86/est.c:1.12 --- src/sys/arch/x86/x86/est.c:1.11 Wed Mar 25 22:53:51 2009 +++ src/sys/arch/x86/x86/est.c Fri Oct 2 15:05:42 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: est.c,v 1.11 2009/03/25 22:53:51 dyoung Exp $ */ +/* $NetBSD: est.c,v 1.12 2009/10/02 15:05:42 jmcneill Exp $ */ /* * Copyright (c) 2003 Michael Eriksson. * All rights reserved. @@ -81,7 +81,7 @@ /* #define EST_DEBUG */ #include -__KERNEL_RCSID(0, "$NetBSD: est.c,v 1.11 2009/03/25 22:53:51 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: est.c,v 1.12 2009/10/02 15:05:42 jmcneill Exp $"); #include #include @@ -1089,9 +1089,17 @@ if (CPUID2FAMILY(curcpu()->ci_signature) == 15) bus_clock = p4_get_bus_clock(curcpu()); else if (CPUID2FAMILY(curcpu()->ci_signature) == 6) { - if (vendor == CPUVENDOR_IDT) - bus_clock = via_get_bus_clock(curcpu()); - else + if (vendor == CPUVENDOR_IDT) { + switch (CPUID2MODEL(curcpu()->ci_signature)) { + case 0xa: /* C7 Esther */ + case 0xd: /* C7 Esther */ +bus_clock = viac7_get_bus_clock(curcpu()); +break; + default: +bus_clock = via_get_bus_clock(curcpu()); +break; + } + } else bus_clock = p3_get_bus_clock(curcpu()); } Index: src/sys/arch/x86/x86/intel_busclock.c diff -u src/sys/arch/x86/x86/intel_busclock.c:1.7 src/sys/arch/x86/x86/intel_busclock.c:1.8 --- src/sys/arch/x86/x86/intel_busclock.c:1.7 Wed Mar 25 22:53:51 2009 +++ src/sys/arch/x86/x86/intel_busclock.c Fri Oct 2 15:05:42 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_busclock.c,v 1.7 2009/03/25 22:53:51 dyoung Exp $ */ +/* $NetBSD: intel_busclock.c,v 1.8 2009/10/02 15:05:42 jmcneill Exp $ */ /*- * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intel_busclock.c,v 1.7 2009/03/25 22:53:51 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intel_busclock.c,v 1.8 2009/10/02 15:05:42 jmcneill Exp $"); #include #include @@ -73,6 +73,21 @@ } int +viac7_get_bus_clock(struct cpu_info *ci) +{ + uint64_t msr; + int mult; + + msr = rdmsr(MSR_PERF_STATUS); + mult = (msr >> 8) & 0xff; + if (mult == 0) + return 0; + + return ((ci->ci_data.cpu_cc_freq + 1000) / 1000 * 1000) / + mult / 1; +} + +int p3_get_bus_clock(struct cpu_info *ci) { uint64_t msr;
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: christos Date: Fri Oct 2 15:03:45 UTC 2009 Modified Files: src/usr.bin/xlint/lint1: cgram.y decl.c err.c externs1.h lint1.h scan.l Log Message: understand __attribute__((__packed__)) and __packed. To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/usr.bin/xlint/lint1/cgram.y \ src/usr.bin/xlint/lint1/scan.l cvs rdiff -u -r1.46 -r1.47 src/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.42 -r1.43 src/usr.bin/xlint/lint1/err.c cvs rdiff -u -r1.27 -r1.28 src/usr.bin/xlint/lint1/externs1.h cvs rdiff -u -r1.22 -r1.23 src/usr.bin/xlint/lint1/lint1.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/cgram.y diff -u src/usr.bin/xlint/lint1/cgram.y:1.44 src/usr.bin/xlint/lint1/cgram.y:1.45 --- src/usr.bin/xlint/lint1/cgram.y:1.44 Sat May 2 12:10:49 2009 +++ src/usr.bin/xlint/lint1/cgram.y Fri Oct 2 11:03:45 2009 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.44 2009/05/02 16:10:49 christos Exp $ */ +/* $NetBSD: cgram.y,v 1.45 2009/10/02 15:03:45 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: cgram.y,v 1.44 2009/05/02 16:10:49 christos Exp $"); +__RCSID("$NetBSD: cgram.y,v 1.45 2009/10/02 15:03:45 christos Exp $"); #endif #include @@ -182,6 +182,18 @@ %token T_RETURN %token T_ASM %token T_SYMBOLRENAME +%token T_PACKED +/* Type Attributes */ +%token T_ATTRIBUTE +%token T_AT_ALIGNED +%token T_AT_DEPRECATED +%token T_AT_MAY_ALIAS +%token T_AT_PACKED +%token T_AT_TUINION +%token T_AT_TUNION +%token T_AT_UNUSED + + %left T_COMMA %right T_ASSIGN T_OPASS @@ -212,6 +224,8 @@ %type notype_typespec %type struct_spec %type enum_spec +%type type_attribute +%type type_attribute_spec %type struct_tag %type enum_tag %type struct @@ -454,6 +468,24 @@ | error T_SEMI ; +type_attribute_spec: + T_AT_DEPRECATED + | T_AT_ALIGNED T_LPARN constant T_RPARN + | T_AT_MAY_ALIAS + | T_AT_PACKED { + addpacked(); + } + | T_AT_TUNION + | T_AT_UNUSED + ; + +type_attribute: + T_ATTRIBUTE T_LPARN T_LPARN type_attribute_spec T_RPARN T_RPARN + | T_PACKED { + addpacked(); + } + ; + clrtyp: { clrtyp(); @@ -473,6 +505,7 @@ | declmods typespec { addtype($2); } + | declspecs type_attribute | declspecs declmod | declspecs notype_typespec { addtype($2); Index: src/usr.bin/xlint/lint1/scan.l diff -u src/usr.bin/xlint/lint1/scan.l:1.44 src/usr.bin/xlint/lint1/scan.l:1.45 --- src/usr.bin/xlint/lint1/scan.l:1.44 Sat May 2 12:10:49 2009 +++ src/usr.bin/xlint/lint1/scan.l Fri Oct 2 11:03:45 2009 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: scan.l,v 1.44 2009/05/02 16:10:49 christos Exp $ */ +/* $NetBSD: scan.l,v 1.45 2009/10/02 15:03:45 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: scan.l,v 1.44 2009/05/02 16:10:49 christos Exp $"); +__RCSID("$NetBSD: scan.l,v 1.45 2009/10/02 15:03:45 christos Exp $"); #endif #include @@ -193,7 +193,21 @@ u_int kw_c99; /* c99 keyword */ u_int kw_gcc; /* GCC keyword */ } kwtab[] = { - { "__alignof__",T_ALIGNOF, 0, 0, 0, 0, 0, 0 }, + { "__alignof__", T_ALIGNOF, 0, 0, 0, 0, 0, 0 }, + { "__attribute__",T_ATTRIBUTE, 0, 0, 0, 0, 0, 1 }, + { "attribute", T_ATTRIBUTE, 0, 0, 0, 0, 0, 1 }, + { "__packed__", T_AT_PACKED, 0, 0, 0, 0, 0, 1 }, + { "packed", T_AT_PACKED, 0, 0, 0, 0, 0, 1 }, + { "__aligned__",T_AT_ALIGNED, 0, 0, 0, 0, 0, 1 }, + { "aligned", T_AT_ALIGNED, 0, 0, 0, 0, 0, 1 }, + { "__transparent_union__",T_AT_TUNION,0,0, 0, 0, 0, 1 }, + { "transparent_union",T_AT_TUNION,0, 0, 0, 0, 0, 1 }, + { "__unused__", T_AT_UNUSED, 0, 0, 0, 0, 0, 1 }, + { "unused", T_AT_UNUSED, 0, 0, 0, 0, 0, 1 }, + { "__deprecated__",T_AT_DEPRECATED,0, 0, 0, 0, 0, 1 }, + { "deprecated", T_AT_DEPRECATED,0, 0, 0, 0, 0, 1 }, + { "__may_alias__",T_AT_MAY_ALIAS,0, 0, 0, 0, 0, 1 }, + { "may_alias", T_AT_MAY_ALIAS, 0, 0, 0, 0, 0, 1 }, { "asm", T_ASM, 0, 0, 0, 0, 0, 1 }, { "__asm", T_ASM, 0, 0, 0, 0, 0, 0 }, { "__asm__", T_ASM, 0, 0, 0, 0, 0, 0 }, @@ -228,6 +242,7 @@ { "register", T_SCLASS, REG, 0, 0, 0, 0, 0 }, { "restrict", T_QUAL, 0, 0, RESTRICT, 0, 1, 0 }, { "return", T_RETURN, 0, 0, 0, 0, 0, 0 }, + { "__packed", T_PACKED, 0, 0, 0, 0, 0, 0 }, { "short", T_TYPE, 0, SHORT, 0, 0, 0, 0 }, { "signed", T_TYPE, 0, SIGNED, 0, 1, 0, 0 }, { "__signed__", T_TYPE, 0, SIGNED, 0, 0, 0, 0 }, Index: src/usr.bin/xlint/lint1/decl.c diff -u src/usr.bin/xlint/lint1/decl.c:1.46 src/usr.bin/xlint/lint1/decl.c:1.47 --- src/usr.bin/xlint/lint1/decl.c:1.46 Tue Apr 14 21:20:57 2009 +++ src/usr.bin/xlint/lint1/decl.c Fri Oct 2 11:03:45 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c
CVS commit: src/sys/dev/usb
Module Name:src Committed By: pooka Date: Fri Oct 2 14:40:37 UTC 2009 Modified Files: src/sys/dev/usb: usbdevs Log Message: add another vid for fujitsu To generate a diff of this commit: cvs rdiff -u -r1.532 -r1.533 src/sys/dev/usb/usbdevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usbdevs diff -u src/sys/dev/usb/usbdevs:1.532 src/sys/dev/usb/usbdevs:1.533 --- src/sys/dev/usb/usbdevs:1.532 Mon Sep 28 10:16:30 2009 +++ src/sys/dev/usb/usbdevs Fri Oct 2 14:40:36 2009 @@ -1,4 +1,4 @@ -$NetBSD: usbdevs,v 1.532 2009/09/28 10:16:30 pooka Exp $ +$NetBSD: usbdevs,v 1.533 2009/10/02 14:40:36 pooka Exp $ /* * Copyright (c) 1998-2004 The NetBSD Foundation, Inc. @@ -439,6 +439,7 @@ vendor SIERRA 0x1199 Sierra Wireless vendor TOPFIELD 0x11db Topfield Co., Ltd vendor NETINDEX 0x11f6 NetIndex +vendor FUJITSU2 0x1221 Fujitsu Ltd. vendor TSUNAMI 0x1241 Tsunami vendor TARGUS 0x1267 Targus vendor TWINMOS 0x126f TwinMOS
CVS commit: src/usr.sbin/cpuctl/arch
Module Name:src Committed By: jmcneill Date: Fri Oct 2 13:54:01 UTC 2009 Modified Files: src/usr.sbin/cpuctl/arch: i386.c Log Message: - add newer VIA C7 core and VIA Nano. - when printing an unknown VIA CPU, default to 'Unknown IDT/VIA' instead of 'C3' To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/cpuctl/arch/i386.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/cpuctl/arch/i386.c diff -u src/usr.sbin/cpuctl/arch/i386.c:1.19 src/usr.sbin/cpuctl/arch/i386.c:1.20 --- src/usr.sbin/cpuctl/arch/i386.c:1.19 Thu May 14 20:16:10 2009 +++ src/usr.sbin/cpuctl/arch/i386.c Fri Oct 2 13:54:01 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: i386.c,v 1.19 2009/05/14 20:16:10 pgoyette Exp $ */ +/* $NetBSD: i386.c,v 1.20 2009/10/02 13:54:01 jmcneill Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ #include #ifndef lint -__RCSID("$NetBSD: i386.c,v 1.19 2009/05/14 20:16:10 pgoyette Exp $"); +__RCSID("$NetBSD: i386.c,v 1.20 2009/10/02 13:54:01 jmcneill Exp $"); #endif /* not lint */ #include @@ -548,8 +548,9 @@ { 0, 0, 0, 0, 0, 0, "C3 Samuel", "C3 Samuel 2/Ezra", "C3 Ezra-T", -"C3 Nehemiah", "C7 Esther", 0, 0, 0, 0, 0, -"C3" /* Default */ +"C3 Nehemiah", "C7 Esther", 0, 0, "C7 Esther", +0, "VIA Nano", +"Unknown VIA/IDT" /* Default */ }, NULL, via_cpu_probe,
CVS commit: src/sys/rump/dev/wip/libusb
Module Name:src Committed By: pooka Date: Fri Oct 2 12:41:38 UTC 2009 Modified Files: src/sys/rump/dev/wip/libusb: Makefile Log Message: include usbroothub_subr.c To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/rump/dev/wip/libusb/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/rump/dev/wip/libusb/Makefile diff -u src/sys/rump/dev/wip/libusb/Makefile:1.1 src/sys/rump/dev/wip/libusb/Makefile:1.2 --- src/sys/rump/dev/wip/libusb/Makefile:1.1 Thu Oct 1 21:46:31 2009 +++ src/sys/rump/dev/wip/libusb/Makefile Fri Oct 2 12:41:38 2009 @@ -1,12 +1,12 @@ -# $NetBSD: Makefile,v 1.1 2009/10/01 21:46:31 pooka Exp $ +# $NetBSD: Makefile,v 1.2 2009/10/02 12:41:38 pooka Exp $ # .PATH: ${.CURDIR}/../../../../dev/usb LIB= rumpdev_usb -# sys/kern -SRCS= usb.c usbdi.c usbdi_util.c usb_mem.c usb_subr.c usb_quirks.c uhub.c +SRCS= usb.c usbdi.c usbdi_util.c usb_mem.c usb_subr.c usb_quirks.c \ + uhub.c usbroothub_subr.c # XXX: doesn't belong here by a longshot, but it's the easy choice for now SRCS+= bus_dma.c
CVS commit: src/sys/rump/librump/rumpdev
Module Name:src Committed By: pooka Date: Fri Oct 2 11:01:53 UTC 2009 Modified Files: src/sys/rump/librump/rumpdev: rump_dev.c Log Message: Hold on to your giantlocks while calling device autoconfusion. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/rump/librump/rumpdev/rump_dev.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/rump/librump/rumpdev/rump_dev.c diff -u src/sys/rump/librump/rumpdev/rump_dev.c:1.6 src/sys/rump/librump/rumpdev/rump_dev.c:1.7 --- src/sys/rump/librump/rumpdev/rump_dev.c:1.6 Thu Oct 1 21:43:29 2009 +++ src/sys/rump/librump/rumpdev/rump_dev.c Fri Oct 2 11:01:53 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rump_dev.c,v 1.6 2009/10/01 21:43:29 pooka Exp $ */ +/* $NetBSD: rump_dev.c,v 1.7 2009/10/02 11:01:53 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rump_dev.c,v 1.6 2009/10/01 21:43:29 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rump_dev.c,v 1.7 2009/10/02 11:01:53 pooka Exp $"); #include #include @@ -48,6 +48,8 @@ { extern int cold; + KERNEL_LOCK(1, curlwp); + config_init_mi(); rump_dev_cgd_init(); @@ -65,6 +67,8 @@ panic("no mainbus"); config_finalize(); + + KERNEL_UNLOCK_LAST(curlwp); } #ifdef __HAVE_DEVICE_REGISTER
CVS commit: src/sys/arch/amd64/conf
Module Name:src Committed By: skrll Date: Fri Oct 2 10:14:20 UTC 2009 Modified Files: src/sys/arch/amd64/conf: Makefile.amd64 Log Message: It's -z max-page-size, not -z maxpagesize. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/arch/amd64/conf/Makefile.amd64 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/conf/Makefile.amd64 diff -u src/sys/arch/amd64/conf/Makefile.amd64:1.27 src/sys/arch/amd64/conf/Makefile.amd64:1.28 --- src/sys/arch/amd64/conf/Makefile.amd64:1.27 Thu Oct 1 09:15:19 2009 +++ src/sys/arch/amd64/conf/Makefile.amd64 Fri Oct 2 10:14:20 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.amd64,v 1.27 2009/10/01 09:15:19 skrll Exp $ +# $NetBSD: Makefile.amd64,v 1.28 2009/10/02 10:14:20 skrll Exp $ # Makefile for NetBSD # @@ -66,7 +66,7 @@ ## (5) link settings ## TEXTADDR?= 0x8010 -EXTRA_LINKFLAGS= -z maxpagesize=0x10 +EXTRA_LINKFLAGS= -z max-page-size=0x10 LINKFLAGS_NORMAL= -X KERN_LDSCRIPT?= kern.ldscript LINKFORMAT= -T ${AMD64}/conf/${KERN_LDSCRIPT}
CVS commit: src/sys/rump/librump/rumpkern
Module Name:src Committed By: pooka Date: Fri Oct 2 09:56:08 UTC 2009 Modified Files: src/sys/rump/librump/rumpkern: locks.c Log Message: panic if cv_wait() is called in non-threaded mode To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/rump/librump/rumpkern/locks.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/rump/librump/rumpkern/locks.c diff -u src/sys/rump/librump/rumpkern/locks.c:1.27 src/sys/rump/librump/rumpkern/locks.c:1.28 --- src/sys/rump/librump/rumpkern/locks.c:1.27 Sat Feb 7 01:50:29 2009 +++ src/sys/rump/librump/rumpkern/locks.c Fri Oct 2 09:56:08 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: locks.c,v 1.27 2009/02/07 01:50:29 pooka Exp $ */ +/* $NetBSD: locks.c,v 1.28 2009/10/02 09:56:08 pooka Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -55,7 +55,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: locks.c,v 1.27 2009/02/07 01:50:29 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: locks.c,v 1.28 2009/10/02 09:56:08 pooka Exp $"); #include #include @@ -235,6 +235,8 @@ cv_wait(kcondvar_t *cv, kmutex_t *mtx) { + if (rump_threads == 0) + panic("cv_wait without threads"); rumpuser_cv_wait(RUMPCV(cv), RUMPMTX(mtx)); }
CVS commit: src/share/man/man9
Module Name:src Committed By: cegger Date: Fri Oct 2 09:38:29 UTC 2009 Modified Files: src/share/man/man9: byteorder.9 ioctl.9 Log Message: fix grammar: a -> an To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/share/man/man9/byteorder.9 cvs rdiff -u -r1.26 -r1.27 src/share/man/man9/ioctl.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man9/byteorder.9 diff -u src/share/man/man9/byteorder.9:1.3 src/share/man/man9/byteorder.9:1.4 --- src/share/man/man9/byteorder.9:1.3 Fri Apr 10 23:30:57 2009 +++ src/share/man/man9/byteorder.9 Fri Oct 2 09:38:29 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: byteorder.9,v 1.3 2009/04/10 23:30:57 tsutsui Exp $ +.\" $NetBSD: byteorder.9,v 1.4 2009/10/02 09:38:29 cegger Exp $ .\" .\" Copyright (c) 2002 Mike Barcroft .\" All rights reserved. @@ -147,7 +147,7 @@ .Fn htobe32 , and .Fn htobe64 -functions return a integer in the system's native +functions return an integer in the system's native byte order converted to big endian byte order. The return value will be the same as the argument on big endian systems. .Pp @@ -156,7 +156,7 @@ .Fn htole32 , and .Fn htole64 -functions return a integer in the system's native +functions return an integer in the system's native byte order converted to little endian byte order. The return value will be the same as the argument on little endian systems. .Pp Index: src/share/man/man9/ioctl.9 diff -u src/share/man/man9/ioctl.9:1.26 src/share/man/man9/ioctl.9:1.27 --- src/share/man/man9/ioctl.9:1.26 Wed Nov 12 12:35:54 2008 +++ src/share/man/man9/ioctl.9 Fri Oct 2 09:38:29 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: ioctl.9,v 1.26 2008/11/12 12:35:54 ad Exp $ +.\" $NetBSD: ioctl.9,v 1.27 2009/10/02 09:38:29 cegger Exp $ .\" .\" Copyright (c) 1999 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -233,7 +233,7 @@ .Ar n for a given .Ar t . -This is a unsigned 8 bit number. +This is an unsigned 8 bit number. .It Ar pt This specifies the type of the passed parameter. This one gets internally transformed to the size of the parameter, so
CVS commit: src/lib/libukfs
Module Name:src Committed By: pooka Date: Fri Oct 2 09:32:01 UTC 2009 Modified Files: src/lib/libukfs: ukfs.c ukfs.h Log Message: * allow callers to store a private data pointer behind the ukfs handle * release reference on root vnode before unmounting (and reaquire the root vnode if unmount fails) * return correct error value if unmount fails To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/lib/libukfs/ukfs.c cvs rdiff -u -r1.9 -r1.10 src/lib/libukfs/ukfs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libukfs/ukfs.c diff -u src/lib/libukfs/ukfs.c:1.36 src/lib/libukfs/ukfs.c:1.37 --- src/lib/libukfs/ukfs.c:1.36 Tue Sep 29 11:17:00 2009 +++ src/lib/libukfs/ukfs.c Fri Oct 2 09:32:01 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: ukfs.c,v 1.36 2009/09/29 11:17:00 pooka Exp $ */ +/* $NetBSD: ukfs.c,v 1.37 2009/10/02 09:32:01 pooka Exp $ */ /* * Copyright (c) 2007, 2008 Antti Kantee. All Rights Reserved. @@ -68,6 +68,7 @@ struct ukfs { struct mount *ukfs_mp; struct vnode *ukfs_rvp; + void *ukfs_specific; pthread_spinlock_t ukfs_spin; pid_t ukfs_nextpid; @@ -98,6 +99,20 @@ return rvp; } +void +ukfs_setspecific(struct ukfs *ukfs, void *priv) +{ + + ukfs->ukfs_specific = priv; +} + +void * +ukfs_getspecific(struct ukfs *ukfs) +{ + + return ukfs->ukfs_specific; +} + #ifdef DONT_WANT_PTHREAD_LINKAGE #define pthread_spin_lock(a) #define pthread_spin_unlock(a) @@ -302,20 +317,25 @@ { if ((flags & UKFS_RELFLAG_NOUNMOUNT) == 0) { - int rv, mntflag; + int rv, mntflag, error; ukfs_chdir(fs, "/"); mntflag = 0; if (flags & UKFS_RELFLAG_FORCE) mntflag = MNT_FORCE; rump_setup_curlwp(nextpid(fs), 1, 1); + rump_vp_rele(fs->ukfs_rvp); + fs->ukfs_rvp = NULL; rv = rump_sys_unmount(fs->ukfs_mountpath, mntflag); - rump_clear_curlwp(); - if (rv) { + if (rv == -1) { + error = errno; + rump_vfs_root(fs->ukfs_mp, &fs->ukfs_rvp, 0); + rump_clear_curlwp(); ukfs_chdir(fs, fs->ukfs_mountpath); - errno = rv; + errno = error; return -1; } + rump_clear_curlwp(); } if (fs->ukfs_devpath) { Index: src/lib/libukfs/ukfs.h diff -u src/lib/libukfs/ukfs.h:1.9 src/lib/libukfs/ukfs.h:1.10 --- src/lib/libukfs/ukfs.h:1.9 Wed Jul 22 20:46:34 2009 +++ src/lib/libukfs/ukfs.h Fri Oct 2 09:32:01 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: ukfs.h,v 1.9 2009/07/22 20:46:34 pooka Exp $ */ +/* $NetBSD: ukfs.h,v 1.10 2009/10/02 09:32:01 pooka Exp $ */ /* * Copyright (c) 2007, 2008 Antti Kantee. All Rights Reserved. @@ -108,6 +108,8 @@ struct mount *ukfs_getmp(struct ukfs *); struct vnode *ukfs_getrvp(struct ukfs *); +void ukfs_setspecific(struct ukfs *, void *); +void * ukfs_getspecific(struct ukfs *); /* dynamic loading of library modules */ int ukfs_modload(const char *);
CVS commit: src/usr.bin/make
Module Name:src Committed By: wiz Date: Fri Oct 2 07:43:15 UTC 2009 Modified Files: src/usr.bin/make: make.1 Log Message: Remove trailing whitespace. To generate a diff of this commit: cvs rdiff -u -r1.162 -r1.163 src/usr.bin/make/make.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/make.1 diff -u src/usr.bin/make/make.1:1.162 src/usr.bin/make/make.1:1.163 --- src/usr.bin/make/make.1:1.162 Thu Oct 1 21:40:31 2009 +++ src/usr.bin/make/make.1 Fri Oct 2 07:43:15 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.162 2009/10/01 21:40:31 dsl Exp $ +.\" $NetBSD: make.1,v 1.163 2009/10/02 07:43:15 wiz Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -663,10 +663,10 @@ .It Va .MAKE.LEVEL The recursion depth of .Nm . -The initial instance of +The initial instance of .Nm will be 0, and an incremented value is put into the environment -to be seen by the next generation. +to be seen by the next generation. This allows tests like: .Li .if ${.MAKE.LEVEL} == 0 to protect things which should only be evaluated in the initial instance of
CVS commit: src/doc
Module Name:src Committed By: cegger Date: Fri Oct 2 07:43:01 UTC 2009 Modified Files: src/doc: BUILDING.mdoc CHANGES.prev src/doc/roadmaps: storage Log Message: backout wrong changes after I got teached that the vowel *sound* matters and not the spelling letter (which is what I learned at school). To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/doc/BUILDING.mdoc cvs rdiff -u -r1.96 -r1.97 src/doc/CHANGES.prev cvs rdiff -u -r1.6 -r1.7 src/doc/roadmaps/storage Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/BUILDING.mdoc diff -u src/doc/BUILDING.mdoc:1.78 src/doc/BUILDING.mdoc:1.79 --- src/doc/BUILDING.mdoc:1.78 Fri Oct 2 07:17:16 2009 +++ src/doc/BUILDING.mdoc Fri Oct 2 07:43:01 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: BUILDING.mdoc,v 1.78 2009/10/02 07:17:16 cegger Exp $ +.\" $NetBSD: BUILDING.mdoc,v 1.79 2009/10/02 07:43:01 cegger Exp $ .\" .\" Copyright (c) 2001-2008 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -1165,7 +1165,7 @@ .Sy /bin/sh is unusually old and broken, the Korn Shell .Sy ( /bin/ksh ) , -if available, may be an usable alternative. +if available, may be a usable alternative. .Pp All cross-compile builds, and most native builds, of the entire system should make use of Index: src/doc/CHANGES.prev diff -u src/doc/CHANGES.prev:1.96 src/doc/CHANGES.prev:1.97 --- src/doc/CHANGES.prev:1.96 Fri Oct 2 07:17:16 2009 +++ src/doc/CHANGES.prev Fri Oct 2 07:43:01 2009 @@ -1,4 +1,4 @@ -LIST OF CHANGES FROM PREVIOUS RELEASES: <$Revision: 1.96 $> +LIST OF CHANGES FROM PREVIOUS RELEASES: <$Revision: 1.97 $> Changes from 386bsd 0.1 + patchkit 0.2.2 to NetBSD 0.8: @@ -1608,7 +1608,7 @@ counts (e.g. isofs). [mycroft 19941026] Reworked part of the `mcd' driver to make it more reliable. [mycroft 19941026] - Made fork(2)ing with an user-defined LDT work (and not panic). [mycroft + Made fork(2)ing with a user-defined LDT work (and not panic). [mycroft 19941031] upgraded diff, diff3, and sdiff to version 2.7. (jtc) lorder(1): Fixed lorder manpage. From Brad Parker. (jtc) @@ -2644,7 +2644,7 @@ underlying device and a printable "external name" (name + unit number), thus eliminating if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_reset)() - to take a struct ifnet *, rather than an unit number. + to take a struct ifnet *, rather than a unit number. [thorpej 19960506] ethernet: made the MI LANCE driver standalone, using cfattach to resolve naming conflicts on ports which can have more @@ -3512,7 +3512,7 @@ new bus dma framework. [thorpej 19970606] alpha: Add support for SGMAP-mapped DMA, using new bus dma framework, allowing ISA DMA to function. [thorpej 19970606] - isa: convert isadma.c to be an user of new bus dma framework, + isa: convert isadma.c to be a user of new bus dma framework, and convert all drivers that use it to the new API. [thorpej 19970606] New sysctl hw.machine_arch which returns the CPU class of a machine. @@ -4307,7 +4307,7 @@ Sweep inspired by a discussion of a bug introduced in OpenBSD on Bugtraq. [thorpej 19980728] libedit: add 'edit on|off' editrc command, which is used to advise - invoking programs if an user's does or doesn't want editline + invoking programs if a user's does or doesn't want editline support. Modify ftp(1) to honour this. [lukem 19980729] tftpd(8): add support for -u user and -g group, which specify the user and group to run as. Fixes PR #4218. [lukem 19980729] @@ -4498,7 +4498,7 @@ newsmips: Switch to UVM by default on newsmips. [tsubai 19981116] i386: Switch to gas.new on i386. [kristerw 19981116] sparc: Switch to gas.new on sparc. [kristerw 19981116] - mbrlabel(8): Add an utility to access partitions on MBR labeled + mbrlabel(8): Add a utility to access partitions on MBR labeled disks like those transferred from a DOS machine [ws 19981116] pmax: Add crunched miniroot distribution media [jonathan 19981116] kernel: Add support for detaching and activating/deactivating devices. @@ -4749,7 +4749,7 @@ [bad 19990323] dump(8): Add read cache. Speeds up dump operations in most cases [bouyer,mjl 19990323] - net: prevent bind(2)ing to an unicast address/port if the uids of the + net: prevent bind(2)ing to a unicast address/port if the uids of the socket creators are different and the new bind(2) is not done by root. [luke 19990324] vm: delete Mach VM. [mrg 19990324] @@ -4821,7 +4821,7 @@ [augustss 19990512] ftp(1): support `[user[:passwo...@]' in http URLs and $http_proxy. [lukem 19990513] - kernel: Allow an user-specified stack to be used in the child after a + kernel: Allow a user-specified stack to be used in the child after a fork operation, allow an alternate exit signal to be specified, and allow more things (cwd info, file tables, signal handlers) to be shared
CVS commit: src/lib/libc/net
Module Name:src Committed By: wiz Date: Fri Oct 2 07:41:08 UTC 2009 Modified Files: src/lib/libc/net: getaddrinfo.3 getaddrinfo.c gethnamaddr.c Log Message: Revert a -> an changes: Adding an 'n' follows pronunciation, not writing. To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/lib/libc/net/getaddrinfo.3 cvs rdiff -u -r1.94 -r1.95 src/lib/libc/net/getaddrinfo.c cvs rdiff -u -r1.74 -r1.75 src/lib/libc/net/gethnamaddr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/net/getaddrinfo.3 diff -u src/lib/libc/net/getaddrinfo.3:1.49 src/lib/libc/net/getaddrinfo.3:1.50 --- src/lib/libc/net/getaddrinfo.3:1.49 Fri Oct 2 06:59:37 2009 +++ src/lib/libc/net/getaddrinfo.3 Fri Oct 2 07:41:08 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: getaddrinfo.3,v 1.49 2009/10/02 06:59:37 wiz Exp $ +.\" $NetBSD: getaddrinfo.3,v 1.50 2009/10/02 07:41:08 wiz Exp $ .\" $KAME: getaddrinfo.3,v 1.36 2005/01/05 03:23:05 itojun Exp $ .\" $OpenBSD: getaddrinfo.3,v 1.35 2004/12/21 03:40:31 jaredy Exp $ .\" @@ -260,7 +260,7 @@ interface .Dc . .Pp -The current implementation assumes an one-to-one relationship between +The current implementation assumes a one-to-one relationship between the interface and link, which is not necessarily true from the specification. .Pp All of the information returned by Index: src/lib/libc/net/getaddrinfo.c diff -u src/lib/libc/net/getaddrinfo.c:1.94 src/lib/libc/net/getaddrinfo.c:1.95 --- src/lib/libc/net/getaddrinfo.c:1.94 Fri Oct 2 06:49:23 2009 +++ src/lib/libc/net/getaddrinfo.c Fri Oct 2 07:41:08 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: getaddrinfo.c,v 1.94 2009/10/02 06:49:23 cegger Exp $ */ +/* $NetBSD: getaddrinfo.c,v 1.95 2009/10/02 07:41:08 wiz Exp $ */ /* $KAME: getaddrinfo.c,v 1.29 2000/08/31 17:26:57 itojun Exp $ */ /* @@ -55,7 +55,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: getaddrinfo.c,v 1.94 2009/10/02 06:49:23 cegger Exp $"); +__RCSID("$NetBSD: getaddrinfo.c,v 1.95 2009/10/02 07:41:08 wiz Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -1027,7 +1027,7 @@ if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6)) { /* - * We currently assume an one-to-one mapping between links + * We currently assume a one-to-one mapping between links * and interfaces, so we simply use interface indices for * like-local scopes. */ @@ -1799,7 +1799,7 @@ trailing_dot++; /* - * if there aren't any dots, it could be an user-level alias + * if there aren't any dots, it could be a user-level alias */ if (!dots && (cp = __hostalias(name)) != NULL) { ret = res_queryN(cp, target, res); Index: src/lib/libc/net/gethnamaddr.c diff -u src/lib/libc/net/gethnamaddr.c:1.74 src/lib/libc/net/gethnamaddr.c:1.75 --- src/lib/libc/net/gethnamaddr.c:1.74 Fri Oct 2 06:49:23 2009 +++ src/lib/libc/net/gethnamaddr.c Fri Oct 2 07:41:08 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: gethnamaddr.c,v 1.74 2009/10/02 06:49:23 cegger Exp $ */ +/* $NetBSD: gethnamaddr.c,v 1.75 2009/10/02 07:41:08 wiz Exp $ */ /* * ++Copyright++ 1985, 1988, 1993 @@ -57,7 +57,7 @@ static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93"; static char rcsid[] = "Id: gethnamaddr.c,v 8.21 1997/06/01 20:34:37 vixie Exp "; #else -__RCSID("$NetBSD: gethnamaddr.c,v 1.74 2009/10/02 06:49:23 cegger Exp $"); +__RCSID("$NetBSD: gethnamaddr.c,v 1.75 2009/10/02 07:41:08 wiz Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -573,7 +573,7 @@ host.h_length = size; /* - * if there aren't any dots, it could be an user-level alias. + * if there aren't any dots, it could be a user-level alias. * this is also done in res_nquery() since we are not the only * function that looks up host names. */
CVS commit: src/doc
Module Name:src Committed By: cegger Date: Fri Oct 2 07:17:16 UTC 2009 Modified Files: src/doc: BUILDING.mdoc CHANGES CHANGES.prev src/doc/roadmaps: storage Log Message: fix grammar: a -> an To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/doc/BUILDING.mdoc cvs rdiff -u -r1.1297 -r1.1298 src/doc/CHANGES cvs rdiff -u -r1.95 -r1.96 src/doc/CHANGES.prev cvs rdiff -u -r1.5 -r1.6 src/doc/roadmaps/storage Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/BUILDING.mdoc diff -u src/doc/BUILDING.mdoc:1.77 src/doc/BUILDING.mdoc:1.78 --- src/doc/BUILDING.mdoc:1.77 Sun Sep 27 18:08:24 2009 +++ src/doc/BUILDING.mdoc Fri Oct 2 07:17:16 2009 @@ -1,4 +1,4 @@ -.\" $NetBSD: BUILDING.mdoc,v 1.77 2009/09/27 18:08:24 apb Exp $ +.\" $NetBSD: BUILDING.mdoc,v 1.78 2009/10/02 07:17:16 cegger Exp $ .\" .\" Copyright (c) 2001-2008 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -1165,7 +1165,7 @@ .Sy /bin/sh is unusually old and broken, the Korn Shell .Sy ( /bin/ksh ) , -if available, may be a usable alternative. +if available, may be an usable alternative. .Pp All cross-compile builds, and most native builds, of the entire system should make use of Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.1297 src/doc/CHANGES:1.1298 --- src/doc/CHANGES:1.1297 Fri Oct 2 04:26:52 2009 +++ src/doc/CHANGES Fri Oct 2 07:17:16 2009 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1297 $> +# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1298 $> # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -174,8 +174,8 @@ pciback.hide boot parameter will attach. DomU kernels gets a xpci device, to which PCI buses will attach. [bouyer 20090305] - xen: Add XEN3PAE_DOM0, a i386 domain0 kernel with PAE support. - requires a i386PAE or x86_64 hypervisor. [bouyer 20090305] + xen: Add XEN3PAE_DOM0, an i386 domain0 kernel with PAE support. + requires an i386PAE or x86_64 hypervisor. [bouyer 20090305] ar(1): Add support to ar(1) for 'deterministic mode'. [christos 20090306] kernel: Compute kern.ipc.shmmaxpgs on startup based on physical Index: src/doc/CHANGES.prev diff -u src/doc/CHANGES.prev:1.95 src/doc/CHANGES.prev:1.96 --- src/doc/CHANGES.prev:1.95 Sat May 2 06:21:16 2009 +++ src/doc/CHANGES.prev Fri Oct 2 07:17:16 2009 @@ -1,4 +1,4 @@ -LIST OF CHANGES FROM PREVIOUS RELEASES: <$Revision: 1.95 $> +LIST OF CHANGES FROM PREVIOUS RELEASES: <$Revision: 1.96 $> Changes from 386bsd 0.1 + patchkit 0.2.2 to NetBSD 0.8: @@ -1608,7 +1608,7 @@ counts (e.g. isofs). [mycroft 19941026] Reworked part of the `mcd' driver to make it more reliable. [mycroft 19941026] - Made fork(2)ing with a user-defined LDT work (and not panic). [mycroft + Made fork(2)ing with an user-defined LDT work (and not panic). [mycroft 19941031] upgraded diff, diff3, and sdiff to version 2.7. (jtc) lorder(1): Fixed lorder manpage. From Brad Parker. (jtc) @@ -2644,7 +2644,7 @@ underlying device and a printable "external name" (name + unit number), thus eliminating if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_reset)() - to take a struct ifnet *, rather than a unit number. + to take a struct ifnet *, rather than an unit number. [thorpej 19960506] ethernet: made the MI LANCE driver standalone, using cfattach to resolve naming conflicts on ports which can have more @@ -3512,7 +3512,7 @@ new bus dma framework. [thorpej 19970606] alpha: Add support for SGMAP-mapped DMA, using new bus dma framework, allowing ISA DMA to function. [thorpej 19970606] - isa: convert isadma.c to be a user of new bus dma framework, + isa: convert isadma.c to be an user of new bus dma framework, and convert all drivers that use it to the new API. [thorpej 19970606] New sysctl hw.machine_arch which returns the CPU class of a machine. @@ -4307,7 +4307,7 @@ Sweep inspired by a discussion of a bug introduced in OpenBSD on Bugtraq. [thorpej 19980728] libedit: add 'edit on|off' editrc command, which is used to advise - invoking programs if a user's does or doesn't want editline + invoking programs if an user's does or doesn't want editline support. Modify ftp(1) to honour this. [lukem 19980729] tftpd(8): add support for -u user and -g group, which specify the user and group to run as. Fixes PR #4218. [lukem 19980729] @@ -4498,7 +4498,7 @@ newsmips: Switch to UVM by default on newsmips. [tsubai 19981116] i386: Switch to gas.new on i386. [kristerw 19981116] sparc: Switch to gas.new on sparc. [kristerw 19981116] - mbrlabel(8): Add a utility to access partitions on MBR labeled + mbrlabel(8): Add an utility to access partitions on MBR labeled disks like those transferred from a DOS machine [ws 19981116] pmax: Add crunched miniroot distribution media [jonathan 19981116] kernel: A