CVS commit: src/sys/sys
Module Name:src Committed By: tls Date: Mon Nov 28 08:00:48 UTC 2011 Modified Files: src/sys/sys: rnd.h Log Message: Change to rnd.h missed in previous commit. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/sys/rnd.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/rnd.h diff -u src/sys/sys/rnd.h:1.24 src/sys/sys/rnd.h:1.25 --- src/sys/sys/rnd.h:1.24 Sat Nov 26 01:17:17 2011 +++ src/sys/sys/rnd.h Mon Nov 28 08:00:48 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rnd.h,v 1.24 2011/11/26 01:17:17 tls Exp $ */ +/* $NetBSD: rnd.h,v 1.25 2011/11/28 08:00:48 tls Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -189,6 +189,8 @@ void rnd_detach_source(krndsource_t *); void rndsink_attach(rndsink_t *); void rndsink_detach(rndsink_t *); +void rnd_seed(void *, size_t); + #endif /* _KERNEL */ #define RND_MAXSTATCOUNT 10 /* 10 sources at once max */
CVS commit: src
Module Name:src Committed By: tls Date: Mon Nov 28 08:05:07 UTC 2011 Modified Files: src/lib/librumpuser: rumpuser.c src/sys/dist/ipf/netinet: ip_compat.h ip_state.c src/sys/dist/pf/net: pf_ioctl.c pf_norm.c src/sys/lib/libkern: arc4random.c libkern.h src/sys/nfs: nfs_vnops.c src/sys/opencrypto: cryptosoft.c cryptosoft_xform.c src/sys/rump/include/rump: rumpuser.h src/sys/rump/librump/rumpkern: cprng_stub.c src/sys/sys: cprng.h param.h src/sys/ufs/ffs: ffs_alloc.c Log Message: Remove arc4random() and arc4randbytes() from the kernel API. Replace arc4random() hacks in rump with stubs that call the host arc4random() to get numbers that are hopefully actually random (arc4random() keyed with stack junk is not). This should fix some of the currently failing anita tests -- we should no longer generate duplicate "random" MAC addresses in the test environment. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/lib/librumpuser/rumpuser.c cvs rdiff -u -r1.29 -r1.30 src/sys/dist/ipf/netinet/ip_compat.h cvs rdiff -u -r1.36 -r1.37 src/sys/dist/ipf/netinet/ip_state.c cvs rdiff -u -r1.45 -r1.46 src/sys/dist/pf/net/pf_ioctl.c cvs rdiff -u -r1.25 -r1.26 src/sys/dist/pf/net/pf_norm.c cvs rdiff -u -r1.26 -r1.27 src/sys/lib/libkern/arc4random.c cvs rdiff -u -r1.103 -r1.104 src/sys/lib/libkern/libkern.h cvs rdiff -u -r1.292 -r1.293 src/sys/nfs/nfs_vnops.c cvs rdiff -u -r1.38 -r1.39 src/sys/opencrypto/cryptosoft.c cvs rdiff -u -r1.24 -r1.25 src/sys/opencrypto/cryptosoft_xform.c cvs rdiff -u -r1.70 -r1.71 src/sys/rump/include/rump/rumpuser.h cvs rdiff -u -r1.2 -r1.3 src/sys/rump/librump/rumpkern/cprng_stub.c cvs rdiff -u -r1.1 -r1.2 src/sys/sys/cprng.h cvs rdiff -u -r1.396 -r1.397 src/sys/sys/param.h cvs rdiff -u -r1.129 -r1.130 src/sys/ufs/ffs/ffs_alloc.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/librumpuser/rumpuser.c diff -u src/lib/librumpuser/rumpuser.c:1.15 src/lib/librumpuser/rumpuser.c:1.16 --- src/lib/librumpuser/rumpuser.c:1.15 Sun Feb 6 21:05:53 2011 +++ src/lib/librumpuser/rumpuser.c Mon Nov 28 08:05:05 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.c,v 1.15 2011/02/06 21:05:53 pooka Exp $ */ +/* $NetBSD: rumpuser.c,v 1.16 2011/11/28 08:05:05 tls Exp $ */ /* * Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved. @@ -27,7 +27,7 @@ #include #if !defined(lint) -__RCSID("$NetBSD: rumpuser.c,v 1.15 2011/02/06 21:05:53 pooka Exp $"); +__RCSID("$NetBSD: rumpuser.c,v 1.16 2011/11/28 08:05:05 tls Exp $"); #endif /* !lint */ /* thank the maker for this */ @@ -640,3 +640,9 @@ rumpuser_getnhostcpu(void) return 1; #endif } + +uint32_t +rumpuser_arc4random(void) +{ + return arc4random(); +} Index: src/sys/dist/ipf/netinet/ip_compat.h diff -u src/sys/dist/ipf/netinet/ip_compat.h:1.29 src/sys/dist/ipf/netinet/ip_compat.h:1.30 --- src/sys/dist/ipf/netinet/ip_compat.h:1.29 Tue Jun 1 08:53:20 2010 +++ src/sys/dist/ipf/netinet/ip_compat.h Mon Nov 28 08:05:05 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_compat.h,v 1.29 2010/06/01 08:53:20 plunky Exp $ */ +/* $NetBSD: ip_compat.h,v 1.30 2011/11/28 08:05:05 tls Exp $ */ /* * Copyright (C) 1993-2001, 2003 by Darren Reed. @@ -216,7 +216,7 @@ typedef unsigned int u_32_t; # ifdef _KERNEL # define NEED_LOCAL_RAND 1 -# define ipf_random arc4random +# define ipf_random cprng_fast32 # define KRWLOCK_T krwlock_t # define KMUTEX_T kmutex_t @@ -582,7 +582,8 @@ typedef struct { # ifdef _KERNEL # define NEED_LOCAL_RAND 1 -# define ipf_random arc4random +#include +# define ipf_random cprng_fast32 # define ATOMIC_INC(x) { MUTEX_ENTER(&ipf_rw); \ (x)++; MUTEX_EXIT(&ipf_rw); } # define ATOMIC_DEC(x) { MUTEX_ENTER(&ipf_rw); \ @@ -806,7 +807,9 @@ typedef unsigned intu_32_t; # endif # endif +#ifndef _KERNEL # define ipf_random arc4random +#endif # if (__NetBSD_Version__ >= 49900) # ifdef _KERNEL @@ -834,7 +837,8 @@ typedef unsigned intu_32_t; # endif # ifdef _KERNEL -# define ipf_random arc4random +# include +# define ipf_random cprng_fast32 # if (__NetBSD_Version__ >= 399001400) # define KMALLOCS(a, b, c) (a) = (b)malloc((c), _M_IPF, M_NOWAIT) # endif Index: src/sys/dist/ipf/netinet/ip_state.c diff -u src/sys/dist/ipf/netinet/ip_state.c:1.36 src/sys/dist/ipf/netinet/ip_state.c:1.37 --- src/sys/dist/ipf/netinet/ip_state.c:1.36 Sat Apr 17 21:00:44 2010 +++ src/sys/dist/ipf/netinet/ip_state.c Mon Nov 28 08:05:05 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_state.c,v 1.36 2010/04/17 21:00:44 darrenr Exp $ */ +/* $NetBSD: ip_state.c,v 1.37 2011/11/28 08:05:05 tls Exp $ */ /* * Copyright (C) 1995-2003 by Darren Reed. @@ -115,7 +115,7 @@ struct file; #if !defined(lint) #if defined(__NetBSD__) #include -__KERNEL_RCSID(0, "$NetBSD: ip_state.c,v 1.36 2010/04/17 21:00:44 darrenr Exp $"); +__KERNEL_RCSID(
CVS commit: src/share/man/man5
Module Name:src Committed By: wiz Date: Mon Nov 28 09:38:45 UTC 2011 Modified Files: src/share/man/man5: boot.cfg.5 Log Message: New sentence, new line. Use more markup. Bump date for previous. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/share/man/man5/boot.cfg.5 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/man5/boot.cfg.5 diff -u src/share/man/man5/boot.cfg.5:1.23 src/share/man/man5/boot.cfg.5:1.24 --- src/share/man/man5/boot.cfg.5:1.23 Mon Nov 28 07:56:53 2011 +++ src/share/man/man5/boot.cfg.5 Mon Nov 28 09:38:45 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: boot.cfg.5,v 1.23 2011/11/28 07:56:53 tls Exp $ +.\" $NetBSD: boot.cfg.5,v 1.24 2011/11/28 09:38:45 wiz Exp $ .\" .\" Copyright (c) 2007 Stephen Borrill .\" 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 May 26, 2011 +.Dd November 28, 2011 .Dt BOOT.CFG 5 .Os .Sh NAME @@ -148,14 +148,19 @@ Passes a .Xr userconf 4 command to the kernel at boot time . .It Sy rndseed -Takes the path to a random-seed file as written by the -S flag to +Takes the path to a random-seed file as written by the +.Fl S +flag to .Xr rndctl 8 -as an argument. This file is used to seed the -kernel entropy pool +as an argument. +This file is used to seed the kernel entropy pool .Xr rnd 9 very early in kernel startup, so that high quality randomness is -available to all kernel modules. This argument should be supplied -before any "load" commands that may load executable modules. +available to all kernel modules. +This argument should be supplied +before any +.Dq Ic load +commands that may load executable modules. .El .Sh EXAMPLES Here is an example
CVS commit: src/usr.bin/cmp
Module Name:src Committed By: wiz Date: Mon Nov 28 10:10:10 UTC 2011 Modified Files: src/usr.bin/cmp: regular.c special.c Log Message: Remove unused header. From Henning Petersen in PR 45658. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/usr.bin/cmp/regular.c cvs rdiff -u -r1.13 -r1.14 src/usr.bin/cmp/special.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/cmp/regular.c diff -u src/usr.bin/cmp/regular.c:1.22 src/usr.bin/cmp/regular.c:1.23 --- src/usr.bin/cmp/regular.c:1.22 Sat Apr 18 06:24:05 2009 +++ src/usr.bin/cmp/regular.c Mon Nov 28 10:10:10 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: regular.c,v 1.22 2009/04/18 06:24:05 lukem Exp $ */ +/* $NetBSD: regular.c,v 1.23 2011/11/28 10:10:10 wiz Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)regular.c 8.3 (Berkeley) 4/2/94"; #else -__RCSID("$NetBSD: regular.c,v 1.22 2009/04/18 06:24:05 lukem Exp $"); +__RCSID("$NetBSD: regular.c,v 1.23 2011/11/28 10:10:10 wiz Exp $"); #endif #endif /* not lint */ @@ -46,7 +46,6 @@ __RCSID("$NetBSD: regular.c,v 1.22 2009/ #include #include #include -#include #include "extern.h" Index: src/usr.bin/cmp/special.c diff -u src/usr.bin/cmp/special.c:1.13 src/usr.bin/cmp/special.c:1.14 --- src/usr.bin/cmp/special.c:1.13 Sat Apr 11 12:16:12 2009 +++ src/usr.bin/cmp/special.c Mon Nov 28 10:10:10 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: special.c,v 1.13 2009/04/11 12:16:12 lukem Exp $ */ +/* $NetBSD: special.c,v 1.14 2011/11/28 10:10:10 wiz Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)special.c 8.3 (Berkeley) 4/2/94"; #else -__RCSID("$NetBSD: special.c,v 1.13 2009/04/11 12:16:12 lukem Exp $"); +__RCSID("$NetBSD: special.c,v 1.14 2011/11/28 10:10:10 wiz Exp $"); #endif #endif /* not lint */ @@ -43,7 +43,6 @@ __RCSID("$NetBSD: special.c,v 1.13 2009/ #include #include #include -#include #include "extern.h"
CVS commit: src/sys/dev/ic
Module Name:src Committed By: jmcneill Date: Mon Nov 28 11:46:54 UTC 2011 Modified Files: src/sys/dev/ic: cs4231.c Log Message: PR# kern/45664: audio panic at detach Pass the size of the structure to kmem_free, not the size of the DMA buffer. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/dev/ic/cs4231.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/ic/cs4231.c diff -u src/sys/dev/ic/cs4231.c:1.27 src/sys/dev/ic/cs4231.c:1.28 --- src/sys/dev/ic/cs4231.c:1.27 Wed Nov 23 23:07:32 2011 +++ src/sys/dev/ic/cs4231.c Mon Nov 28 11:46:54 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: cs4231.c,v 1.27 2011/11/23 23:07:32 jmcneill Exp $ */ +/* $NetBSD: cs4231.c,v 1.28 2011/11/28 11:46:54 jmcneill Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cs4231.c,v 1.27 2011/11/23 23:07:32 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cs4231.c,v 1.28 2011/11/28 11:46:54 jmcneill Exp $"); #include "audio.h" #if NAUDIO > 0 @@ -221,7 +221,7 @@ fail3: fail2: bus_dmamap_destroy(dmatag, p->dmamap); fail1: - kmem_free(p, size); + kmem_free(p, sizeof(*p)); return NULL; } @@ -242,7 +242,7 @@ cs4231_free(void *addr, void *ptr, size_ bus_dmamem_free(dmatag, p->segs, p->nsegs); bus_dmamap_destroy(dmatag, p->dmamap); *pp = p->next; - kmem_free(p, size); + kmem_free(p, sizeof(*p)); return; } printf("cs4231_free: rogue pointer\n");
CVS commit: src/lib
Module Name:src Committed By: joerg Date: Mon Nov 28 12:44:19 UTC 2011 Modified Files: src/lib/libbluetooth: bluetooth.h src/lib/libform: form.h src/lib/libisns: isns_pdu.h src/lib/libterminfo: compile.c Log Message: Kill a bunch of manual __attribute__ usages and replace them with the equivalent sys/cdefs.h invocation. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/libbluetooth/bluetooth.h cvs rdiff -u -r1.20 -r1.21 src/lib/libform/form.h cvs rdiff -u -r1.2 -r1.3 src/lib/libisns/isns_pdu.h cvs rdiff -u -r1.5 -r1.6 src/lib/libterminfo/compile.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/libbluetooth/bluetooth.h diff -u src/lib/libbluetooth/bluetooth.h:1.4 src/lib/libbluetooth/bluetooth.h:1.5 --- src/lib/libbluetooth/bluetooth.h:1.4 Mon Aug 3 15:59:42 2009 +++ src/lib/libbluetooth/bluetooth.h Mon Nov 28 12:44:18 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: bluetooth.h,v 1.4 2009/08/03 15:59:42 plunky Exp $ */ +/* $NetBSD: bluetooth.h,v 1.5 2011/11/28 12:44:18 joerg Exp $ */ /*- * Copyright (c) 2001-2009 Maksim Yevmenkin @@ -160,14 +160,14 @@ typedef struct { bdaddr_t laddr; /* local address */ bdaddr_t raddr; /* remote address */ uint8_t time; /* validity (seconds) */ -} __attribute__ ((packed)) bthcid_pin_request_t; +} __packed bthcid_pin_request_t; /* Client PIN Response packet */ typedef struct { bdaddr_t laddr; /* local address */ bdaddr_t raddr; /* remote address */ uint8_t pin[HCI_PIN_SIZE]; /* PIN */ -} __attribute__ ((packed)) bthcid_pin_response_t; +} __packed bthcid_pin_response_t; /* Default socket name */ #define BTHCID_SOCKET_NAME "/var/run/bthcid" Index: src/lib/libform/form.h diff -u src/lib/libform/form.h:1.20 src/lib/libform/form.h:1.21 --- src/lib/libform/form.h:1.20 Wed Feb 3 15:34:43 2010 +++ src/lib/libform/form.h Mon Nov 28 12:44:18 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: form.h,v 1.20 2010/02/03 15:34:43 roy Exp $ */ +/* $NetBSD: form.h,v 1.21 2011/11/28 12:44:18 joerg Exp $ */ /*- * Copyright (c) 1998-1999 Brett Lymn @@ -355,8 +355,7 @@ int set_field_init(FORM *, Form int set_field_just(FIELD *, int); int set_field_opts(FIELD *, Form_Options); int set_field_pad(FIELD *, int); -int set_field_printf(FIELD *, int, char *, ...) -__attribute__((__format__(__printf__, 3, 4))); +int set_field_printf(FIELD *, int, char *, ...) __printflike(3, 4); int set_field_status(FIELD *, int); int set_field_term(FORM *, Form_Hook); int set_field_type(FIELD *, FIELDTYPE *, ...); Index: src/lib/libisns/isns_pdu.h diff -u src/lib/libisns/isns_pdu.h:1.2 src/lib/libisns/isns_pdu.h:1.3 --- src/lib/libisns/isns_pdu.h:1.2 Wed Aug 17 10:08:43 2011 +++ src/lib/libisns/isns_pdu.h Mon Nov 28 12:44:18 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: isns_pdu.h,v 1.2 2011/08/17 10:08:43 christos Exp $ */ +/* $NetBSD: isns_pdu.h,v 1.3 2011/11/28 12:44:18 joerg Exp $ */ /*- * Copyright (c) 2004,2009 The NetBSD Foundation, Inc. @@ -171,12 +171,12 @@ struct isns_trans_s { }; struct isns_pdu_hdr_s { - uint16_t isnsp_version __attribute__ ((packed)); - uint16_t func_id __attribute__ ((packed)); - uint16_t payload_len __attribute__ ((packed)); - uint16_t flags __attribute__ ((packed)); - uint16_t trans_id __attribute__ ((packed)); - uint16_t seq_id __attribute__ ((packed)); + uint16_t isnsp_version __packed; + uint16_t func_id __packed; + uint16_t payload_len __packed; + uint16_t flags __packed; + uint16_t trans_id __packed; + uint16_t seq_id __packed; }; struct isns_pdu_s { Index: src/lib/libterminfo/compile.c diff -u src/lib/libterminfo/compile.c:1.5 src/lib/libterminfo/compile.c:1.6 --- src/lib/libterminfo/compile.c:1.5 Mon Apr 11 21:37:19 2011 +++ src/lib/libterminfo/compile.c Mon Nov 28 12:44:19 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: compile.c,v 1.5 2011/04/11 21:37:19 roy Exp $ */ +/* $NetBSD: compile.c,v 1.6 2011/11/28 12:44:19 joerg Exp $ */ /* * Copyright (c) 2009, 2010, 2011 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #endif #include -__RCSID("$NetBSD: compile.c,v 1.5 2011/04/11 21:37:19 roy Exp $"); +__RCSID("$NetBSD: compile.c,v 1.6 2011/11/28 12:44:19 joerg Exp $"); #if !HAVE_NBTOOL_CONFIG_H || HAVE_SYS_ENDIAN_H #include @@ -51,7 +51,7 @@ __RCSID("$NetBSD: compile.c,v 1.5 2011/0 #include #include -static void __attribute__((__format__(__printf__, 2, 3))) +static void __printflike(2, 3) dowarn(int flags, const char *fmt, ...) { va_list va;
CVS commit: src/sys/ufs/chfs
Module Name:src Committed By: ahoka Date: Mon Nov 28 12:50:07 UTC 2011 Modified Files: src/sys/ufs/chfs: chfs.h Log Message: cleanup, some style and remove leftover code To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/ufs/chfs/chfs.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/ufs/chfs/chfs.h diff -u src/sys/ufs/chfs/chfs.h:1.3 src/sys/ufs/chfs/chfs.h:1.4 --- src/sys/ufs/chfs/chfs.h:1.3 Thu Nov 24 21:38:44 2011 +++ src/sys/ufs/chfs/chfs.h Mon Nov 28 12:50:07 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: chfs.h,v 1.3 2011/11/24 21:38:44 ahoka Exp $ */ +/* $NetBSD: chfs.h,v 1.4 2011/11/28 12:50:07 ahoka Exp $ */ /*- * Copyright (c) 2010 Department of Software Engineering, @@ -310,7 +310,8 @@ struct chfs_eraseblock struct chfs_node_ref *first_node; struct chfs_node_ref *last_node; - struct chfs_node_ref *gc_node; /* Next block to be garbage collected */ + /* Next block to be garbage collected */ + struct chfs_node_ref *gc_node; }; TAILQ_HEAD(chfs_eraseblock_queue, chfs_eraseblock); @@ -349,21 +350,15 @@ struct garbage_collector_thread { * @very_dirty_queue: queue of very dirty eraseblocks * @erase_pending_queue: queue of eraseblocks waiting for erasing * @erasable_pending_wbuf_queue: queue of eraseblocks waiting for erasing and - * have data to write to them + * have data to write to them * @nextblock: next eraseblock to write to - * * @nr_free_blocks: number of free blocks on the free_queue * @nr_erasable_blocks: number of blocks that can be erased and are on the - * erasable_queue - * + * erasable_queue */ struct chfs_mount { struct mount *chm_fsmp; -// dev_t dev; -// struct vnode *devvp; - struct chfs_ebh *chm_ebh; -// int chm_fl_index; int chm_fs_version; uint64_t chm_gbl_version; ino_t chm_max_vno; @@ -448,30 +443,15 @@ struct chfs_mount { krwlock_t chm_lock_wbuf; }; -#define sleep_on_spinunlock(s) \ - do { \ - kmutex_t sleep_mtx; \ - kcondvar_t sleep_cnd; \ - cv_init(&sleep_cnd, "sleep_cnd"); \ - mutex_init(&sleep_mtx, MUTEX_DEFAULT, IPL_NONE); \ - mutex_spin_exit(s); \ - mutex_enter(&sleep_mtx); \ - cv_timedwait(&sleep_cnd, &sleep_mtx, mstohz(50)); \ - mutex_exit(&sleep_mtx); \ - mutex_destroy(&sleep_mtx); \ - cv_destroy(&sleep_cnd); \ - } while (0) -#undef sleep_on_spinunlock - /* * TODO we should move here all of these from the bottom of the file * Macros/functions to convert from generic data structures to chfs * specific ones. */ -#define CHFS_OFFSET_DOT 0 +#define CHFS_OFFSET_DOT 0 #define CHFS_OFFSET_DOTDOT 1 -#define CHFS_OFFSET_EOF 2 +#define CHFS_OFFSET_EOF 2 #define CHFS_OFFSET_FIRST 3 @@ -480,21 +460,32 @@ struct chfs_mount { /* chfs_build.c */ void chfs_calc_trigger_levels(struct chfs_mount *); int chfs_build_filesystem(struct chfs_mount *); -void chfs_build_set_vnodecache_nlink(struct chfs_mount *chmp,struct chfs_vnode_cache *vc); -void chfs_build_remove_unlinked_vnode(struct chfs_mount *chmp,struct chfs_vnode_cache *vc, struct chfs_dirent_list *unlinked); +void chfs_build_set_vnodecache_nlink(struct chfs_mount *, +struct chfs_vnode_cache *); +void chfs_build_remove_unlinked_vnode(struct chfs_mount *, +struct chfs_vnode_cache *, struct chfs_dirent_list *); /* chfs_scan.c */ int chfs_scan_eraseblock(struct chfs_mount *, struct chfs_eraseblock *); -struct chfs_vnode_cache *chfs_scan_make_vnode_cache(struct chfs_mount *chmp, ino_t vno); -int chfs_scan_check_node_hdr(struct chfs_flash_node_hdr *nhdr); -int chfs_scan_check_vnode(struct chfs_mount *chmp, struct chfs_eraseblock *cheb, void *buf, off_t ofs); -int chfs_scan_mark_dirent_obsolete(struct chfs_mount *chmp,struct chfs_vnode_cache *vc, struct chfs_dirent *fd); -void chfs_add_fd_to_list(struct chfs_mount *chmp,struct chfs_dirent *new, struct chfs_vnode_cache *pvc); -int chfs_scan_check_dirent_node(struct chfs_mount *chmp, struct chfs_eraseblock *cheb, void *buf, off_t ofs); -int chfs_scan_check_data_node(struct chfs_mount *chmp, struct chfs_eraseblock *cheb, void *buf, off_t ofs); -int chfs_scan_classify_cheb(struct chfs_mount *chmp,struct chfs_eraseblock *cheb); +struct chfs_vnode_cache *chfs_scan_make_vnode_cache(struct chfs_mount *, +ino_t); +int chfs_scan_check_node_hdr(struct chfs_flash_node_hdr *); +int chfs_scan_check_vnode(struct chfs_mount *, +struct chfs_eraseblock *, void *, off_t); +int chfs_scan_mark_dirent_obsolete(struct chfs_mount *, +struct chfs_vnode_cache *, struct chfs_dirent *); +void chfs_add_fd_to_list(struct chfs_mount *, +struct chfs_dirent *, struct chfs_vnode_cache *); +int chfs_scan_check_dirent_node(struct chfs_mount *, +struct chfs_eraseblock *, void *, off_t); +int chfs_scan_check_data_node(struct chfs_mount *, +struct ch
CVS commit: src/sys/uvm
Module Name:src Committed By: yamt Date: Mon Nov 28 14:07:01 UTC 2011 Modified Files: src/sys/uvm: uvm_fault.c Log Message: comments To generate a diff of this commit: cvs rdiff -u -r1.190 -r1.191 src/sys/uvm/uvm_fault.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/uvm/uvm_fault.c diff -u src/sys/uvm/uvm_fault.c:1.190 src/sys/uvm/uvm_fault.c:1.191 --- src/sys/uvm/uvm_fault.c:1.190 Sat Aug 6 17:25:03 2011 +++ src/sys/uvm/uvm_fault.c Mon Nov 28 14:06:59 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_fault.c,v 1.190 2011/08/06 17:25:03 rmind Exp $ */ +/* $NetBSD: uvm_fault.c,v 1.191 2011/11/28 14:06:59 yamt Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.190 2011/08/06 17:25:03 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.191 2011/11/28 14:06:59 yamt Exp $"); #include "opt_uvmhist.h" @@ -690,16 +690,47 @@ done: #define UVM_FAULT_MAXPROT (1 << 1) struct uvm_faultctx { + + /* + * the following members are set up by uvm_fault_check() and + * read-only after that. + * + * note that narrow is used by uvm_fault_check() to change + * the behaviour after ERESTART. + * + * most of them might change after RESTART if the underlying + * map entry has been changed behind us. an exception is + * wire_paging, which does never change. + */ vm_prot_t access_type; - vm_prot_t enter_prot; vaddr_t startva; int npages; int centeridx; + bool narrow; /* work on a single requested page only */ + bool wire_mapping; /* request a PMAP_WIRED mapping + (UVM_FAULT_WIRE or VM_MAPENT_ISWIRED) */ + bool wire_paging; /* request uvm_pagewire + (true for UVM_FAULT_WIRE) */ + bool cow_now; /* VM_PROT_WRITE is actually requested + (ie. should break COW and page loaning) */ + + /* + * enter_prot is set up by uvm_fault_check() and clamped + * (ie. drop the VM_PROT_WRITE bit) in various places in case + * of !cow_now. + */ + vm_prot_t enter_prot; /* prot at which we want to enter pages in */ + + /* + * the following member is for uvmfault_promote() and ERESTART. + */ struct vm_anon *anon_spare; - bool wire_mapping; - bool narrow; - bool wire_paging; - bool cow_now; + + /* + * the folloing is actually a uvm_fault_lower() internal. + * it's here merely for debugging. + * (or due to the mechanical separation of the function?) + */ bool promote; };
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: tls Date: Mon Nov 28 15:22:41 UTC 2011 Modified Files: src/sys/arch/x86/x86: via_padlock.c Log Message: Fix one last dangling use of arc4randbytes(). To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/x86/x86/via_padlock.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/x86/via_padlock.c diff -u src/sys/arch/x86/x86/via_padlock.c:1.16 src/sys/arch/x86/x86/via_padlock.c:1.17 --- src/sys/arch/x86/x86/via_padlock.c:1.16 Sat Nov 19 22:51:21 2011 +++ src/sys/arch/x86/x86/via_padlock.c Mon Nov 28 15:22:41 2011 @@ -1,5 +1,5 @@ /* $OpenBSD: via.c,v 1.8 2006/11/17 07:47:56 tom Exp $ */ -/* $NetBSD: via_padlock.c,v 1.16 2011/11/19 22:51:21 tls Exp $ */ +/* $NetBSD: via_padlock.c,v 1.17 2011/11/28 15:22:41 tls Exp $ */ /*- * Copyright (c) 2003 Jason Wright @@ -20,7 +20,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: via_padlock.c,v 1.16 2011/11/19 22:51:21 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: via_padlock.c,v 1.17 2011/11/28 15:22:41 tls Exp $"); #ifdef _KERNEL_OPT # include "rnd.h" @@ -40,6 +40,7 @@ __KERNEL_RCSID(0, "$NetBSD: via_padlock. #include #include #include +#include #include @@ -258,7 +259,7 @@ via_padlock_crypto_newsession(void *arg, C3_CRYPT_CWLO_KEYGEN_SW | C3_CRYPT_CWLO_NORMAL; - arc4randbytes(ses->ses_iv, sizeof(ses->ses_iv)); + cprng_fast(ses->ses_iv, sizeof(ses->ses_iv)); ses->ses_klen = c->cri_klen; ses->ses_cw0 = cw0;
CVS commit: src
Module Name:src Committed By: tron Date: Mon Nov 28 16:22:17 UTC 2011 Modified Files: src/distrib/sets/lists/base: mi src/distrib/sets/lists/comp: mi src/distrib/sets/lists/man: mi src/external/ibm-public/postfix/libexec: Makefile src/external/ibm-public/postfix/man/man8: Makefile Log Message: Don't build postscreen(8) if "MKCRYPTO" is set to "no". It cannot be built without TLS support, at least not without major surgery. I've only tested this by building with "MKCRYPTO" set to "yes" because the build fails much ealier otherwise. Problem reported by Nick Hudson in private e-mail. To generate a diff of this commit: cvs rdiff -u -r1.972 -r1.973 src/distrib/sets/lists/base/mi cvs rdiff -u -r1.1712 -r1.1713 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.1359 -r1.1360 src/distrib/sets/lists/man/mi cvs rdiff -u -r1.3 -r1.4 src/external/ibm-public/postfix/libexec/Makefile cvs rdiff -u -r1.2 -r1.3 src/external/ibm-public/postfix/man/man8/Makefile 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/base/mi diff -u src/distrib/sets/lists/base/mi:1.972 src/distrib/sets/lists/base/mi:1.973 --- src/distrib/sets/lists/base/mi:1.972 Thu Nov 24 21:44:19 2011 +++ src/distrib/sets/lists/base/mi Mon Nov 28 16:22:14 2011 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.972 2011/11/24 21:44:19 ahoka Exp $ +# $NetBSD: mi,v 1.973 2011/11/28 16:22:14 tron Exp $ # # Note: Don't delete entries from here - mark them as "obsolete" instead, # unless otherwise stated below. @@ -1066,7 +1066,7 @@ ./usr/libexec/postfix/postfix-script base-postfix-bin postfix ./usr/libexec/postfix/postfix-wrapper base-postfix-bin postfix ./usr/libexec/postfix/postmulti-script base-postfix-bin postfix -./usr/libexec/postfix/postscreen base-postfix-bin postfix +./usr/libexec/postfix/postscreen base-postfix-bin postfix,crypto ./usr/libexec/postfix/proxymap base-postfix-bin postfix ./usr/libexec/postfix/qmgr base-postfix-bin postfix ./usr/libexec/postfix/qmqpd base-obsolete obsolete Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.1712 src/distrib/sets/lists/comp/mi:1.1713 --- src/distrib/sets/lists/comp/mi:1.1712 Fri Nov 25 07:50:36 2011 +++ src/distrib/sets/lists/comp/mi Mon Nov 28 16:22:15 2011 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1712 2011/11/25 07:50:36 njoly Exp $ +# $NetBSD: mi,v 1.1713 2011/11/28 16:22:15 tron Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -3995,7 +3995,7 @@ ./usr/libdata/debug/usr/libexec/postfix/oqmgr.debug comp-postfix-debug postfix,debug ./usr/libdata/debug/usr/libexec/postfix/pickup.debug comp-postfix-debug postfix,debug ./usr/libdata/debug/usr/libexec/postfix/pipe.debug comp-postfix-debug postfix,debug -./usr/libdata/debug/usr/libexec/postfix/postscreen.debug comp-postfix-debug postfix,debug +./usr/libdata/debug/usr/libexec/postfix/postscreen.debug comp-postfix-debug postfix,crypto,debug ./usr/libdata/debug/usr/libexec/postfix/proxymap.debug comp-postfix-debug postfix,debug ./usr/libdata/debug/usr/libexec/postfix/qmgr.debug comp-postfix-debug postfix,debug ./usr/libdata/debug/usr/libexec/postfix/scache.debug comp-postfix-debug postfix,debug Index: src/distrib/sets/lists/man/mi diff -u src/distrib/sets/lists/man/mi:1.1359 src/distrib/sets/lists/man/mi:1.1360 --- src/distrib/sets/lists/man/mi:1.1359 Sun Nov 27 09:00:32 2011 +++ src/distrib/sets/lists/man/mi Mon Nov 28 16:22:17 2011 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1359 2011/11/27 09:00:32 isaki Exp $ +# $NetBSD: mi,v 1.1360 2011/11/28 16:22:17 tron Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -2651,7 +2651,7 @@ ./usr/share/man/cat8/pmppc/makedev.0 man-obsolete obsolete ./usr/share/man/cat8/portmap.0 man-obsolete obsolete ./usr/share/man/cat8/postinstall.0 man-sys-catman .cat -./usr/share/man/cat8/postscreen.0 man-postfix-catman postfix,.cat +./usr/share/man/cat8/postscreen.0 man-postfix-catman postfix,crypto,.cat ./usr/share/man/cat8/powerd.0 man-sysutil-catman .cat ./usr/share/man/cat8/poweroff.0 man-sysutil-catman .cat ./usr/share/man/cat8/pppd.0 man-ppp-catman .cat @@ -5252,7 +5252,7 @@ ./usr/share/man/html8/pipe.html man-postfix-htmlman postfix,html ./usr/share/man/html8/pmax/boot.html man-sys-htmlman html ./usr/share/man/html8/postinstall.html man-sys-htmlman html -./usr/share/man/html8/postscreen.html man-postfix-htmlman postfix,html +./usr/share/man/html8/postscreen.html man-postfix-htmlman postfix,crypto,html ./usr/share/man/html8/powerd.html man-sysutil-htmlman html ./usr/share/man/html8/poweroff.html man-sysutil-htmlman html ./usr/share/man/html8/pppd.html man-ppp-htmlman html @@ -8120,7 +8120,7 @@ ./usr/share/man/man8/pmppc/makedev.8 man-obsolete obsolete ./usr/share/man/man8/portmap.8 man-obsolete obsolete ./usr/share/man/
CVS commit: src/sys/dev/pci
Module Name:src Committed By: bouyer Date: Mon Nov 28 18:21:46 UTC 2011 Modified Files: src/sys/dev/pci: if_wm.c Log Message: There is problem with 82576 chips (and probably 82575 too) with hardware vlan tagging: some packets are sent untagged on the wire. Follow OpenBSD and disable hardware vlan tagging for these chips (I couldn't find a hint in other open-source drivers at what could be wrong ...) To generate a diff of this commit: cvs rdiff -u -r1.224 -r1.225 src/sys/dev/pci/if_wm.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/pci/if_wm.c diff -u src/sys/dev/pci/if_wm.c:1.224 src/sys/dev/pci/if_wm.c:1.225 --- src/sys/dev/pci/if_wm.c:1.224 Sat Nov 19 22:51:23 2011 +++ src/sys/dev/pci/if_wm.c Mon Nov 28 18:21:46 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: if_wm.c,v 1.224 2011/11/19 22:51:23 tls Exp $ */ +/* $NetBSD: if_wm.c,v 1.225 2011/11/28 18:21:46 bouyer Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. @@ -76,7 +76,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.224 2011/11/19 22:51:23 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.225 2011/11/28 18:21:46 bouyer Exp $"); #include "rnd.h" @@ -1911,7 +1911,9 @@ wm_attach(device_t parent, device_t self /* * If we're a i82543 or greater, we can support VLANs. */ - if (sc->sc_type >= WM_T_82543) + if (sc->sc_type == WM_T_82575 || sc->sc_type == WM_T_82576) + sc->sc_ethercom.ec_capabilities |= ETHERCAP_VLAN_MTU; + else if (sc->sc_type >= WM_T_82543) sc->sc_ethercom.ec_capabilities |= ETHERCAP_VLAN_MTU | ETHERCAP_VLAN_HWTAGGING;
CVS commit: src
Module Name:src Committed By: tls Date: Mon Nov 28 20:19:28 UTC 2011 Modified Files: src/distrib/sets/lists/comp: mi src/share/man/man9: Makefile rnd.9 Added Files: src/share/man/man9: cprng.9 Removed Files: src/share/man/man9: arc4random.9 Log Message: Add cprng(9) manual page, remove arc4random(9) manual page To generate a diff of this commit: cvs rdiff -u -r1.1713 -r1.1714 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.359 -r1.360 src/share/man/man9/Makefile cvs rdiff -u -r1.3 -r0 src/share/man/man9/arc4random.9 cvs rdiff -u -r0 -r1.1 src/share/man/man9/cprng.9 cvs rdiff -u -r1.17 -r1.18 src/share/man/man9/rnd.9 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/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.1713 src/distrib/sets/lists/comp/mi:1.1714 --- src/distrib/sets/lists/comp/mi:1.1713 Mon Nov 28 16:22:15 2011 +++ src/distrib/sets/lists/comp/mi Mon Nov 28 20:19:25 2011 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1713 2011/11/28 16:22:15 tron Exp $ +# $NetBSD: mi,v 1.1714 2011/11/28 20:19:25 tls Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -9779,6 +9779,17 @@ ./usr/share/man/cat9/copyoutstr.0 comp-sys-catman .cat ./usr/share/man/cat9/copystr.0 comp-sys-catman .cat ./usr/share/man/cat9/coredump_write.0 comp-sys-catman .cat +./usr/share/man/cat9/cprng.0 comp-sys-catman .cat +./usr/share/man/cat9/cprng_strong.0 comp-sys-catman .cat +./usr/share/man/cat9/cprng_strong_create.0 comp-sys-catman .cat +./usr/share/man/cat9/cprng_strong_destroy.0 comp-sys-catman .cat +./usr/share/man/cat9/cprng_strong_getflags.0 comp-sys-catman .cat +./usr/share/man/cat9/cprng_strong_setflags.0 comp-sys-catman .cat +./usr/share/man/cat9/cprng_strong32.0 comp-sys-catman .cat +./usr/share/man/cat9/cprng_strong64.0 comp-sys-catman .cat +./usr/share/man/cat9/cprng_fast.0 comp-sys-catman .cat +./usr/share/man/cat9/cprng_fast32.0 comp-sys-catman .cat +./usr/share/man/cat9/cprng_fast64.0 comp-sys-catman .cat ./usr/share/man/cat9/cpu_configure.0 comp-sys-catman .cat ./usr/share/man/cat9/cpu_coredump.0 comp-sys-catman .cat ./usr/share/man/cat9/cpu_dump.0 comp-sys-catman .cat @@ -15906,6 +15917,17 @@ ./usr/share/man/html9/copyoutstr.html comp-sys-htmlman html ./usr/share/man/html9/copystr.html comp-sys-htmlman html ./usr/share/man/html9/coredump_write.html comp-sys-htmlman html +./usr/share/man/html9/cprng.html comp-sys-htmlman html +./usr/share/man/html9/cprng_strong.html comp-sys-htmlman html +./usr/share/man/html9/cprng_strong_create.html comp-sys-htmlman html +./usr/share/man/html9/cprng_strong_destroy.html comp-sys-htmlman html +./usr/share/man/html9/cprng_strong_getflags.html comp-sys-htmlman html +./usr/share/man/html9/cprng_strong_setflags.html comp-sys-htmlman html +./usr/share/man/html9/cprng_strong32.html comp-sys-htmlman html +./usr/share/man/html9/cprng_strong64.html comp-sys-htmlman html +./usr/share/man/html9/cprng_fast.html comp-sys-htmlman html +./usr/share/man/html9/cprng_fast32.html comp-sys-htmlman html +./usr/share/man/html9/cprng_fast64.html comp-sys-htmlman html ./usr/share/man/html9/cpu_configure.html comp-sys-htmlman html ./usr/share/man/html9/cpu_coredump.html comp-sys-htmlman html ./usr/share/man/html9/cpu_dump.html comp-sys-htmlman html @@ -22152,6 +22174,17 @@ ./usr/share/man/man9/copyoutstr.9 comp-sys-man .man ./usr/share/man/man9/copystr.9 comp-sys-man .man ./usr/share/man/man9/coredump_write.9 comp-sys-man .man +./usr/share/man/man9/cprng.9 comp-sys-man .man +./usr/share/man/man9/cprng_strong.9 comp-sys-man .man +./usr/share/man/man9/cprng_strong_create.9 comp-sys-man .man +./usr/share/man/man9/cprng_strong_destroy.9 comp-sys-man .man +./usr/share/man/man9/cprng_strong_getflags.9 comp-sys-man .man +./usr/share/man/man9/cprng_strong_setflags.9 comp-sys-man .man +./usr/share/man/man9/cprng_strong32.9 comp-sys-man .man +./usr/share/man/man9/cprng_strong64.9 comp-sys-man .man +./usr/share/man/man9/cprng_fast.9 comp-sys-man .man +./usr/share/man/man9/cprng_fast32.9 comp-sys-man .man +./usr/share/man/man9/cprng_fast64.9 comp-sys-man .man ./usr/share/man/man9/cpu_configure.9 comp-sys-man .man ./usr/share/man/man9/cpu_coredump.9 comp-sys-man .man ./usr/share/man/man9/cpu_dump.9 comp-sys-man .man Index: src/share/man/man9/Makefile diff -u src/share/man/man9/Makefile:1.359 src/share/man/man9/Makefile:1.360 --- src/share/man/man9/Makefile:1.359 Tue Nov 15 00:50:55 2011 +++ src/share/man/man9/Makefile Mon Nov 28 20:19:28 2011 @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.359 2011/11/15 00:50:55 jym Exp $ +# $NetBSD: Makefile,v 1.360 2011/11/28 20:19:28 tls Exp $ # Makefile for section 9 (kernel function and variable) manual pages. MAN= accept_filter.9 accf_data.9 accf_http.9 \ - altq.9 arc4random.9 arp.9 audio.9 a
CVS commit: src/sys/secmodel/securelevel
Module Name:src Committed By: jym Date: Mon Nov 28 20:57:52 UTC 2011 Modified Files: src/sys/secmodel/securelevel: secmodel_securelevel.c Log Message: Whitespace fixes. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 \ 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.21 src/sys/secmodel/securelevel/secmodel_securelevel.c:1.22 --- src/sys/secmodel/securelevel/secmodel_securelevel.c:1.21 Wed Nov 23 10:47:48 2011 +++ src/sys/secmodel/securelevel/secmodel_securelevel.c Mon Nov 28 20:57:51 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_securelevel.c,v 1.21 2011/11/23 10:47:48 tls Exp $ */ +/* $NetBSD: secmodel_securelevel.c,v 1.22 2011/11/28 20:57:51 jym Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -28,14 +28,14 @@ /* * This file contains kauth(9) listeners needed to implement the traditional - * NetBSD securelevel. + * NetBSD securelevel. * * The securelevel is a system-global indication on what operations are * allowed or not. It affects all users, including root. */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_securelevel.c,v 1.21 2011/11/23 10:47:48 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_securelevel.c,v 1.22 2011/11/28 20:57:51 jym Exp $"); #ifdef _KERNEL_OPT #include "opt_insecure.h" @@ -71,7 +71,7 @@ static struct sysctllog *securelevel_sys */ int secmodel_securelevel_sysctl(SYSCTLFN_ARGS) -{ +{ int newsecurelevel, error; struct sysctlnode node; @@ -81,7 +81,7 @@ secmodel_securelevel_sysctl(SYSCTLFN_ARG error = sysctl_lookup(SYSCTLFN_CALL(&node)); if (error || newp == NULL) return (error); - + if ((newsecurelevel < securelevel) && (l->l_proc != initproc)) return (EPERM); @@ -424,7 +424,7 @@ secmodel_securelevel_network_cb(kauth_cr return (result); } -/* +/* * kauth(9) listener * * Security model: Traditional NetBSD @@ -462,7 +462,7 @@ secmodel_securelevel_machdep_cb(kauth_cr * kauth(9) listener * * Security model: Traditional NetBSD - * Scope: Device + * Scope: Device * Responsibility: Securelevel */ int
CVS commit: src/sys/secmodel
Module Name:src Committed By: jym Date: Mon Nov 28 22:28:34 UTC 2011 Modified Files: src/sys/secmodel/bsd44: secmodel_bsd44.c src/sys/secmodel/overlay: secmodel_overlay.c Log Message: The secmodel(9)s init, start and stop routines are managed by each secmodel module(7), so there is no point in calling suser/securelevel routines from bsd44. This leads to unwanted cross-secmodel dependencies. Do not call secmodel_bsd44_init() from secmodel_overlay_init(). Doing so resets all curtain/securelevel values, which is not really needed when loading an overlay filter. Remove the secmodel_register/deregister comments, they will be implemented differently in an upcoming patch. ok elad@ (via private mail). To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/secmodel/bsd44/secmodel_bsd44.c cvs rdiff -u -r1.10 -r1.11 src/sys/secmodel/overlay/secmodel_overlay.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/bsd44/secmodel_bsd44.c diff -u src/sys/secmodel/bsd44/secmodel_bsd44.c:1.13 src/sys/secmodel/bsd44/secmodel_bsd44.c:1.14 --- src/sys/secmodel/bsd44/secmodel_bsd44.c:1.13 Fri Oct 2 18:50:13 2009 +++ src/sys/secmodel/bsd44/secmodel_bsd44.c Mon Nov 28 22:28:33 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_bsd44.c,v 1.13 2009/10/02 18:50:13 elad Exp $ */ +/* $NetBSD: secmodel_bsd44.c,v 1.14 2011/11/28 22:28:33 jym Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_bsd44.c,v 1.13 2009/10/02 18:50:13 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_bsd44.c,v 1.14 2011/11/28 22:28:33 jym Exp $"); #include #include @@ -79,26 +79,19 @@ sysctl_security_bsd44_setup(struct sysct void secmodel_bsd44_init(void) { - secmodel_suser_init(); - secmodel_securelevel_init(); + } void secmodel_bsd44_start(void) { - secmodel_suser_start(); - secmodel_securelevel_start(); - /* secmodel_register(); */ } void secmodel_bsd44_stop(void) { - secmodel_suser_stop(); - secmodel_securelevel_stop(); - /* secmodel_deregister(); */ } static int Index: src/sys/secmodel/overlay/secmodel_overlay.c diff -u src/sys/secmodel/overlay/secmodel_overlay.c:1.10 src/sys/secmodel/overlay/secmodel_overlay.c:1.11 --- src/sys/secmodel/overlay/secmodel_overlay.c:1.10 Fri Oct 2 18:50:13 2009 +++ src/sys/secmodel/overlay/secmodel_overlay.c Mon Nov 28 22:28:34 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_overlay.c,v 1.10 2009/10/02 18:50:13 elad Exp $ */ +/* $NetBSD: secmodel_overlay.c,v 1.11 2011/11/28 22:28:34 jym Exp $ */ /*- * Copyright (c) 2006 Elad Efrat * All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: secmodel_overlay.c,v 1.10 2009/10/02 18:50:13 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_overlay.c,v 1.11 2011/11/28 22:28:34 jym Exp $"); #include #include @@ -123,8 +123,6 @@ secmodel_overlay_init(void) secmodel_suser_device_cb, NULL); kauth_listen_scope(OVERLAY_ISCOPE_DEVICE, secmodel_securelevel_device_cb, NULL); - - secmodel_bsd44_init(); } void @@ -178,8 +176,6 @@ secmodel_overlay_start(void) secmodel_overlay_device_cb, NULL); l_vnode = kauth_listen_scope(KAUTH_SCOPE_VNODE, secmodel_overlay_vnode_cb, NULL); - - /* secmodel_register(); */ } /* @@ -205,7 +201,8 @@ secmodel_overlay_modcmd(modcmd_t cmd, vo switch (cmd) { case MODULE_CMD_INIT: secmodel_overlay_init(); - secmodel_bsd44_stop(); + secmodel_suser_stop(); + secmodel_securelevel_stop(); secmodel_overlay_start(); sysctl_security_overlay_setup(&sysctl_overlay_log); break;
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Mon Nov 28 23:27:59 UTC 2011 Modified Files: src/share/man/man9: cprng.9 Log Message: Whitespace fixes; new sentence, new line; better macro usage. Sort SEE ALSO. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/share/man/man9/cprng.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/cprng.9 diff -u src/share/man/man9/cprng.9:1.1 src/share/man/man9/cprng.9:1.2 --- src/share/man/man9/cprng.9:1.1 Mon Nov 28 20:19:28 2011 +++ src/share/man/man9/cprng.9 Mon Nov 28 23:27:59 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: cprng.9,v 1.1 2011/11/28 20:19:28 tls Exp $ +.\" $NetBSD: cprng.9,v 1.2 2011/11/28 23:27:59 wiz Exp $ .\" .\" Copyright (c) 2011 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -38,7 +38,7 @@ .Nm cprng_strong64 , .Nm cprng_strong_getflags , .Nm cprng_strong_setflags , -.Nm cprng_strong_destroy , +.Nm cprng_strong_destroy , .Nm cprng_fast , .Nm cprng_fast32 , .Nm cprng_fast64 , @@ -46,13 +46,13 @@ .Sh SYNOPSIS .In sys/cprng.h .Ft cprng_strong_t -.Fn cprng_strong_create "const char *const name, int ipl, int flags" +.Fn cprng_strong_create "const char *const name" "int ipl" "int flags" .Ft void .Fn cprng_strong_destroy "cprng_strong_t *cprng" .Ft size_t -.Fn cprng_strong "cprng_strong_t *const cprng, void *buf, size_t len" +.Fn cprng_strong "cprng_strong_t *const cprng" "void *buf" "size_t len" .Ft size_t -.Fn cprng_fast "void *buf, size_t len" +.Fn cprng_fast "void *buf" "size_t len" .Ft uint32_t .Fn cprng_strong32 "void" .Ft uint64_t @@ -64,7 +64,7 @@ .Ft int .Fn cprng_strong_getflags "cprng_strong_t *const cprng" .Ft void -.Fn cprng_strong_setflags "cprng_strong_t *const cprng, int flags" +.Fn cprng_strong_setflags "cprng_strong_t *const cprng" "int flags" .Bd -literal #define CPRNG_MAX_LEN 524288 @@ -78,20 +78,22 @@ typedef struct _cprng_strong { rndsink_t reseed; } cprng_strong_t; .Ed -.Pp .Sh DESCRIPTION The .Nm family of functions supply randomness to callers within the .Nx -kernel. They replace the +kernel. +They replace the .Xr arc4random 9 and .Xr rnd_extract_data 9 -functions for this purpose. The +functions for this purpose. +The .Nm functions provide stream generators automatically keyed (and if -necessary rekeyed) from the kernel entropy pool. The +necessary rekeyed) from the kernel entropy pool. +The .Nx kernel no longer supports direct reading from the kernel entropy pool; all access is mediated by the @@ -101,7 +103,8 @@ functions. The .Dq strong family of functions supply cryptographically strong random numbers -suitable for keying cryptosystems and similar purposes. Calls to +suitable for keying cryptosystems and similar purposes. +Calls to .Xr rnd_extract_data 9 should be replaced with calls to .Nm cprng_strong . @@ -111,7 +114,8 @@ The family of functions supply less strong random numbers, suitable for initialization vectors, nonces in certain protocols, and other similar purposes, using a faster but less secure stream-cipher generator. -stream-cipher generator. Calls to +stream-cipher generator. +Calls to .Xr arc4random 9 should be replaced with calls to .Nm cprng_fast32 , @@ -136,7 +140,8 @@ generator can also be created by calling .Bl -tag -width abcd .It Fn cprng_strong_create "name" "ipl" "flags" .Pp -Create an instance of the cprng_strong generator. This generator +Create an instance of the cprng_strong generator. +This generator implements the NIST SP 800-90 CTR_DRBG with AES128 as the block transform. The .Fa name @@ -147,7 +152,7 @@ The .Fa ipl argument specifies the interrupt priority level for the mutex which will serialize access to the new instance of the generator (see -.Xr spl 9 ). +.Xr spl 9 ) . The .Fa flags argument controls the behavior of the generator: @@ -168,7 +173,8 @@ the generator is successfully rekeyed. .El .Pp Creation will succeed even if key material for the generator is not -available. In this case, the first request to read from the generator +available. +In this case, the first request to read from the generator may cause rekeying. .It Fn cprng_strong_destroy "cprng" .Pp @@ -177,13 +183,14 @@ Destroy an instance of the cprng_strong .Pp Fill memory location .Fa buf -with +with .Fa len bytes from the generator .Fa cprng . If less than .Fa len -bytes are returned, the generator requires rekeying. If the +bytes are returned, the generator requires rekeying. +If the .Dv CPRNG_USE_CV flag is set on the generator, the caller can wait on .Dv cprng->cv @@ -235,8 +242,8 @@ generator uses the arc4random implementa .Pa sys/lib/libkern/arc4random.c . .Sh SEE ALSO .Xr condvar 9 , -.Xr spl 9 , -.Xr rnd 9 +.Xr rnd 9 , +.Xr spl 9 .Pp .Rs .%A Elaine Barker
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Mon Nov 28 23:29:45 UTC 2011 Modified Files: src/share/man/man9: cprng.9 Log Message: Spelling. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/share/man/man9/cprng.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/cprng.9 diff -u src/share/man/man9/cprng.9:1.2 src/share/man/man9/cprng.9:1.3 --- src/share/man/man9/cprng.9:1.2 Mon Nov 28 23:27:59 2011 +++ src/share/man/man9/cprng.9 Mon Nov 28 23:29:45 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: cprng.9,v 1.2 2011/11/28 23:27:59 wiz Exp $ +.\" $NetBSD: cprng.9,v 1.3 2011/11/28 23:29:45 wiz Exp $ .\" .\" Copyright (c) 2011 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -42,7 +42,7 @@ .Nm cprng_fast , .Nm cprng_fast32 , .Nm cprng_fast64 , -.Nd cryptographic pseudorandom number generators +.Nd cryptographic pseudo-random number generators .Sh SYNOPSIS .In sys/cprng.h .Ft cprng_strong_t @@ -103,7 +103,7 @@ functions. The .Dq strong family of functions supply cryptographically strong random numbers -suitable for keying cryptosystems and similar purposes. +suitable for keying crypto systems and similar purposes. Calls to .Xr rnd_extract_data 9 should be replaced with calls to @@ -163,7 +163,7 @@ the current estimate of entropy in the p number of key bits for the generator. .It Dv CPRNG_REKEY_ANY When rekeying of the generator is required, key the generator from the -entrpy pool even if the current estimate of entropy in the pool is less +entropy pool even if the current estimate of entropy in the pool is less than the required number of key bits for the generator. .It Dv CPRNG_USE_CV Perform a
CVS commit: src/usr.sbin/npf/npfctl
Module Name:src Committed By: riz Date: Tue Nov 29 01:12:10 UTC 2011 Modified Files: src/usr.sbin/npf/npfctl: npf.conf.5 Log Message: Remove quotes from "hash" and "tree" in the table examples so the example stands a chance of actually working as written. There appear to be other problems, too. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/npf/npfctl/npf.conf.5 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/npf/npfctl/npf.conf.5 diff -u src/usr.sbin/npf/npfctl/npf.conf.5:1.5 src/usr.sbin/npf/npfctl/npf.conf.5:1.6 --- src/usr.sbin/npf/npfctl/npf.conf.5:1.5 Tue Mar 22 07:31:42 2011 +++ src/usr.sbin/npf/npfctl/npf.conf.5 Tue Nov 29 01:12:09 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: npf.conf.5,v 1.5 2011/03/22 07:31:42 jruoho Exp $ +.\" $NetBSD: npf.conf.5,v 1.6 2011/11/29 01:12:09 riz Exp $ .\" .\" Copyright (c) 2009-2011 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -177,8 +177,8 @@ int_if = "wm1" services_tcp = "{ http, https, smtp, domain, 6000 }" services_udp = "{ domain, ntp, 6000 }" -table "1" type "hash" file "/etc/npf_blacklist" -table "2" type "tree" dynamic +table "1" type hash file "/etc/npf_blacklist" +table "2" type tree dynamic nat $ext_if from 192.168.0.0/24 to any -> $ext_if
CVS commit: src
Module Name:src Committed By: tls Date: Tue Nov 29 03:40:44 UTC 2011 Modified Files: src/distrib/sets/lists/comp: mi src/share/man/man9: Makefile Log Message: Add (links for) missing "cross-references" from cprng(9). Some of the functions replaced by cprng were never documented at all. To generate a diff of this commit: cvs rdiff -u -r1.1714 -r1.1715 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.360 -r1.361 src/share/man/man9/Makefile 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/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.1714 src/distrib/sets/lists/comp/mi:1.1715 --- src/distrib/sets/lists/comp/mi:1.1714 Mon Nov 28 20:19:25 2011 +++ src/distrib/sets/lists/comp/mi Tue Nov 29 03:40:42 2011 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1714 2011/11/28 20:19:25 tls Exp $ +# $NetBSD: mi,v 1.1715 2011/11/29 03:40:42 tls Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -9576,6 +9576,7 @@ ./usr/share/man/cat9/aprint_verbose_dev.0 comp-sys-catman .cat ./usr/share/man/cat9/aprint_verbose_ifnet.0 comp-sys-catman .cat ./usr/share/man/cat9/arc4random.0 comp-sys-catman .cat +./usr/share/man/cat9/arc4randbytes.0 comp-sys-catman .cat ./usr/share/man/cat9/arp.0 comp-sys-catman .cat ./usr/share/man/cat9/arp_ifinit.0 comp-sys-catman .cat ./usr/share/man/cat9/arpintr.0 comp-sys-catman .cat @@ -10475,6 +10476,7 @@ ./usr/share/man/cat9/rnd_add_uint32.0 comp-sys-catman .cat ./usr/share/man/cat9/rnd_attach_source.0 comp-sys-catman .cat ./usr/share/man/cat9/rnd_detach_source.0 comp-sys-catman .cat +./usr/share/man/cat9/rnd_extract_data.0 comp-sys-catman .cat ./usr/share/man/cat9/rounddown.0 comp-sys-catman .cat ./usr/share/man/cat9/roundup.0 comp-sys-catman .cat ./usr/share/man/cat9/roundup2.0 comp-sys-catman .cat @@ -15719,6 +15721,7 @@ ./usr/share/man/html9/aprint_verbose_dev.html comp-sys-htmlman html ./usr/share/man/html9/aprint_verbose_ifnet.html comp-sys-htmlman html ./usr/share/man/html9/arc4random.html comp-sys-htmlman html +./usr/share/man/html9/arc4randbytes.html comp-sys-htmlman html ./usr/share/man/html9/arp.html comp-sys-htmlman html ./usr/share/man/html9/arp_ifinit.html comp-sys-htmlman html ./usr/share/man/html9/arpintr.html comp-sys-htmlman html @@ -16579,6 +16582,7 @@ ./usr/share/man/html9/rnd_add_uint32.html comp-sys-htmlman html ./usr/share/man/html9/rnd_attach_source.html comp-sys-htmlman html ./usr/share/man/html9/rnd_detach_source.html comp-sys-htmlman html +./usr/share/man/html9/rnd_extract_data.html comp-sys-htmlman html ./usr/share/man/html9/rounddown.html comp-sys-htmlman html ./usr/share/man/html9/roundup.html comp-sys-htmlman html ./usr/share/man/html9/roundup2.html comp-sys-htmlman html @@ -21971,6 +21975,7 @@ ./usr/share/man/man9/aprint_verbose_dev.9 comp-sys-man .man ./usr/share/man/man9/aprint_verbose_ifnet.9 comp-sys-man .man ./usr/share/man/man9/arc4random.9 comp-sys-man .man +./usr/share/man/man9/arc4randbytes.9 comp-sys-man .man ./usr/share/man/man9/arp.9 comp-sys-man .man ./usr/share/man/man9/arp_ifinit.9 comp-sys-man .man ./usr/share/man/man9/arpintr.9 comp-sys-man .man @@ -22870,6 +22875,7 @@ ./usr/share/man/man9/rnd_add_uint32.9 comp-sys-man .man ./usr/share/man/man9/rnd_attach_source.9 comp-sys-man .man ./usr/share/man/man9/rnd_detach_source.9 comp-sys-man .man +./usr/share/man/man9/rnd_extract_data.9 comp-sys-man .man ./usr/share/man/man9/rounddown.9 comp-sys-man .man ./usr/share/man/man9/roundup.9 comp-sys-man .man ./usr/share/man/man9/roundup2.9 comp-sys-man .man Index: src/share/man/man9/Makefile diff -u src/share/man/man9/Makefile:1.360 src/share/man/man9/Makefile:1.361 --- src/share/man/man9/Makefile:1.360 Mon Nov 28 20:19:28 2011 +++ src/share/man/man9/Makefile Tue Nov 29 03:40:41 2011 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.360 2011/11/28 20:19:28 tls Exp $ +# $NetBSD: Makefile,v 1.361 2011/11/29 03:40:41 tls Exp $ # Makefile for section 9 (kernel function and variable) manual pages. @@ -74,7 +74,9 @@ MLINKS+=cprng.9 cprng_strong.9 \ cprng.9 cprng_fast.9 \ cprng.9 cprng_fast32.9 \ cprng.9 cprng_fast64.9 \ - cprng.9 arc4random.9 + cprng.9 arc4random.9 \ + cprng.9 arc4randbytes.9 \ + cprng.9 rnd_extract_data.9 MAN+= deviter.9 MLINKS+=deviter.9 deviter_first.9 \
CVS commit: src/sys
Module Name:src Committed By: tls Date: Tue Nov 29 03:50:32 UTC 2011 Modified Files: src/sys/dev: rnd.c rndpool.c src/sys/dev/iscsi: iscsi_globals.h iscsi_test.c iscsi_text.c src/sys/dev/pci: hifn7751.c src/sys/kern: subr_cprng.c src/sys/lib/libkern: arc4random.c src/sys/sys: rnd.h Added Files: src/sys/dev: rnd_private.h Log Message: Remove rnd_extract_data from the public kernel API (it is for use by the stream generators only). Clean up some related minor issues. To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sys/dev/rnd.c cvs rdiff -u -r0 -r1.1 src/sys/dev/rnd_private.h cvs rdiff -u -r1.20 -r1.21 src/sys/dev/rndpool.c cvs rdiff -u -r1.1 -r1.2 src/sys/dev/iscsi/iscsi_globals.h \ src/sys/dev/iscsi/iscsi_test.c src/sys/dev/iscsi/iscsi_text.c cvs rdiff -u -r1.47 -r1.48 src/sys/dev/pci/hifn7751.c cvs rdiff -u -r1.2 -r1.3 src/sys/kern/subr_cprng.c cvs rdiff -u -r1.27 -r1.28 src/sys/lib/libkern/arc4random.c cvs rdiff -u -r1.25 -r1.26 src/sys/sys/rnd.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/dev/rnd.c diff -u src/sys/dev/rnd.c:1.87 src/sys/dev/rnd.c:1.88 --- src/sys/dev/rnd.c:1.87 Mon Nov 28 07:56:54 2011 +++ src/sys/dev/rnd.c Tue Nov 29 03:50:31 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rnd.c,v 1.87 2011/11/28 07:56:54 tls Exp $ */ +/* $NetBSD: rnd.c,v 1.88 2011/11/29 03:50:31 tls Exp $ */ /*- * Copyright (c) 1997-2011 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.87 2011/11/28 07:56:54 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.88 2011/11/29 03:50:31 tls Exp $"); #include #include @@ -54,6 +54,8 @@ __KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.87 #include #include /* XXX temporary, see rnd_detach_source */ +#include + #if defined(__HAVE_CPU_COUNTER) && !defined(_RUMPKERNEL) /* XXX: bad pooka */ #include #endif Index: src/sys/dev/rndpool.c diff -u src/sys/dev/rndpool.c:1.20 src/sys/dev/rndpool.c:1.21 --- src/sys/dev/rndpool.c:1.20 Mon Apr 28 20:23:47 2008 +++ src/sys/dev/rndpool.c Tue Nov 29 03:50:31 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rndpool.c,v 1.20 2008/04/28 20:23:47 martin Exp $*/ +/* $NetBSD: rndpool.c,v 1.21 2011/11/29 03:50:31 tls Exp $*/ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -31,13 +31,14 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rndpool.c,v 1.20 2008/04/28 20:23:47 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rndpool.c,v 1.21 2011/11/29 03:50:31 tls Exp $"); #include #include #include #include +#include /* * The random pool "taps" @@ -64,7 +65,7 @@ rndpool_init(rndpool_t *rp) rp->stats.threshold = RND_ENTROPY_THRESHOLD; rp->stats.maxentropy = RND_POOLBITS; - KASSERT(RND_ENTROPY_THRESHOLD*2 <= 20); /* XXX sha knowledge */ + KASSERT(RND_ENTROPY_THRESHOLD * 2 <= SHA1_DIGEST_LENGTH); } u_int32_t @@ -250,7 +251,7 @@ rndpool_extract_data(rndpool_t *rp, void { u_int i; SHA1_CTX hash; - u_char digest[20]; /* XXX SHA knowledge */ + u_char digest[SHA1_DIGEST_LENGTH]; u_int32_t remain, deltae, count; u_int8_t *buf; int good; @@ -263,7 +264,7 @@ rndpool_extract_data(rndpool_t *rp, void else good = (rp->stats.curentropy >= (8 * RND_ENTROPY_THRESHOLD)); - KASSERT(RND_ENTROPY_THRESHOLD*2 <= 20); /* XXX SHA knowledge */ + KASSERT(RND_ENTROPY_THRESHOLD * 2 <= sizeof(digest)); while (good && (remain != 0)) { /* Index: src/sys/dev/iscsi/iscsi_globals.h diff -u src/sys/dev/iscsi/iscsi_globals.h:1.1 src/sys/dev/iscsi/iscsi_globals.h:1.2 --- src/sys/dev/iscsi/iscsi_globals.h:1.1 Sun Oct 23 21:15:02 2011 +++ src/sys/dev/iscsi/iscsi_globals.h Tue Nov 29 03:50:31 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: iscsi_globals.h,v 1.1 2011/10/23 21:15:02 agc Exp $ */ +/* $NetBSD: iscsi_globals.h,v 1.2 2011/11/29 03:50:31 tls Exp $ */ /*- * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc. @@ -554,25 +554,6 @@ uint8_t InitiatorName[ISCSI_STRING_LENGT uint8_t InitiatorAlias[ISCSI_STRING_LENGTH]; login_isid_t InitiatorISID; - -/* - Global Functions - */ - -#ifdef __NetBSD__ -#define GEN_RAND(buffer, len) rnd_extract_data (buffer, len, RND_EXTRACT_ANY) -#else -#define GEN_RAND(buffer, len) get_random_bytes (buffer, len) -#endif - -static __inline uint8_t -randb(void) -{ - uint8_t buf; - - GEN_RAND(&buf, 1); - return buf; -} - - /* Debugging and profiling stuff */ #include "iscsi_profile.h" Index: src/sys/dev/iscsi/iscsi_test.c diff -u src/sys/dev/iscsi/iscsi_test.c:1.1 src/sys/dev/iscsi/iscsi_test.c:1.2 --- src/sys/dev/iscsi/iscsi_test.c:1.1 Sun Oct 23 21:15:02 2011 +++ src/sys/dev/iscsi/iscsi_test.c Tue Nov 29 03:50:31 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: iscsi_test.c,v 1.1 2011/10/23 21:15:02 agc Exp $ */ +/* $NetBSD: iscsi_test.c,v 1.2 2011/11/29 03:50:31 tls Exp $ */ /*- * Copyrigh
CVS commit: src/sys/uvm
Module Name:src Committed By: matt Date: Tue Nov 29 07:43:55 UTC 2011 Modified Files: src/sys/uvm: uvm_param.h Log Message: Redefine ptoa() to be the inverse of atop. If you were using a 32-bit vaddr_t with 64-bit paddr_t and using managed addresses > 4GB, uvm_page_init would silently discard the upper 32-bits of the physical address possibly double mapping pages. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/uvm/uvm_param.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/uvm/uvm_param.h diff -u src/sys/uvm/uvm_param.h:1.25 src/sys/uvm/uvm_param.h:1.26 --- src/sys/uvm/uvm_param.h:1.25 Sun Nov 14 04:31:02 2010 +++ src/sys/uvm/uvm_param.h Tue Nov 29 07:43:54 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_param.h,v 1.25 2010/11/14 04:31:02 uebayasi Exp $ */ +/* $NetBSD: uvm_param.h,v 1.26 2011/11/29 07:43:54 matt Exp $ */ /* * Copyright (c) 1991, 1993 @@ -199,7 +199,7 @@ extern int *uvmexp_pageshift; */ #ifdef _KERNEL #define atop(x) (((paddr_t)(x)) >> PAGE_SHIFT) -#define ptoa(x) ((vaddr_t)((vaddr_t)(x) << PAGE_SHIFT)) +#define ptoa(x) (((paddr_t)(x)) << PAGE_SHIFT) /* * Round off or truncate to the nearest page. These will work
CVS commit: [matt-nb5-mips64] src/sys/uvm
Module Name:src Committed By: matt Date: Tue Nov 29 07:44:52 UTC 2011 Modified Files: src/sys/uvm [matt-nb5-mips64]: uvm_param.h Log Message: Redefine ptoa() to be the inverse of atop. If you were using a 32-bit vaddr_t with 64-bit paddr_t and using managed addresses > 4GB, uvm_page_init would silently discard the upper 32-bits of the physical address possibly double mapping pages. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.21.78.1 src/sys/uvm/uvm_param.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/uvm/uvm_param.h diff -u src/sys/uvm/uvm_param.h:1.21 src/sys/uvm/uvm_param.h:1.21.78.1 --- src/sys/uvm/uvm_param.h:1.21 Fri Aug 4 22:42:36 2006 +++ src/sys/uvm/uvm_param.h Tue Nov 29 07:44:52 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_param.h,v 1.21 2006/08/04 22:42:36 he Exp $ */ +/* $NetBSD: uvm_param.h,v 1.21.78.1 2011/11/29 07:44:52 matt Exp $ */ /* * Copyright (c) 1991, 1993 @@ -196,7 +196,7 @@ */ #ifdef _KERNEL #define atop(x) (((paddr_t)(x)) >> PAGE_SHIFT) -#define ptoa(x) ((vaddr_t)((vaddr_t)(x) << PAGE_SHIFT)) +#define ptoa(x) (((paddr_t)(x)) << PAGE_SHIFT) /* * Round off or truncate to the nearest page. These will work
CVS commit: [matt-nb5-mips64] src/sys/uvm
Module Name:src Committed By: matt Date: Tue Nov 29 07:45:58 UTC 2011 Modified Files: src/sys/uvm [matt-nb5-mips64]: uvm_page.c Log Message: Add a macro to allow a port to control from which freelists "normal" pages can be allocated. To generate a diff of this commit: cvs rdiff -u -r1.140.6.3.4.5 -r1.140.6.3.4.6 src/sys/uvm/uvm_page.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/uvm/uvm_page.c diff -u src/sys/uvm/uvm_page.c:1.140.6.3.4.5 src/sys/uvm/uvm_page.c:1.140.6.3.4.6 --- src/sys/uvm/uvm_page.c:1.140.6.3.4.5 Fri Jun 3 07:59:58 2011 +++ src/sys/uvm/uvm_page.c Tue Nov 29 07:45:57 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_page.c,v 1.140.6.3.4.5 2011/06/03 07:59:58 matt Exp $ */ +/* $NetBSD: uvm_page.c,v 1.140.6.3.4.6 2011/11/29 07:45:57 matt Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -71,7 +71,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.140.6.3.4.5 2011/06/03 07:59:58 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.140.6.3.4.6 2011/11/29 07:45:57 matt Exp $"); #include "opt_uvmhist.h" #include "opt_readahead.h" @@ -1166,6 +1166,14 @@ uvm_pagealloc_strat(struct uvm_object *o case UVM_PGA_STRAT_NORMAL: /* Check all freelists in descending priority order. */ for (lcv = 0; lcv < VM_NFREELIST; lcv++) { +#ifdef VM_FREELIST_NORMALOK_P + /* + * Verify if this freelist can be used for normal + * page allocations. + */ + if (!VM_FREELIST_NORMALOK_P(lcv)) +continue; +#endif pg = uvm_pagealloc_pgfl(ucpu, lcv, try1, try2, &color, anycolor); if (pg != NULL)
CVS commit: [matt-nb5-mips64] src/sys/arch
Module Name:src Committed By: matt Date: Tue Nov 29 07:48:32 UTC 2011 Modified Files: src/sys/arch/evbmips/conf [matt-nb5-mips64]: XLSATX32 src/sys/arch/evbmips/include [matt-nb5-mips64]: vmparam.h src/sys/arch/evbmips/rmixl [matt-nb5-mips64]: machdep.c src/sys/arch/mips/conf [matt-nb5-mips64]: files.mips src/sys/arch/mips/include [matt-nb5-mips64]: vmparam.h src/sys/arch/mips/mips [matt-nb5-mips64]: cpu_subr.c genassym.cf mem.c pmap.c pmap_segtab.c vm_machdep.c Log Message: Take part of the KSEG2 space and use it to "almost" direct another 256MB of memory so that N32 kernels can make use of ram outside of KSEG0. This allows N32 kernels to be useful on systems with 4GB of RAM or more. To generate a diff of this commit: cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/evbmips/conf/XLSATX32 cvs rdiff -u -r1.1.142.4 -r1.1.142.5 src/sys/arch/evbmips/include/vmparam.h cvs rdiff -u -r1.1.2.35 -r1.1.2.36 src/sys/arch/evbmips/rmixl/machdep.c cvs rdiff -u -r1.58.24.15 -r1.58.24.16 src/sys/arch/mips/conf/files.mips cvs rdiff -u -r1.41.28.20 -r1.41.28.21 src/sys/arch/mips/include/vmparam.h cvs rdiff -u -r1.1.2.19 -r1.1.2.20 src/sys/arch/mips/mips/cpu_subr.c cvs rdiff -u -r1.44.12.27 -r1.44.12.28 src/sys/arch/mips/mips/genassym.cf cvs rdiff -u -r1.35.38.6 -r1.35.38.7 src/sys/arch/mips/mips/mem.c cvs rdiff -u -r1.179.16.30 -r1.179.16.31 src/sys/arch/mips/mips/pmap.c cvs rdiff -u -r1.1.2.10 -r1.1.2.11 src/sys/arch/mips/mips/pmap_segtab.c cvs rdiff -u -r1.121.6.1.2.21 -r1.121.6.1.2.22 \ src/sys/arch/mips/mips/vm_machdep.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/evbmips/conf/XLSATX32 diff -u src/sys/arch/evbmips/conf/XLSATX32:1.1.2.2 src/sys/arch/evbmips/conf/XLSATX32:1.1.2.3 --- src/sys/arch/evbmips/conf/XLSATX32:1.1.2.2 Fri Apr 29 09:27:12 2011 +++ src/sys/arch/evbmips/conf/XLSATX32 Tue Nov 29 07:48:32 2011 @@ -1,10 +1,13 @@ -# $NetBSD: XLSATX32,v 1.1.2.2 2011/04/29 09:27:12 matt Exp $ +# $NetBSD: XLSATX32,v 1.1.2.3 2011/11/29 07:48:32 matt Exp $ # -#ident "XLSATX32-$Revision: 1.1.2.2 $" +#ident "XLSATX32-$Revision: 1.1.2.3 $" include "arch/evbmips/conf/XLSATX" -options MEMLIMIT=0x2000 # 512MB +#options MEMLIMIT=0x2000 # 512MB +options ENABLE_MIPS_KSEGX +#no options NFS_BOOT_DHCP +#options NFS_BOOT_BOOTP makeoptions LP64="no" Index: src/sys/arch/evbmips/include/vmparam.h diff -u src/sys/arch/evbmips/include/vmparam.h:1.1.142.4 src/sys/arch/evbmips/include/vmparam.h:1.1.142.5 --- src/sys/arch/evbmips/include/vmparam.h:1.1.142.4 Wed Jan 6 04:24:38 2010 +++ src/sys/arch/evbmips/include/vmparam.h Tue Nov 29 07:48:32 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.1.142.4 2010/01/06 04:24:38 matt Exp $ */ +/* $NetBSD: vmparam.h,v 1.1.142.5 2011/11/29 07:48:32 matt Exp $ */ #ifndef _EVBMIPS_VMPARAM_H_ #define _EVBMIPS_VMPARAM_H_ @@ -15,5 +15,8 @@ #if !defined(_LP64) #define VM_FREELIST_FIRST512M 1 #endif + +#define VM_FREELIST_NORMALOK_P(lcv) \ + ((lcv) == VM_FREELIST_DEFAULT || (lcv) != mips_poolpage_vmfreelist) #endif /* !_EVBMIPS_VMPARAM_H_ */ Index: src/sys/arch/evbmips/rmixl/machdep.c diff -u src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.35 src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.36 --- src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.35 Thu May 26 19:24:31 2011 +++ src/sys/arch/evbmips/rmixl/machdep.c Tue Nov 29 07:48:32 2011 @@ -97,6 +97,7 @@ __KERNEL_RCSID(0, "machdep.c,v 1.1.2.34 #include #include #include +#include #include #include #include @@ -117,6 +118,7 @@ __KERNEL_RCSID(0, "machdep.c,v 1.1.2.34 #include #include #include +#include #include "com.h" #if NCOM == 0 @@ -126,8 +128,6 @@ __KERNEL_RCSID(0, "machdep.c,v 1.1.2.34 #include #include -#include - #include #include #include @@ -163,6 +163,10 @@ bus_addr_t comcnaddr = (bus_addr_t)CONS struct rmixl_config rmixl_configuration; +#ifdef ENABLE_MIPS_KSEGX +pt_entry_t mips_ksegx_pte; +paddr_t mips_ksegx_start; +#endif /* * array of tested firmware versions @@ -244,6 +248,8 @@ mach_init(int argc, int32_t *argv, void void *kernend; uint64_t memsize; extern char edata[], end[]; + size_t fl_count = 0; + struct mips_vmfreelist fl[1]; rmixl_pcr_init_core(); @@ -365,7 +371,7 @@ mach_init(int argc, int32_t *argv, void mem_cluster_cnt = ram_seg_resv(mem_clusters, mem_cluster_cnt, 0x1FC0, 0x1FC0+NBPG); -#ifdef MULTIPROCEESOR +#ifdef MULTIPROCESSOR /* reserve the cpu_wakeup_info area */ mem_cluster_cnt = ram_seg_resv(mem_clusters, mem_cluster_cnt, (u_quad_t)trunc_page(rcp->rc_cpu_wakeup_info), @@ -378,6 +384,31 @@ mach_init(int argc, int32_t *argv, void (u_quad_t)MEMLIMIT, (u_quad_t)~0); #endif +#ifdef ENABLE_MIPS_KSEGX + /* + * Now we need to reserve an aligned block of memory for pre-init + * allocations so we don't deplete KSEG0. + */ + for (u_int