CVS commit: src/sys/arch/arm/broadcom
Module Name:src Committed By: skrll Date: Sat Jan 26 08:01:49 UTC 2013 Modified Files: src/sys/arch/arm/broadcom: bcm2835_obio.c bcm2835_space.c bcm2835reg.h Log Message: Deal with bus addresses better. Switch the DMA bus address base to the cache coherent range - not that anything uses it yet. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/broadcom/bcm2835_obio.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/broadcom/bcm2835_space.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/broadcom/bcm2835reg.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/arm/broadcom/bcm2835_obio.c diff -u src/sys/arch/arm/broadcom/bcm2835_obio.c:1.12 src/sys/arch/arm/broadcom/bcm2835_obio.c:1.13 --- src/sys/arch/arm/broadcom/bcm2835_obio.c:1.12 Fri Jan 25 00:04:06 2013 +++ src/sys/arch/arm/broadcom/bcm2835_obio.c Sat Jan 26 08:01:49 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_obio.c,v 1.12 2013/01/25 00:04:06 jmcneill Exp $ */ +/* $NetBSD: bcm2835_obio.c,v 1.13 2013/01/26 08:01:49 skrll Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: bcm2835_obio.c,v 1.12 2013/01/25 00:04:06 jmcneill Exp $); +__KERNEL_RCSID(0, $NetBSD: bcm2835_obio.c,v 1.13 2013/01/26 08:01:49 skrll Exp $); #include locators.h #include obio.h @@ -181,7 +181,7 @@ obio_attach(device_t parent, device_t se sc-sc_dmat = bcm2835_bus_dma_tag; sc-sc_dmarange.dr_sysbase = 0; - sc-sc_dmarange.dr_busbase = 0xc000; /* 0x4000 if L2 */ + sc-sc_dmarange.dr_busbase = BCM2835_BUSADDR_CACHE_COHERENT; sc-sc_dmarange.dr_len = physmem * PAGE_SIZE; bcm2835_bus_dma_tag._ranges = sc-sc_dmarange; bcm2835_bus_dma_tag._nranges = 1; Index: src/sys/arch/arm/broadcom/bcm2835_space.c diff -u src/sys/arch/arm/broadcom/bcm2835_space.c:1.4 src/sys/arch/arm/broadcom/bcm2835_space.c:1.5 --- src/sys/arch/arm/broadcom/bcm2835_space.c:1.4 Wed Jan 23 16:51:14 2013 +++ src/sys/arch/arm/broadcom/bcm2835_space.c Sat Jan 26 08:01:49 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_space.c,v 1.4 2013/01/23 16:51:14 macallan Exp $ */ +/* $NetBSD: bcm2835_space.c,v 1.5 2013/01/26 08:01:49 skrll Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: bcm2835_space.c,v 1.4 2013/01/23 16:51:14 macallan Exp $); +__KERNEL_RCSID(0, $NetBSD: bcm2835_space.c,v 1.5 2013/01/26 08:01:49 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -40,6 +40,8 @@ __KERNEL_RCSID(0, $NetBSD: bcm2835_spac #include sys/bus.h +#include arm/broadcom/bcm2835reg.h + /* Prototypes for all the bus_space structure functions */ bs_protos(bcm2835); bs_protos(bcm2835_a4x); @@ -280,7 +282,7 @@ struct bus_space bcm2835_a4x_bs_tag = { int -bcm2835_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flag, +bcm2835_bs_map(void *t, bus_addr_t ba, bus_size_t size, int flag, bus_space_handle_t *bshp) { u_long startpa, endpa, pa; @@ -288,14 +290,17 @@ bcm2835_bs_map(void *t, bus_addr_t bpa, const struct pmap_devmap *pd; int pmap_flags; - if ((pd = pmap_devmap_find_pa(bpa, size)) != NULL) { + pa = ba ~BCM2835_BUSADDR_CACHE_MASK; + + /* this does device addresses */ + if ((pd = pmap_devmap_find_pa(pa, size)) != NULL) { /* Device was statically mapped. */ - *bshp = pd-pd_va + (bpa - pd-pd_pa); + *bshp = pd-pd_va + (pa - pd-pd_pa); return 0; } - startpa = trunc_page(bpa); - endpa = round_page(bpa + size); + startpa = trunc_page(pa); + endpa = round_page(pa + size); /* XXX use extent manager to check duplicate mapping */ @@ -304,7 +309,7 @@ bcm2835_bs_map(void *t, bus_addr_t bpa, if (!va) return ENOMEM; - *bshp = (bus_space_handle_t)(va + (bpa - startpa)); + *bshp = (bus_space_handle_t)(va + (pa - startpa)); pmap_flags = (flag BUS_SPACE_MAP_CACHEABLE) ? 0 : PMAP_NOCACHE; for (pa = startpa; pa endpa; pa += PAGE_SIZE, va += PAGE_SIZE) { @@ -368,14 +373,15 @@ bcm2835_bs_vaddr(void *t, bus_space_hand } paddr_t -bcm2835_bs_mmap(void *t, bus_addr_t paddr, off_t offset, int prot, int flags) +bcm2835_bs_mmap(void *t, bus_addr_t ba, off_t offset, int prot, int flags) { + paddr_t pa = ba ~BCM2835_BUSADDR_CACHE_MASK; paddr_t bus_flags = 0; if (flags BUS_SPACE_MAP_PREFETCHABLE) bus_flags |= ARM32_MMAP_WRITECOMBINE; - return (arm_btop(paddr + offset) | bus_flags); + return (arm_btop(pa + offset) | bus_flags); } int Index: src/sys/arch/arm/broadcom/bcm2835reg.h diff -u src/sys/arch/arm/broadcom/bcm2835reg.h:1.8 src/sys/arch/arm/broadcom/bcm2835reg.h:1.9 --- src/sys/arch/arm/broadcom/bcm2835reg.h:1.8 Fri Jan 25 00:04:06 2013 +++ src/sys/arch/arm/broadcom/bcm2835reg.h Sat Jan 26 08:01:49 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835reg.h,v 1.8 2013/01/25 00:04:06 jmcneill Exp $ */ +/* $NetBSD: bcm2835reg.h,v 1.9 2013/01/26 08:01:49 skrll
CVS commit: src/sys/arch/arm/broadcom
Module Name:src Committed By: jmcneill Date: Sat Jan 26 11:58:43 UTC 2013 Modified Files: src/sys/arch/arm/broadcom: bcm2835reg.h Log Message: add vchiq base and size To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/broadcom/bcm2835reg.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/arm/broadcom/bcm2835reg.h diff -u src/sys/arch/arm/broadcom/bcm2835reg.h:1.9 src/sys/arch/arm/broadcom/bcm2835reg.h:1.10 --- src/sys/arch/arm/broadcom/bcm2835reg.h:1.9 Sat Jan 26 08:01:49 2013 +++ src/sys/arch/arm/broadcom/bcm2835reg.h Sat Jan 26 11:58:43 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835reg.h,v 1.9 2013/01/26 08:01:49 skrll Exp $ */ +/* $NetBSD: bcm2835reg.h,v 1.10 2013/01/26 11:58:43 jmcneill Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -93,6 +93,9 @@ #define BCM2835_ARMICU_BASE (BCM2835_ARM_BASE + 0x0200) #define BCM2835_ARMICU_SIZE 0x200 +#define BCM2835_VCHIQ_BASE (BCM2835_ARM_BASE + 0x0800) +#define BCM2835_VCHIQ_SIZE 0x50 + #define BCM2835_ARMMBOX_BASE (BCM2835_ARM_BASE + 0x0880) #define BCM2835_ARMMBOX_SIZE 0x40
CVS commit: src/sys
Module Name:src Committed By: para Date: Sat Jan 26 13:50:34 UTC 2013 Modified Files: src/sys/kern: subr_vmem.c src/sys/rump/librump/rumpkern: vm.c src/sys/sys: vmem.h src/sys/uvm: uvm_km.c Added Files: src/sys/sys: vmem_impl.h Log Message: make vmem(9) ready to be used early during bootstrap to replace extent(9). pass memory for vmem structs into the initialization functions and do away with the static pools for this. factor out the vmem internal structures into a private header. remove special bootstrapping of the kmem_va_arena as all necessary memory comes from pool_allocator_meta wich is fully operational at this point. To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/sys/kern/subr_vmem.c cvs rdiff -u -r1.132 -r1.133 src/sys/rump/librump/rumpkern/vm.c cvs rdiff -u -r1.17 -r1.18 src/sys/sys/vmem.h cvs rdiff -u -r0 -r1.1 src/sys/sys/vmem_impl.h cvs rdiff -u -r1.135 -r1.136 src/sys/uvm/uvm_km.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/subr_vmem.c diff -u src/sys/kern/subr_vmem.c:1.77 src/sys/kern/subr_vmem.c:1.78 --- src/sys/kern/subr_vmem.c:1.77 Fri Jan 4 08:28:38 2013 +++ src/sys/kern/subr_vmem.c Sat Jan 26 13:50:33 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_vmem.c,v 1.77 2013/01/04 08:28:38 para Exp $ */ +/* $NetBSD: subr_vmem.c,v 1.78 2013/01/26 13:50:33 para Exp $ */ /*- * Copyright (c)2006,2007,2008,2009 YAMAMOTO Takashi, @@ -34,7 +34,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: subr_vmem.c,v 1.77 2013/01/04 08:28:38 para Exp $); +__KERNEL_RCSID(0, $NetBSD: subr_vmem.c,v 1.78 2013/01/26 13:50:33 para Exp $); #if defined(_KERNEL) #include opt_ddb.h @@ -53,6 +53,7 @@ __KERNEL_RCSID(0, $NetBSD: subr_vmem.c, #include sys/kmem.h #include sys/pool.h #include sys/vmem.h +#include sys/vmem_impl.h #include sys/workqueue.h #include sys/atomic.h #include uvm/uvm.h @@ -61,7 +62,13 @@ __KERNEL_RCSID(0, $NetBSD: subr_vmem.c, #include uvm/uvm_page.h #include uvm/uvm_pdaemon.h #else /* defined(_KERNEL) */ +#include stdio.h +#include errno.h +#include assert.h +#include stdlib.h +#include string.h #include ../sys/vmem.h +#include ../sys/vmem_impl.h #endif /* defined(_KERNEL) */ @@ -78,28 +85,23 @@ VMEM_EVCNT_DEFINE(bt_pages) VMEM_EVCNT_DEFINE(bt_count) VMEM_EVCNT_DEFINE(bt_inuse) -#define LOCK_DECL(name) \ -kmutex_t name; char lockpad[COHERENCY_UNIT - sizeof(kmutex_t)] - -#define CONDVAR_DECL(name) \ -kcondvar_t name +#define VMEM_CONDVAR_INIT(vm, wchan) cv_init(vm-vm_cv, wchan) +#define VMEM_CONDVAR_DESTROY(vm) cv_destroy(vm-vm_cv) +#define VMEM_CONDVAR_WAIT(vm) cv_wait(vm-vm_cv, vm-vm_lock) +#define VMEM_CONDVAR_BROADCAST(vm) cv_broadcast(vm-vm_cv) #else /* defined(_KERNEL) */ -#include stdio.h -#include errno.h -#include assert.h -#include stdlib.h -#include string.h #define VMEM_EVCNT_INCR(ev) /* nothing */ #define VMEM_EVCNT_DECR(ev) /* nothing */ -#define UNITTEST -#define KASSERT(a) assert(a) -#define LOCK_DECL(name) /* nothing */ -#define CONDVAR_DECL(name) /* nothing */ #define VMEM_CONDVAR_INIT(vm, wchan) /* nothing */ +#define VMEM_CONDVAR_DESTROY(vm) /* nothing */ +#define VMEM_CONDVAR_WAIT(vm) /* nothing */ #define VMEM_CONDVAR_BROADCAST(vm) /* nothing */ + +#define UNITTEST +#define KASSERT(a) assert(a) #define mutex_init(a, b, c) /* nothing */ #define mutex_destroy(a) /* nothing */ #define mutex_enter(a) /* nothing */ @@ -110,74 +112,25 @@ VMEM_EVCNT_DEFINE(bt_inuse) #define panic(...) printf(__VA_ARGS__); abort() #endif /* defined(_KERNEL) */ -struct vmem; -struct vmem_btag; - #if defined(VMEM_SANITY) static void vmem_check(vmem_t *); #else /* defined(VMEM_SANITY) */ #define vmem_check(vm) /* nothing */ #endif /* defined(VMEM_SANITY) */ -#define VMEM_MAXORDER (sizeof(vmem_size_t) * CHAR_BIT) - #define VMEM_HASHSIZE_MIN 1 /* XXX */ #define VMEM_HASHSIZE_MAX 65536 /* XXX */ #define VMEM_HASHSIZE_INIT 1 #define VM_FITMASK (VM_BESTFIT | VM_INSTANTFIT) -CIRCLEQ_HEAD(vmem_seglist, vmem_btag); -LIST_HEAD(vmem_freelist, vmem_btag); -LIST_HEAD(vmem_hashlist, vmem_btag); - -#if defined(QCACHE) -#define VMEM_QCACHE_IDX_MAX 32 - -#define QC_NAME_MAX 16 - -struct qcache { - pool_cache_t qc_cache; - vmem_t *qc_vmem; - char qc_name[QC_NAME_MAX]; -}; -typedef struct qcache qcache_t; -#define QC_POOL_TO_QCACHE(pool) ((qcache_t *)(pool-pr_qcache)) -#endif /* defined(QCACHE) */ - -#define VMEM_NAME_MAX 16 - -/* vmem arena */ -struct vmem { - CONDVAR_DECL(vm_cv); - LOCK_DECL(vm_lock); - vm_flag_t vm_flags; - vmem_import_t *vm_importfn; - vmem_release_t *vm_releasefn; - size_t vm_nfreetags; - LIST_HEAD(, vmem_btag) vm_freetags; - void *vm_arg; - struct vmem_seglist vm_seglist; - struct vmem_freelist vm_freelist[VMEM_MAXORDER]; - size_t vm_hashsize; - size_t vm_nbusytag; - struct vmem_hashlist *vm_hashlist; - struct vmem_hashlist vm_hash0; - size_t
CVS commit: src/sys
Module Name:src Committed By: para Date: Sat Jan 26 15:18:01 UTC 2013 Modified Files: src/sys/kern: subr_vmem.c src/sys/rump/librump/rumpkern: vm.c src/sys/sys: vmem.h src/sys/uvm: uvm_km.c Log Message: revert previous commit not yet fully functional, sorry To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/sys/kern/subr_vmem.c cvs rdiff -u -r1.133 -r1.134 src/sys/rump/librump/rumpkern/vm.c cvs rdiff -u -r1.18 -r1.19 src/sys/sys/vmem.h cvs rdiff -u -r1.136 -r1.137 src/sys/uvm/uvm_km.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/subr_vmem.c diff -u src/sys/kern/subr_vmem.c:1.78 src/sys/kern/subr_vmem.c:1.79 --- src/sys/kern/subr_vmem.c:1.78 Sat Jan 26 13:50:33 2013 +++ src/sys/kern/subr_vmem.c Sat Jan 26 15:18:00 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_vmem.c,v 1.78 2013/01/26 13:50:33 para Exp $ */ +/* $NetBSD: subr_vmem.c,v 1.79 2013/01/26 15:18:00 para Exp $ */ /*- * Copyright (c)2006,2007,2008,2009 YAMAMOTO Takashi, @@ -34,7 +34,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: subr_vmem.c,v 1.78 2013/01/26 13:50:33 para Exp $); +__KERNEL_RCSID(0, $NetBSD: subr_vmem.c,v 1.79 2013/01/26 15:18:00 para Exp $); #if defined(_KERNEL) #include opt_ddb.h @@ -53,7 +53,6 @@ __KERNEL_RCSID(0, $NetBSD: subr_vmem.c, #include sys/kmem.h #include sys/pool.h #include sys/vmem.h -#include sys/vmem_impl.h #include sys/workqueue.h #include sys/atomic.h #include uvm/uvm.h @@ -62,13 +61,7 @@ __KERNEL_RCSID(0, $NetBSD: subr_vmem.c, #include uvm/uvm_page.h #include uvm/uvm_pdaemon.h #else /* defined(_KERNEL) */ -#include stdio.h -#include errno.h -#include assert.h -#include stdlib.h -#include string.h #include ../sys/vmem.h -#include ../sys/vmem_impl.h #endif /* defined(_KERNEL) */ @@ -85,23 +78,28 @@ VMEM_EVCNT_DEFINE(bt_pages) VMEM_EVCNT_DEFINE(bt_count) VMEM_EVCNT_DEFINE(bt_inuse) -#define VMEM_CONDVAR_INIT(vm, wchan) cv_init(vm-vm_cv, wchan) -#define VMEM_CONDVAR_DESTROY(vm) cv_destroy(vm-vm_cv) -#define VMEM_CONDVAR_WAIT(vm) cv_wait(vm-vm_cv, vm-vm_lock) -#define VMEM_CONDVAR_BROADCAST(vm) cv_broadcast(vm-vm_cv) +#define LOCK_DECL(name) \ +kmutex_t name; char lockpad[COHERENCY_UNIT - sizeof(kmutex_t)] + +#define CONDVAR_DECL(name) \ +kcondvar_t name #else /* defined(_KERNEL) */ +#include stdio.h +#include errno.h +#include assert.h +#include stdlib.h +#include string.h #define VMEM_EVCNT_INCR(ev) /* nothing */ #define VMEM_EVCNT_DECR(ev) /* nothing */ -#define VMEM_CONDVAR_INIT(vm, wchan) /* nothing */ -#define VMEM_CONDVAR_DESTROY(vm) /* nothing */ -#define VMEM_CONDVAR_WAIT(vm) /* nothing */ -#define VMEM_CONDVAR_BROADCAST(vm) /* nothing */ - #define UNITTEST #define KASSERT(a) assert(a) +#define LOCK_DECL(name) /* nothing */ +#define CONDVAR_DECL(name) /* nothing */ +#define VMEM_CONDVAR_INIT(vm, wchan) /* nothing */ +#define VMEM_CONDVAR_BROADCAST(vm) /* nothing */ #define mutex_init(a, b, c) /* nothing */ #define mutex_destroy(a) /* nothing */ #define mutex_enter(a) /* nothing */ @@ -112,25 +110,74 @@ VMEM_EVCNT_DEFINE(bt_inuse) #define panic(...) printf(__VA_ARGS__); abort() #endif /* defined(_KERNEL) */ +struct vmem; +struct vmem_btag; + #if defined(VMEM_SANITY) static void vmem_check(vmem_t *); #else /* defined(VMEM_SANITY) */ #define vmem_check(vm) /* nothing */ #endif /* defined(VMEM_SANITY) */ +#define VMEM_MAXORDER (sizeof(vmem_size_t) * CHAR_BIT) + #define VMEM_HASHSIZE_MIN 1 /* XXX */ #define VMEM_HASHSIZE_MAX 65536 /* XXX */ #define VMEM_HASHSIZE_INIT 1 #define VM_FITMASK (VM_BESTFIT | VM_INSTANTFIT) -#if defined(_KERNEL) -static bool vmem_bootstrapped = false; -static kmutex_t vmem_list_lock; -static LIST_HEAD(, vmem) vmem_list = LIST_HEAD_INITIALIZER(vmem_list); -#endif /* defined(_KERNEL) */ +CIRCLEQ_HEAD(vmem_seglist, vmem_btag); +LIST_HEAD(vmem_freelist, vmem_btag); +LIST_HEAD(vmem_hashlist, vmem_btag); -/* misc */ +#if defined(QCACHE) +#define VMEM_QCACHE_IDX_MAX 32 + +#define QC_NAME_MAX 16 + +struct qcache { + pool_cache_t qc_cache; + vmem_t *qc_vmem; + char qc_name[QC_NAME_MAX]; +}; +typedef struct qcache qcache_t; +#define QC_POOL_TO_QCACHE(pool) ((qcache_t *)(pool-pr_qcache)) +#endif /* defined(QCACHE) */ + +#define VMEM_NAME_MAX 16 + +/* vmem arena */ +struct vmem { + CONDVAR_DECL(vm_cv); + LOCK_DECL(vm_lock); + vm_flag_t vm_flags; + vmem_import_t *vm_importfn; + vmem_release_t *vm_releasefn; + size_t vm_nfreetags; + LIST_HEAD(, vmem_btag) vm_freetags; + void *vm_arg; + struct vmem_seglist vm_seglist; + struct vmem_freelist vm_freelist[VMEM_MAXORDER]; + size_t vm_hashsize; + size_t vm_nbusytag; + struct vmem_hashlist *vm_hashlist; + struct vmem_hashlist vm_hash0; + size_t vm_quantum_mask; + int vm_quantum_shift; + size_t vm_size; + size_t vm_inuse; + char vm_name[VMEM_NAME_MAX+1]; + LIST_ENTRY(vmem) vm_alllist; + +#if
CVS commit: src/sys/arch/luna68k/dev
Module Name:src Committed By: tsutsui Date: Sat Jan 26 15:44:15 UTC 2013 Modified Files: src/sys/arch/luna68k/dev: timekeeper.c Log Message: Fix offset of DS1287A NVRAM address on LUNA-II. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/luna68k/dev/timekeeper.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/luna68k/dev/timekeeper.c diff -u src/sys/arch/luna68k/dev/timekeeper.c:1.11 src/sys/arch/luna68k/dev/timekeeper.c:1.12 --- src/sys/arch/luna68k/dev/timekeeper.c:1.11 Tue Jan 22 15:44:25 2013 +++ src/sys/arch/luna68k/dev/timekeeper.c Sat Jan 26 15:44:14 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: timekeeper.c,v 1.11 2013/01/22 15:44:25 tsutsui Exp $ */ +/* $NetBSD: timekeeper.c,v 1.12 2013/01/26 15:44:14 tsutsui Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include sys/cdefs.h /* RCS ID Copyright macro defns */ -__KERNEL_RCSID(0, $NetBSD: timekeeper.c,v 1.11 2013/01/22 15:44:25 tsutsui Exp $); +__KERNEL_RCSID(0, $NetBSD: timekeeper.c,v 1.12 2013/01/26 15:44:14 tsutsui Exp $); #include sys/param.h #include sys/systm.h @@ -98,7 +98,7 @@ clock_attach(device_t parent, device_t s break; case LUNA_II: /* Dallas DS1287A */ sc-sc_clock = (void *)ma-ma_addr; - sc-sc_nvram = (void *)(ma-ma_addr + 50); + sc-sc_nvram = (void *)(ma-ma_addr + MC_NREGS); sc-sc_nvramsize = 50; sc-sc_todr.todr_gettime_ymdhms = dsclock_get; sc-sc_todr.todr_settime_ymdhms = dsclock_set;
CVS commit: src/sys/arch/luna68k/luna68k
Module Name:src Committed By: tsutsui Date: Sat Jan 26 15:46:24 UTC 2013 Modified Files: src/sys/arch/luna68k/luna68k: clock.c machdep.c pmap_bootstrap.c Log Message: Whitespace nits. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/luna68k/luna68k/clock.c cvs rdiff -u -r1.94 -r1.95 src/sys/arch/luna68k/luna68k/machdep.c cvs rdiff -u -r1.35 -r1.36 src/sys/arch/luna68k/luna68k/pmap_bootstrap.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/luna68k/luna68k/clock.c diff -u src/sys/arch/luna68k/luna68k/clock.c:1.8 src/sys/arch/luna68k/luna68k/clock.c:1.9 --- src/sys/arch/luna68k/luna68k/clock.c:1.8 Tue Feb 8 20:20:16 2011 +++ src/sys/arch/luna68k/luna68k/clock.c Sat Jan 26 15:46:24 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: clock.c,v 1.8 2011/02/08 20:20:16 rmind Exp $ */ +/* $NetBSD: clock.c,v 1.9 2013/01/26 15:46:24 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: clock.c,v 1.8 2011/02/08 20:20:16 rmind Exp $); +__KERNEL_RCSID(0, $NetBSD: clock.c,v 1.9 2013/01/26 15:46:24 tsutsui Exp $); #include sys/param.h #include sys/systm.h @@ -79,8 +79,8 @@ cpu_initclocks(void) */ s = splhigh(); /* - * XXX - * I guess it's necessary to program clock source with + * XXX + * I guess it's necessary to program clock source with * approprivate mode/value. * XXX */ Index: src/sys/arch/luna68k/luna68k/machdep.c diff -u src/sys/arch/luna68k/luna68k/machdep.c:1.94 src/sys/arch/luna68k/luna68k/machdep.c:1.95 --- src/sys/arch/luna68k/luna68k/machdep.c:1.94 Fri Jan 18 18:41:12 2013 +++ src/sys/arch/luna68k/luna68k/machdep.c Sat Jan 26 15:46:24 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.94 2013/01/18 18:41:12 tsutsui Exp $ */ +/* $NetBSD: machdep.c,v 1.95 2013/01/26 15:46:24 tsutsui Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include sys/cdefs.h /* RCS ID Copyright macro defns */ -__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.94 2013/01/18 18:41:12 tsutsui Exp $); +__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.95 2013/01/26 15:46:24 tsutsui Exp $); #include opt_ddb.h #include opt_kgdb.h @@ -99,7 +99,7 @@ __KERNEL_RCSID(0, $NetBSD: machdep.c,v char machine[] = MACHINE; char cpu_model[120]; -/* Our exported CPU info; we can have only one. */ +/* Our exported CPU info; we can have only one. */ struct cpu_info cpu_info_store; struct vm_map *phys_map = NULL; @@ -477,7 +477,7 @@ cpu_init_kcore_hdr(void) cpu_kcore_hdr_t *h = cpu_kcore_hdr; struct m68k_kcore_hdr *m = h-un._m68k; - memset(cpu_kcore_hdr, 0, sizeof(cpu_kcore_hdr)); + memset(cpu_kcore_hdr, 0, sizeof(cpu_kcore_hdr)); /* * Initialize the `dispatcher' portion of the header. @@ -552,7 +552,7 @@ cpu_dumpsize(void) int cpu_dump(int (*dump)(dev_t, daddr_t, void *, size_t), daddr_t *blknop) { - int buf[MDHDRSIZE / sizeof(int)]; + int buf[MDHDRSIZE / sizeof(int)]; cpu_kcore_hdr_t *chdr; kcore_seg_t *kseg; int error; @@ -801,7 +801,7 @@ luna68k_abort(const char *cp) /* * cpu_exec_aout_makecmds(): * CPU-dependent a.out format hook for execve(). - * + * * Determine of the given exec package refers to something which we * understand and, if so, set up the vmcmds for it. */ Index: src/sys/arch/luna68k/luna68k/pmap_bootstrap.c diff -u src/sys/arch/luna68k/luna68k/pmap_bootstrap.c:1.35 src/sys/arch/luna68k/luna68k/pmap_bootstrap.c:1.36 --- src/sys/arch/luna68k/luna68k/pmap_bootstrap.c:1.35 Fri Feb 10 06:28:39 2012 +++ src/sys/arch/luna68k/luna68k/pmap_bootstrap.c Sat Jan 26 15:46:24 2013 @@ -1,6 +1,6 @@ -/* $NetBSD: pmap_bootstrap.c,v 1.35 2012/02/10 06:28:39 mhitch Exp $ */ +/* $NetBSD: pmap_bootstrap.c,v 1.36 2013/01/26 15:46:24 tsutsui Exp $ */ -/* +/* * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * @@ -36,7 +36,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.35 2012/02/10 06:28:39 mhitch Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.36 2013/01/26 15:46:24 tsutsui Exp $); #include opt_m68k_arch.h
CVS commit: src/usr.bin/make
Module Name:src Committed By: christos Date: Sat Jan 26 15:53:00 UTC 2013 Modified Files: src/usr.bin/make: job.c main.c Log Message: Check read and write errors to avoid warnings from linux. XXX: Should we print an error and exit instead? To generate a diff of this commit: cvs rdiff -u -r1.164 -r1.165 src/usr.bin/make/job.c cvs rdiff -u -r1.204 -r1.205 src/usr.bin/make/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/usr.bin/make/job.c diff -u src/usr.bin/make/job.c:1.164 src/usr.bin/make/job.c:1.165 --- src/usr.bin/make/job.c:1.164 Thu Jan 24 21:01:10 2013 +++ src/usr.bin/make/job.c Sat Jan 26 10:52:59 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.164 2013/01/25 02:01:10 sjg Exp $ */ +/* $NetBSD: job.c,v 1.165 2013/01/26 15:52:59 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = $NetBSD: job.c,v 1.164 2013/01/25 02:01:10 sjg Exp $; +static char rcsid[] = $NetBSD: job.c,v 1.165 2013/01/26 15:52:59 christos Exp $; #else #include sys/cdefs.h #ifndef lint #if 0 static char sccsid[] = @(#)job.c 8.2 (Berkeley) 3/19/94; #else -__RCSID($NetBSD: job.c,v 1.164 2013/01/25 02:01:10 sjg Exp $); +__RCSID($NetBSD: job.c,v 1.165 2013/01/26 15:52:59 christos Exp $); #endif #endif /* not lint */ #endif @@ -477,7 +477,8 @@ JobCondPassSig(int signo) static void JobChildSig(int signo MAKE_ATTR_UNUSED) { -write(childExitJob.outPipe, CHILD_EXIT, 1); +while (write(childExitJob.outPipe, CHILD_EXIT, 1) == -1 errno == EAGAIN) + continue; } @@ -504,7 +505,9 @@ JobContinueSig(int signo MAKE_ATTR_UNUSE * Defer sending to SIGCONT to our stopped children until we return * from the signal handler. */ -write(childExitJob.outPipe, DO_JOB_RESUME, 1); +while (write(childExitJob.outPipe, DO_JOB_RESUME, 1) == -1 + errno == EAGAIN) + continue; } /*- @@ -1161,7 +1164,8 @@ Job_Touch(GNode *gn, Boolean silent) */ if (read(streamID, c, 1) == 1) { (void)lseek(streamID, (off_t)0, SEEK_SET); - (void)write(streamID, c, 1); + while (write(streamID, c, 1) == -1 errno == EAGAIN) + continue; } (void)close(streamID); @@ -2046,7 +2050,8 @@ Job_CatchOutput(void) if (nready 0 || readyfd(childExitJob)) { char token = 0; nready -= 1; - (void)read(childExitJob.inPipe, token, 1); + while (read(childExitJob.inPipe, token, 1) == -1 errno == EAGAIN) + continue; if (token == DO_JOB_RESUME[0]) /* Complete relay requested from our SIGCONT handler */ JobRestartJobs(); @@ -2777,7 +2782,8 @@ JobTokenAdd(void) if (DEBUG(JOB)) fprintf(debug_file, (%d) aborting %d, deposit token %c\n, getpid(), aborting, JOB_TOKENS[aborting]); -write(tokenWaitJob.outPipe, tok, 1); +while (write(tokenWaitJob.outPipe, tok, 1) == -1 errno == EAGAIN) + continue; } /*- @@ -2890,13 +2896,15 @@ Job_TokenWithdraw(void) while (read(tokenWaitJob.inPipe, tok1, 1) == 1) continue; /* And put the stopper back */ - write(tokenWaitJob.outPipe, tok, 1); + while (write(tokenWaitJob.outPipe, tok, 1) == -1 errno == EAGAIN) + continue; Fatal(A failure has been detected in another branch of the parallel make); } if (count == 1 jobTokensRunning == 0) /* We didn't want the token really */ - write(tokenWaitJob.outPipe, tok, 1); + while (write(tokenWaitJob.outPipe, tok, 1) == -1 errno == EAGAIN) + continue; jobTokensRunning++; if (DEBUG(JOB)) Index: src/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.204 src/usr.bin/make/main.c:1.205 --- src/usr.bin/make/main.c:1.204 Thu Jan 24 21:01:10 2013 +++ src/usr.bin/make/main.c Sat Jan 26 10:53:00 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.204 2013/01/25 02:01:10 sjg Exp $ */ +/* $NetBSD: main.c,v 1.205 2013/01/26 15:53:00 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = $NetBSD: main.c,v 1.204 2013/01/25 02:01:10 sjg Exp $; +static char rcsid[] = $NetBSD: main.c,v 1.205 2013/01/26 15:53:00 christos Exp $; #else #include sys/cdefs.h #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT(@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = @(#)main.c 8.3 (Berkeley) 3/19/94; #else -__RCSID($NetBSD: main.c,v 1.204 2013/01/25 02:01:10 sjg Exp $); +__RCSID($NetBSD: main.c,v 1.205 2013/01/26 15:53:00 christos Exp $); #endif #endif /* not lint */ #endif @@ -1708,7 +1708,8 @@ execError(const char *af, const char *av IOADD()\n); #ifdef USE_IOVEC - (void)writev(2, iov, 8); + while (writev(2, iov, 8) == -1 errno == EAGAIN) + continue; #endif }
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sat Jan 26 16:00:04 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: boot.ldscript Log Message: Add proper padding to text section for elf2aout conversion. The data and bss sections are 8 byte aligned on m68k ELF format, but a.out header doesn't have section addresses and only contains size values, so we have to pad size of text section to make data section get aligned even after elf2aout. Note elf2aout merges ELF data section into a.out text section if binary is OMAGIC (i.e. text is writable too) so only BSS section address was affected (and was almost harmless). To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/boot.ldscript 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/luna68k/stand/boot/boot.ldscript diff -u src/sys/arch/luna68k/stand/boot/boot.ldscript:1.4 src/sys/arch/luna68k/stand/boot/boot.ldscript:1.5 --- src/sys/arch/luna68k/stand/boot/boot.ldscript:1.4 Sun Jan 20 02:35:13 2013 +++ src/sys/arch/luna68k/stand/boot/boot.ldscript Sat Jan 26 16:00:04 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.ldscript,v 1.4 2013/01/20 02:35:13 tsutsui Exp $ */ +/* $NetBSD: boot.ldscript,v 1.5 2013/01/26 16:00:04 tsutsui Exp $ */ OUTPUT_FORMAT(elf32-m68k) OUTPUT_ARCH(m68k) @@ -11,7 +11,11 @@ SECTIONS *(.text) *(.text.*) *(.rodata) *(.rodata.*) -. = ALIGN(4); +/* The data and bss sections are 8 byte aligned on ELF format, + but a.out header doesn't have section addresses and only + contains size values, so we have to pad size of text section + to make data section get aligned even after elf2aout. */ +. = ALIGN(8); } =0 PROVIDE (__etext = .); PROVIDE (_etext = .);
CVS commit: src/sys/kern
Module Name:src Committed By: tls Date: Sat Jan 26 16:05:34 UTC 2013 Modified Files: src/sys/kern: subr_cprng.c Log Message: Fix a security issue: when we are reseeding a PRNG seeded early in boot before we had ever had any entropy, if something else has consumed the entropy that triggered the immediate reseed, we can reseed with as little as sizeof(int) bytes of entropy. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/kern/subr_cprng.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/subr_cprng.c diff -u src/sys/kern/subr_cprng.c:1.14 src/sys/kern/subr_cprng.c:1.15 --- src/sys/kern/subr_cprng.c:1.14 Tue Nov 20 11:06:27 2012 +++ src/sys/kern/subr_cprng.c Sat Jan 26 16:05:34 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_cprng.c,v 1.14 2012/11/20 11:06:27 msaitoh Exp $ */ +/* $NetBSD: subr_cprng.c,v 1.15 2013/01/26 16:05:34 tls Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -46,7 +46,7 @@ #include sys/cprng.h -__KERNEL_RCSID(0, $NetBSD: subr_cprng.c,v 1.14 2012/11/20 11:06:27 msaitoh Exp $); +__KERNEL_RCSID(0, $NetBSD: subr_cprng.c,v 1.15 2013/01/26 16:05:34 tls Exp $); void cprng_init(void) @@ -84,6 +84,8 @@ cprng_strong_doreseed(cprng_strong_t *co cc, sizeof(cc))) { panic(cprng %s: nist_ctr_drbg_reseed failed., c-name); } + memset(c-reseed.data, 0, c-reseed.len); + #ifdef RND_VERBOSE printf(cprng %s: reseeded with rnd_filled = %d\n, c-name, rnd_filled); @@ -154,6 +156,17 @@ cprng_strong_reseed(void *const arg) mutex_exit(c-mtx); } +static size_t +cprng_entropy_try(uint8_t *key, size_t keylen, int hard) +{ + int r; + r = rnd_extract_data(key, keylen, RND_EXTRACT_GOOD); + if (r != keylen !hard) { + rnd_extract_data(key + r, keylen - r, RND_EXTRACT_ANY); + } + return r; +} + cprng_strong_t * cprng_strong_create(const char *const name, int ipl, int flags) { @@ -183,15 +196,13 @@ cprng_strong_create(const char *const na selinit(c-selq); - r = rnd_extract_data(key, sizeof(key), RND_EXTRACT_GOOD); + r = cprng_entropy_try(key, sizeof(key), c-flags CPRNG_INIT_ANY); if (r != sizeof(key)) { if (c-flags CPRNG_INIT_ANY) { #ifdef DEBUG printf(cprng %s: WARNING insufficient entropy at creation.\n, name); #endif - rnd_extract_data(key + r, sizeof(key - r), - RND_EXTRACT_ANY); } else { hard++; } @@ -240,15 +251,18 @@ rekeyany: if (c-flags CPRNG_REKEY_ANY) { uint8_t key[NIST_BLOCK_KEYLEN_BYTES]; - printf(cprng %s: WARNING pseudorandom rekeying.\n, - c-name); -rnd_extract_data(key, sizeof(key), RND_EXTRACT_ANY); + if (cprng_entropy_try(key, sizeof(key), 0) != + sizeof(key)) { + printf(cprng %s: WARNING + pseudorandom rekeying.\n, c-name); + } cc = cprng_counter(); if (nist_ctr_drbg_reseed(c-drbg, key, sizeof(key), cc, sizeof(cc))) { panic(cprng %s: nist_ctr_drbg_reseed failed., c-name); } + memset(key, 0, sizeof(key)); } else { int wr;
CVS commit: src/usr.sbin/makefs
Module Name:src Committed By: christos Date: Sat Jan 26 16:50:46 UTC 2013 Modified Files: src/usr.sbin/makefs/ffs: buf.h src/usr.sbin/makefs/msdos: Makefile.inc msdosfs_denode.c msdosfs_vfsops.c msdosfs_vnops.c Log Message: make this cross-compile friendly. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/makefs/ffs/buf.h cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/makefs/msdos/Makefile.inc cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/makefs/msdos/msdosfs_denode.c cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/makefs/msdos/msdosfs_vfsops.c \ src/usr.sbin/makefs/msdos/msdosfs_vnops.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/makefs/ffs/buf.h diff -u src/usr.sbin/makefs/ffs/buf.h:1.3 src/usr.sbin/makefs/ffs/buf.h:1.4 --- src/usr.sbin/makefs/ffs/buf.h:1.3 Fri Jan 25 19:19:39 2013 +++ src/usr.sbin/makefs/ffs/buf.h Sat Jan 26 11:50:46 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: buf.h,v 1.3 2013/01/26 00:19:39 christos Exp $ */ +/* $NetBSD: buf.h,v 1.4 2013/01/26 16:50:46 christos Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -75,6 +75,7 @@ struct buf { TAILQ_ENTRY(buf) b_tailq; }; +struct kauth_cred; void bcleanup(void); int bread(struct vnode *, daddr_t, int, struct kauth_cred *, int, struct buf **); @@ -112,5 +113,7 @@ struct pool { #define mutex_destroy(m) #define desiredvnodes 1 +#define NOCRED NULL +#define DEV_BSHIFT 9 #endif /* _FFS_BUF_H */ Index: src/usr.sbin/makefs/msdos/Makefile.inc diff -u src/usr.sbin/makefs/msdos/Makefile.inc:1.4 src/usr.sbin/makefs/msdos/Makefile.inc:1.5 --- src/usr.sbin/makefs/msdos/Makefile.inc:1.4 Fri Jan 25 19:20:40 2013 +++ src/usr.sbin/makefs/msdos/Makefile.inc Sat Jan 26 11:50:46 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.4 2013/01/26 00:20:40 christos Exp $ +# $NetBSD: Makefile.inc,v 1.5 2013/01/26 16:50:46 christos Exp $ # MSDOS= ${NETBSDSRCDIR}/sys/fs/msdosfs @@ -6,7 +6,10 @@ MSDOS_NEWFS= ${NETBSDSRCDIR}/sbin/newfs_ .PATH: ${.CURDIR}/msdos ${MSDOS} ${MSDOS_NEWFS} -CPPFLAGS+= -DMSDOS_EI -I${MSDOS} -I${MSDOS_NEWFS} -I${NETBSDSRCDIR}/sys +CPPFLAGS+= -DMSDOS_EI -I${MSDOS} -I${MSDOS_NEWFS} +.if !defined(HOSTPROGNAME) +CPPFLAGS+= -I${NETBSDSRCDIR}/sys +.endif SRCS+= mkfs_msdos.c msdosfs_fat.c msdosfs_conv.c msdosfs_vfsops.c SRCS+= msdosfs_lookup.c msdosfs_denode.c msdosfs_vnops.c Index: src/usr.sbin/makefs/msdos/msdosfs_denode.c diff -u src/usr.sbin/makefs/msdos/msdosfs_denode.c:1.1 src/usr.sbin/makefs/msdos/msdosfs_denode.c:1.2 --- src/usr.sbin/makefs/msdos/msdosfs_denode.c:1.1 Fri Jan 25 19:20:40 2013 +++ src/usr.sbin/makefs/msdos/msdosfs_denode.c Sat Jan 26 11:50:46 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: msdosfs_denode.c,v 1.1 2013/01/26 00:20:40 christos Exp $ */ +/* $NetBSD: msdosfs_denode.c,v 1.2 2013/01/26 16:50:46 christos Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -52,28 +52,11 @@ #endif #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: msdosfs_denode.c,v 1.1 2013/01/26 00:20:40 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: msdosfs_denode.c,v 1.2 2013/01/26 16:50:46 christos Exp $); #include sys/param.h -#include sys/systm.h -#include sys/mount.h -#include sys/malloc.h -#include sys/pool.h -#include sys/proc.h -#include sys/kernel.h /* defines time */ -#include sys/dirent.h -#include sys/namei.h -#include sys/kauth.h -#include sys/rbtree.h - -#ifdef _KERNEL -#include sys/fstrans.h -#include uvm/uvm_extern.h -#include sys/buf.h -#include sys/vnode.h -#else + #include ffs/buf.h -#endif #include fs/msdosfs/bpb.h #include fs/msdosfs/msdosfsmount.h @@ -208,7 +191,7 @@ deget(struct msdosfsmount *pmp, u_long d * Truncate the file described by dep to the length specified by length. */ int -detrunc(struct denode *dep, u_long length, int flags, kauth_cred_t cred) +detrunc(struct denode *dep, u_long length, int flags, struct kauth_cred *cred) { int error; int allerror = 0; @@ -331,7 +314,7 @@ detrunc(struct denode *dep, u_long lengt * Extend the file described by dep to length specified by length. */ int -deextend(struct denode *dep, u_long length, kauth_cred_t cred) +deextend(struct denode *dep, u_long length, struct kauth_cred *cred) { struct msdosfsmount *pmp = dep-de_pmp; u_long count, osize; @@ -341,16 +324,16 @@ deextend(struct denode *dep, u_long leng * The root of a DOS filesystem cannot be extended. */ if ((DETOV(dep) == (struct vnode *)-1) !FAT32(pmp)) - return (EINVAL); + return EINVAL; /* * Directories cannot be extended. */ if (dep-de_Attributes ATTR_DIRECTORY) - return (EISDIR); + return EISDIR; if (length = dep-de_FileSize) - panic(deextend: file too large); + return E2BIG; /* * Compute the number of clusters to allocate. Index: src/usr.sbin/makefs/msdos/msdosfs_vfsops.c diff -u src/usr.sbin/makefs/msdos/msdosfs_vfsops.c:1.2
CVS commit: src/sys/fs/msdosfs
Module Name:src Committed By: christos Date: Sat Jan 26 16:51:51 UTC 2013 Modified Files: src/sys/fs/msdosfs: denode.h msdosfs_conv.c msdosfs_fat.c msdosfs_lookup.c msdosfsmount.h Log Message: more cross-compile friendly. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/fs/msdosfs/denode.h cvs rdiff -u -r1.8 -r1.9 src/sys/fs/msdosfs/msdosfs_conv.c cvs rdiff -u -r1.24 -r1.25 src/sys/fs/msdosfs/msdosfs_fat.c cvs rdiff -u -r1.28 -r1.29 src/sys/fs/msdosfs/msdosfs_lookup.c cvs rdiff -u -r1.18 -r1.19 src/sys/fs/msdosfs/msdosfsmount.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/fs/msdosfs/denode.h diff -u src/sys/fs/msdosfs/denode.h:1.21 src/sys/fs/msdosfs/denode.h:1.22 --- src/sys/fs/msdosfs/denode.h:1.21 Fri Jan 25 19:21:49 2013 +++ src/sys/fs/msdosfs/denode.h Sat Jan 26 11:51:51 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: denode.h,v 1.21 2013/01/26 00:21:49 christos Exp $ */ +/* $NetBSD: denode.h,v 1.22 2013/01/26 16:51:51 christos Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -49,7 +49,15 @@ #ifndef _MSDOSFS_DENODE_H_ #define _MSDOSFS_DENODE_H_ +#ifdef _KERNEL #include miscfs/genfs/genfs_node.h +#else +struct genfs_node { +}; +struct vnode; +struct msdosfsmount; +struct buf; +#endif /* * This is the pc filesystem specific portion of the vnode structure. @@ -289,13 +297,14 @@ int msdosfs_pathconf (void *); */ struct componentname; struct direntry; +struct kauth_cred; int msdosfs_update(struct vnode *, const struct timespec *, const struct timespec *, int); int createde(struct denode *, struct denode *, struct denode **, struct componentname *); -int deextend(struct denode *, u_long, kauth_cred_t); +int deextend(struct denode *, u_long, struct kauth_cred *); int deget(struct msdosfsmount *, u_long, u_long, struct denode **); -int detrunc(struct denode *, u_long, int, kauth_cred_t); +int detrunc(struct denode *, u_long, int, struct kauth_cred *); int deupdat(struct denode *, int); int doscheckpath(struct denode *, struct denode *); int dosdirempty(struct denode *); @@ -306,7 +315,7 @@ void reinsert(struct denode *); int removede(struct denode *, struct denode *); int uniqdosname(struct denode *, struct componentname *, u_char *); int findwin95(struct denode *); -int msdosfs_gop_alloc(struct vnode *, off_t, off_t, int, kauth_cred_t); +int msdosfs_gop_alloc(struct vnode *, off_t, off_t, int, struct kauth_cred *); void msdosfs_gop_markupdate(struct vnode *, int); void msdosfs_detimes(struct denode *, const struct timespec *, const struct timespec *, const struct timespec *, int); Index: src/sys/fs/msdosfs/msdosfs_conv.c diff -u src/sys/fs/msdosfs/msdosfs_conv.c:1.8 src/sys/fs/msdosfs/msdosfs_conv.c:1.9 --- src/sys/fs/msdosfs/msdosfs_conv.c:1.8 Fri Jan 25 19:21:49 2013 +++ src/sys/fs/msdosfs/msdosfs_conv.c Sat Jan 26 11:51:51 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: msdosfs_conv.c,v 1.8 2013/01/26 00:21:49 christos Exp $ */ +/* $NetBSD: msdosfs_conv.c,v 1.9 2013/01/26 16:51:51 christos Exp $ */ /*- * Copyright (C) 1995, 1997 Wolfgang Solfrank. @@ -52,19 +52,22 @@ #endif #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: msdosfs_conv.c,v 1.8 2013/01/26 00:21:49 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: msdosfs_conv.c,v 1.9 2013/01/26 16:51:51 christos Exp $); /* * System include files. */ #include sys/param.h -#include sys/systm.h #include sys/time.h -#include sys/kernel.h +#ifdef _KERNEL #include sys/dirent.h +#include sys/systm.h +#include sys/kernel.h #include sys/vnode.h -#ifndef _KERNEL +#else #include stdio.h +#include dirent.h +#include sys/queue.h #endif /* @@ -722,7 +725,9 @@ win2unixfn(struct winentry *wep, struct /* * This works even though d_namlen is one byte! */ +#ifdef __NetBSD__ dp-d_namlen = (wep-weCntWIN_CNT) * WIN_CHARS; +#endif } else if (chksum != wep-weChksum) chksum = -1; if (chksum == -1) @@ -740,8 +745,10 @@ win2unixfn(struct winentry *wep, struct for (cp = wep-wePart1, i = sizeof(wep-wePart1)/2; --i = 0;) { switch (*np++ = *cp++) { case 0: +#ifdef __NetBSD__ dp-d_namlen -= sizeof(wep-wePart2)/2 + sizeof(wep-wePart3)/2 + i + 1; +#endif return chksum; case '/': np[-1] = 0; @@ -762,7 +769,9 @@ win2unixfn(struct winentry *wep, struct for (cp = wep-wePart2, i = sizeof(wep-wePart2)/2; --i = 0;) { switch (*np++ = *cp++) { case 0: +#ifdef __NetBSD__ dp-d_namlen -= sizeof(wep-wePart3)/2 + i + 1; +#endif return chksum; case '/': np[-1] = 0; @@ -783,7 +792,9 @@ win2unixfn(struct winentry *wep, struct for (cp = wep-wePart3, i = sizeof(wep-wePart3)/2; --i = 0;) { switch (*np++ = *cp++) { case 0: +#ifdef __NetBSD__ dp-d_namlen -= i + 1; +#endif return chksum; case '/': np[-1] = 0; Index: src/sys/fs/msdosfs/msdosfs_fat.c diff -u src/sys/fs/msdosfs/msdosfs_fat.c:1.24
CVS commit: src/tools/compat/fs/msdosfs
Module Name:src Committed By: christos Date: Sat Jan 26 16:52:43 UTC 2013 Added Files: src/tools/compat/fs/msdosfs: bootsect.h bpb.h denode.h direntry.h fat.h msdosfsmount.h Log Message: links for makefs To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/tools/compat/fs/msdosfs/bootsect.h \ src/tools/compat/fs/msdosfs/bpb.h src/tools/compat/fs/msdosfs/denode.h \ src/tools/compat/fs/msdosfs/direntry.h src/tools/compat/fs/msdosfs/fat.h \ src/tools/compat/fs/msdosfs/msdosfsmount.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/tools/compat/fs/msdosfs/bootsect.h diff -u /dev/null src/tools/compat/fs/msdosfs/bootsect.h:1.1 --- /dev/null Sat Jan 26 11:52:43 2013 +++ src/tools/compat/fs/msdosfs/bootsect.h Sat Jan 26 11:52:43 2013 @@ -0,0 +1 @@ +#include ../../../../sys/fs/msdosfs/bootsect.h Index: src/tools/compat/fs/msdosfs/bpb.h diff -u /dev/null src/tools/compat/fs/msdosfs/bpb.h:1.1 --- /dev/null Sat Jan 26 11:52:43 2013 +++ src/tools/compat/fs/msdosfs/bpb.h Sat Jan 26 11:52:43 2013 @@ -0,0 +1 @@ +#include ../../../../sys/fs/msdosfs/bpb.h Index: src/tools/compat/fs/msdosfs/denode.h diff -u /dev/null src/tools/compat/fs/msdosfs/denode.h:1.1 --- /dev/null Sat Jan 26 11:52:43 2013 +++ src/tools/compat/fs/msdosfs/denode.h Sat Jan 26 11:52:43 2013 @@ -0,0 +1 @@ +#include ../../../../sys/fs/msdosfs/denode.h Index: src/tools/compat/fs/msdosfs/direntry.h diff -u /dev/null src/tools/compat/fs/msdosfs/direntry.h:1.1 --- /dev/null Sat Jan 26 11:52:43 2013 +++ src/tools/compat/fs/msdosfs/direntry.h Sat Jan 26 11:52:43 2013 @@ -0,0 +1 @@ +#include ../../../../sys/fs/msdosfs/direntry.h Index: src/tools/compat/fs/msdosfs/fat.h diff -u /dev/null src/tools/compat/fs/msdosfs/fat.h:1.1 --- /dev/null Sat Jan 26 11:52:43 2013 +++ src/tools/compat/fs/msdosfs/fat.h Sat Jan 26 11:52:43 2013 @@ -0,0 +1 @@ +#include ../../../../sys/fs/msdosfs/fat.h Index: src/tools/compat/fs/msdosfs/msdosfsmount.h diff -u /dev/null src/tools/compat/fs/msdosfs/msdosfsmount.h:1.1 --- /dev/null Sat Jan 26 11:52:43 2013 +++ src/tools/compat/fs/msdosfs/msdosfsmount.h Sat Jan 26 11:52:43 2013 @@ -0,0 +1 @@ +#include ../../../../sys/fs/msdosfs/msdosfsmount.h
CVS commit: src/usr.sbin/makefs/msdos
Module Name:src Committed By: christos Date: Sat Jan 26 16:58:32 UTC 2013 Modified Files: src/usr.sbin/makefs/msdos: msdosfs_vnops.c Log Message: depend on TOOLS instead of __NetBSD__ for extra functionality To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/makefs/msdos/msdosfs_vnops.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/makefs/msdos/msdosfs_vnops.c diff -u src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.3 src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.4 --- src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.3 Sat Jan 26 11:50:46 2013 +++ src/usr.sbin/makefs/msdos/msdosfs_vnops.c Sat Jan 26 11:58:14 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: msdosfs_vnops.c,v 1.3 2013/01/26 16:50:46 christos Exp $ */ +/* $NetBSD: msdosfs_vnops.c,v 1.4 2013/01/26 16:58:14 christos Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -51,7 +51,7 @@ #endif #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.3 2013/01/26 16:50:46 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.4 2013/01/26 16:58:14 christos Exp $); #include sys/param.h #include sys/mman.h @@ -94,7 +94,7 @@ static void msdosfs_times(struct msdosfsmount *pmp, struct denode *dep, const struct stat *st) { -#ifdef __NetBSD__ +#ifndef HAVE_NBTOOL_CONFIG_H struct timespec at = st-st_atimespec; struct timespec mt = st-st_mtimespec; #else
CVS commit: src/sys/arch/x86
Module Name:src Committed By: dyoung Date: Sat Jan 26 17:37:39 UTC 2013 Modified Files: src/sys/arch/x86/include: i82093reg.h i82489reg.h src/sys/arch/x86/pci: pci_intr_machdep.c Log Message: Several registers and bitfields named IOAPIC_* actually belong to the LAPIC, so rename them LAPIC_* and move to a more appropriate header file. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/x86/include/i82093reg.h cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x86/include/i82489reg.h cvs rdiff -u -r1.25 -r1.26 src/sys/arch/x86/pci/pci_intr_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/x86/include/i82093reg.h diff -u src/sys/arch/x86/include/i82093reg.h:1.3 src/sys/arch/x86/include/i82093reg.h:1.4 --- src/sys/arch/x86/include/i82093reg.h:1.3 Wed Aug 17 14:55:11 2011 +++ src/sys/arch/x86/include/i82093reg.h Sat Jan 26 17:37:39 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: i82093reg.h,v 1.3 2011/08/17 14:55:11 dyoung Exp $ */ +/* $NetBSD: i82093reg.h,v 1.4 2013/01/26 17:37:39 dyoung Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -36,34 +36,6 @@ */ #define IOAPIC_BASE_DEFAULT 0xfec0 -#define IOAPIC_MSIADDR_BASE 0xfee0 -#define IOAPIC_MSIADDR_DSTID_MASK __BITS(19, 12) -#define IOAPIC_MSIADDR_RSVD0_MASK __BITS(11, 4) -#define IOAPIC_MSIADDR_RH __BIT(3) -#define IOAPIC_MSIADDR_DM __BIT(2) -#define IOAPIC_MSIADDR_RSVD1_MASK __BITS(1, 0) - -#define IOAPIC_MSIDATA_VECTOR_MASK __BITS(7, 0) -#define IOAPIC_MSIDATA_DM_MASK __BITS(10, 8) -#define IOAPIC_MSIDATA_DM_FIXED __SHIFTIN(0, IOAPIC_MSIDATA_DM_MASK) -#define IOAPIC_MSIDATA_DM_LOPRI __SHIFTIN(1, IOAPIC_MSIDATA_DM_MASK) -#define IOAPIC_MSIDATA_DM_SMI __SHIFTIN(2, IOAPIC_MSIDATA_DM_MASK) -#define IOAPIC_MSIDATA_DM_RSVD0 __SHIFTIN(3, IOAPIC_MSIDATA_DM_MASK) -#define IOAPIC_MSIDATA_DM_NMI __SHIFTIN(4, IOAPIC_MSIDATA_DM_MASK) -#define IOAPIC_MSIDATA_DM_INIT __SHIFTIN(5, IOAPIC_MSIDATA_DM_MASK) -#define IOAPIC_MSIDATA_DM_RSVD1 __SHIFTIN(6, IOAPIC_MSIDATA_DM_MASK) -#define IOAPIC_MSIDATA_DM_EXTINT __SHIFTIN(7, IOAPIC_MSIDATA_DM_MASK) -#define IOAPIC_MSIDATA_RSVD0_MASK __BITS(13, 11) -#define IOAPIC_MSIDATA_LEVEL_MASK __BIT(14) -#define IOAPIC_MSIDATA_LEVEL_DEASSERT __SHIFTIN(0, IOAPIC_MSIDATA_LEVEL_MASK) -#define IOAPIC_MSIDATA_LEVEL_ASSERT __SHIFTIN(1, IOAPIC_MSIDATA_LEVEL_MASK) -#define IOAPIC_MSIDATA_TRGMODE_MASK __BIT(15) -#define IOAPIC_MSIDATA_TRGMODE_EDGE \ -__SHIFTIN(0, IOAPIC_MSIDATA_TRGMODE_MASK) -#define IOAPIC_MSIDATA_TRGMODE_LEVEL \ -__SHIFTIN(1, IOAPIC_MSIDATA_TRGMODE_MASK) -#define IOAPIC_MSIDATA_RSVD1_MASK __BITS(31, 16) - /* * Memory-space registers. */ Index: src/sys/arch/x86/include/i82489reg.h diff -u src/sys/arch/x86/include/i82489reg.h:1.11 src/sys/arch/x86/include/i82489reg.h:1.12 --- src/sys/arch/x86/include/i82489reg.h:1.11 Fri Jan 20 18:47:04 2012 +++ src/sys/arch/x86/include/i82489reg.h Sat Jan 26 17:37:39 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: i82489reg.h,v 1.11 2012/01/20 18:47:04 hannken Exp $ */ +/* $NetBSD: i82489reg.h,v 1.12 2013/01/26 17:37:39 dyoung Exp $ */ /*- * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc. @@ -139,6 +139,32 @@ # define LAPIC_DCRT_DIV64 0x09 # define LAPIC_DCRT_DIV128 0x0a +#define LAPIC_MSIADDR_BASE 0xfee0 +#define LAPIC_MSIADDR_DSTID_MASK __BITS(19, 12) +#define LAPIC_MSIADDR_RSVD0_MASK __BITS(11, 4) +#define LAPIC_MSIADDR_RH __BIT(3) +#define LAPIC_MSIADDR_DM __BIT(2) +#define LAPIC_MSIADDR_RSVD1_MASK __BITS(1, 0) + +#define LAPIC_MSIDATA_VECTOR_MASK __BITS(7, 0) +#define LAPIC_MSIDATA_DM_MASK __BITS(10, 8) +#define LAPIC_MSIDATA_DM_FIXED __SHIFTIN(0, LAPIC_MSIDATA_DM_MASK) +#define LAPIC_MSIDATA_DM_LOPRI __SHIFTIN(1, LAPIC_MSIDATA_DM_MASK) +#define LAPIC_MSIDATA_DM_SMI __SHIFTIN(2, LAPIC_MSIDATA_DM_MASK) +#define LAPIC_MSIDATA_DM_RSVD0 __SHIFTIN(3, LAPIC_MSIDATA_DM_MASK) +#define LAPIC_MSIDATA_DM_NMI __SHIFTIN(4, LAPIC_MSIDATA_DM_MASK) +#define LAPIC_MSIDATA_DM_INIT __SHIFTIN(5, LAPIC_MSIDATA_DM_MASK) +#define LAPIC_MSIDATA_DM_RSVD1 __SHIFTIN(6, LAPIC_MSIDATA_DM_MASK) +#define LAPIC_MSIDATA_DM_EXTINT __SHIFTIN(7, LAPIC_MSIDATA_DM_MASK) +#define LAPIC_MSIDATA_RSVD0_MASK __BITS(13, 11) +#define LAPIC_MSIDATA_LEVEL_MASK __BIT(14) +#define LAPIC_MSIDATA_LEVEL_DEASSERT __SHIFTIN(0, LAPIC_MSIDATA_LEVEL_MASK) +#define LAPIC_MSIDATA_LEVEL_ASSERT __SHIFTIN(1, LAPIC_MSIDATA_LEVEL_MASK) +#define LAPIC_MSIDATA_TRGMODE_MASK __BIT(15) +#define LAPIC_MSIDATA_TRGMODE_EDGE __SHIFTIN(0, LAPIC_MSIDATA_TRGMODE_MASK) +#define LAPIC_MSIDATA_TRGMODE_LEVEL __SHIFTIN(1, LAPIC_MSIDATA_TRGMODE_MASK) +#define LAPIC_MSIDATA_RSVD1_MASK __BITS(31, 16) + #define LAPIC_BASE 0xfee0 #define LAPIC_IRQ_MASK(i) (1 ((i) + 1)) Index: src/sys/arch/x86/pci/pci_intr_machdep.c diff -u src/sys/arch/x86/pci/pci_intr_machdep.c:1.25 src/sys/arch/x86/pci/pci_intr_machdep.c:1.26 ---
CVS commit: src/usr.sbin/ldpd
Module Name:src Committed By: kefren Date: Sat Jan 26 17:46:50 UTC 2013 Modified Files: src/usr.sbin/ldpd: socketops.c Log Message: allow compile without -DINET6 To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/ldpd/socketops.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/ldpd/socketops.c diff -u src/usr.sbin/ldpd/socketops.c:1.17 src/usr.sbin/ldpd/socketops.c:1.18 --- src/usr.sbin/ldpd/socketops.c:1.17 Sat Jan 26 17:29:55 2013 +++ src/usr.sbin/ldpd/socketops.c Sat Jan 26 17:46:50 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: socketops.c,v 1.17 2013/01/26 17:29:55 kefren Exp $ */ +/* $NetBSD: socketops.c,v 1.18 2013/01/26 17:46:50 kefren Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -89,10 +89,10 @@ create_hello_sockets() { struct ip_mreq mcast_addr; int s, joined_groups; -#ifdef INET6 - struct ipv6_mreq mcast_addr6; struct ifaddrs *ifa, *ifb; uint lastifindex; +#ifdef INET6 + struct ipv6_mreq mcast_addr6; struct sockaddr_in6 *if_sa6; #endif struct hello_socket *hs;
CVS commit: src/sys/arch/atari/dev
Module Name:src Committed By: apb Date: Sat Jan 26 18:13:56 UTC 2013 Modified Files: src/sys/arch/atari/dev: clock.c Log Message: use sizeof(buffer) - 1, not sizeof(buffer - 1) To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/sys/arch/atari/dev/clock.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/atari/dev/clock.c diff -u src/sys/arch/atari/dev/clock.c:1.54 src/sys/arch/atari/dev/clock.c:1.55 --- src/sys/arch/atari/dev/clock.c:1.54 Sat Jun 30 12:42:37 2012 +++ src/sys/arch/atari/dev/clock.c Sat Jan 26 18:13:55 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: clock.c,v 1.54 2012/06/30 12:42:37 tsutsui Exp $ */ +/* $NetBSD: clock.c,v 1.55 2013/01/26 18:13:55 apb Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: clock.c,v 1.54 2012/06/30 12:42:37 tsutsui Exp $); +__KERNEL_RCSID(0, $NetBSD: clock.c,v 1.55 2013/01/26 18:13:55 apb Exp $); #include sys/param.h #include sys/kernel.h @@ -552,7 +552,7 @@ rtcwrite(dev_t dev, struct uio *uio, int */ length = uio-uio_resid; if (uio-uio_offset || (length != sizeof(buffer) - length != sizeof(buffer - 1))) + length != sizeof(buffer) - 1)) return EINVAL; if ((error = uiomove((void *)buffer, sizeof(buffer), uio)))
CVS commit: src/etc
Module Name:src Committed By: apb Date: Sat Jan 26 18:44:22 UTC 2013 Modified Files: src/etc: MAKEDEV.tmpl Log Message: The console major number is not always 0; when creating a temporary console while populating a memory disk, use %CONSOLE_CMAJOR% instead of 0, and let MAKEDEV.awk substitute the appropriate machine-dependent major number. This fixes a bug that I introduced in revision 1.82 dated 2007-03-11. To generate a diff of this commit: cvs rdiff -u -r1.160 -r1.161 src/etc/MAKEDEV.tmpl Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/MAKEDEV.tmpl diff -u src/etc/MAKEDEV.tmpl:1.160 src/etc/MAKEDEV.tmpl:1.161 --- src/etc/MAKEDEV.tmpl:1.160 Thu Jan 10 13:38:37 2013 +++ src/etc/MAKEDEV.tmpl Sat Jan 26 18:44:21 2013 @@ -1,5 +1,5 @@ #!/bin/sh - -# $NetBSD: MAKEDEV.tmpl,v 1.160 2013/01/10 13:38:37 skrll Exp $ +# $NetBSD: MAKEDEV.tmpl,v 1.161 2013/01/26 18:44:21 apb Exp $ # # Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc. # All rights reserved. @@ -2292,7 +2292,7 @@ create_mfs_dev() if $do_redirect; then # Redirect stdout and stderr to console - mknod -m 600 -g 0 -u 0 temp_console c 0 0 + mknod -m 600 -g 0 -u 0 temp_console c %CONSOLE_CMAJOR% 0 exec temp_console 21 rm temp_console fi
CVS commit: src/sys
Module Name:src Committed By: tls Date: Sat Jan 26 19:05:12 UTC 2013 Modified Files: src/sys/kern: kern_rndq.c src/sys/sys: rnd.h Log Message: Rather than holding samples from each source until we have 64 at a time to process, process them ASAP for low-rate sources, and for all sources if we have not yet acquired initial entropy. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/kern/kern_rndq.c cvs rdiff -u -r1.34 -r1.35 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/kern/kern_rndq.c diff -u src/sys/kern/kern_rndq.c:1.8 src/sys/kern/kern_rndq.c:1.9 --- src/sys/kern/kern_rndq.c:1.8 Thu Jan 24 14:23:45 2013 +++ src/sys/kern/kern_rndq.c Sat Jan 26 19:05:12 2013 @@ -1,7 +1,7 @@ -/* $NetBSD: kern_rndq.c,v 1.8 2013/01/24 14:23:45 riastradh Exp $ */ +/* $NetBSD: kern_rndq.c,v 1.9 2013/01/26 19:05:12 tls Exp $ */ /*- - * Copyright (c) 1997-2011 The NetBSD Foundation, Inc. + * Copyright (c) 1997-2013 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -32,7 +32,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.8 2013/01/24 14:23:45 riastradh Exp $); +__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.9 2013/01/26 19:05:12 tls Exp $); #include sys/param.h #include sys/ioctl.h @@ -80,12 +80,6 @@ int rnd_debug = 0; #endif /* - * The size of a temporary buffer, kmem_alloc()ed when needed, and used for - * reading and writing data. - */ -#define RND_TEMP_BUFFER_SIZE 128 - -/* * This is a little bit of state information attached to each device that we * collect entropy from. This is simply a collection buffer, and when it * is full it will be detached from the source and added to the entropy @@ -665,6 +659,7 @@ rnd_add_data_ts(krndsource_t *rs, const rnd_sample_t *state = NULL; const uint32_t *dint = data; int todo, done, filled = 0; + int sample_count; SIMPLEQ_HEAD(, _rnd_sample_t) tmp_samples = SIMPLEQ_HEAD_INITIALIZER(tmp_samples); @@ -672,11 +667,40 @@ rnd_add_data_ts(krndsource_t *rs, const return; } + todo = len / sizeof(*dint); + /* + * Let's try to be efficient: if we are warm, and a source + * is adding entropy at a rate of at least 1 bit every 10 seconds, + * mark it as fast and add its samples in bulk. + */ + if (__predict_true(rs-flags RND_FLAG_FAST)) { + sample_count = RND_SAMPLE_COUNT; + } else { + if (!cold rnd_initial_entropy) { + struct timeval upt; + + getmicrouptime(upt); + if ((todo = RND_SAMPLE_COUNT) || + (rs-total upt.tv_sec) || + (upt.tv_sec 10 + rs-total upt.tv_sec / 10)) { +#ifdef RND_VERBOSE +printf(rnd: source %s is fast (%d samples + at once, %d bits in %lld seconds), + processing samples in bulk.\n, + rs-name, todo, rs-total, + (long long int)upt.tv_sec); +#endif +rs-flags |= RND_FLAG_FAST; + } + } + sample_count = 2; + } + /* * Loop over data packaging it into sample buffers. * If a sample buffer allocation fails, drop all data. */ - todo = len / sizeof(*dint); for (done = 0; done todo ; done++) { state = rs-state; if (state == NULL) { @@ -691,7 +715,7 @@ rnd_add_data_ts(krndsource_t *rs, const state-values[state-cursor] = dint[done]; state-cursor++; - if (state-cursor == RND_SAMPLE_COUNT) { + if (state-cursor == sample_count) { SIMPLEQ_INSERT_HEAD(tmp_samples, state, next); filled++; rs-state = NULL; Index: src/sys/sys/rnd.h diff -u src/sys/sys/rnd.h:1.34 src/sys/sys/rnd.h:1.35 --- src/sys/sys/rnd.h:1.34 Sun Nov 25 15:29:55 2012 +++ src/sys/sys/rnd.h Sat Jan 26 19:05:11 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rnd.h,v 1.34 2012/11/25 15:29:55 christos Exp $ */ +/* $NetBSD: rnd.h,v 1.35 2013/01/26 19:05:11 tls Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -91,6 +91,7 @@ typedef struct { */ #define RND_FLAG_NO_ESTIMATE 0x0100 /* don't estimate entropy */ #define RND_FLAG_NO_COLLECT 0x0200 /* don't collect entropy */ +#define RND_FLAG_FAST 0x0400 /* process samples in bulk */ #define RND_TYPE_UNKNOWN 0 /* unknown source */ #define RND_TYPE_DISK 1 /* source is physical disk */
CVS commit: src/sys/kern
Module Name:src Committed By: riastradh Date: Sat Jan 26 19:38:17 UTC 2013 Modified Files: src/sys/kern: sys_select.c Log Message: Assert equality, not assignment, in selrecord. Code inspection suggests that this fix is not likely to reveal any latent problems. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/kern/sys_select.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_select.c diff -u src/sys/kern/sys_select.c:1.36 src/sys/kern/sys_select.c:1.37 --- src/sys/kern/sys_select.c:1.36 Mon Aug 29 00:39:16 2011 +++ src/sys/kern/sys_select.c Sat Jan 26 19:38:17 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_select.c,v 1.36 2011/08/29 00:39:16 rmind Exp $ */ +/* $NetBSD: sys_select.c,v 1.37 2013/01/26 19:38:17 riastradh Exp $ */ /*- * Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc. @@ -84,7 +84,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: sys_select.c,v 1.36 2011/08/29 00:39:16 rmind Exp $); +__KERNEL_RCSID(0, $NetBSD: sys_select.c,v 1.37 2013/01/26 19:38:17 riastradh Exp $); #include sys/param.h #include sys/systm.h @@ -596,7 +596,7 @@ selrecord(lwp_t *selector, struct selinf if (other == selector) { /* 1. We (selector) already claimed to be the first LWP. */ - KASSERT(sip-sel_cluster = sc); + KASSERT(sip-sel_cluster == sc); } else if (other == NULL) { /* * 2. No first LWP, therefore we (selector) are the first.
CVS commit: src/usr.sbin/ldpd
Module Name:src Committed By: kefren Date: Sat Jan 26 19:44:52 UTC 2013 Modified Files: src/usr.sbin/ldpd: ldp.h socketops.c Log Message: use predefined group consts/macros instead of ptoning strings To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/ldpd/ldp.h cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/ldpd/socketops.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/ldpd/ldp.h diff -u src/usr.sbin/ldpd/ldp.h:1.5 src/usr.sbin/ldpd/ldp.h:1.6 --- src/usr.sbin/ldpd/ldp.h:1.5 Sat Jan 26 17:29:55 2013 +++ src/usr.sbin/ldpd/ldp.h Sat Jan 26 19:44:52 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ldp.h,v 1.5 2013/01/26 17:29:55 kefren Exp $ */ +/* $NetBSD: ldp.h,v 1.6 2013/01/26 19:44:52 kefren Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -36,10 +36,6 @@ #include netinet/in.h /* RFC5036 */ -#define ALL_ROUTERS 224.0.0.2 -/* draft-ietf-mpls-ldp-ipv6 */ -#define ALL_ROUTERS6 FF02::2 -/* RFC5036 */ #define LDP_PORT 646 #define LDP_COMMAND_PORT 2626 Index: src/usr.sbin/ldpd/socketops.c diff -u src/usr.sbin/ldpd/socketops.c:1.18 src/usr.sbin/ldpd/socketops.c:1.19 --- src/usr.sbin/ldpd/socketops.c:1.18 Sat Jan 26 17:46:50 2013 +++ src/usr.sbin/ldpd/socketops.c Sat Jan 26 19:44:52 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: socketops.c,v 1.18 2013/01/26 17:46:50 kefren Exp $ */ +/* $NetBSD: socketops.c,v 1.19 2013/01/26 19:44:52 kefren Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -107,7 +107,7 @@ create_hello_sockets() * RFC5036 specifies we should listen to all subnet routers multicast * group */ - assert(inet_pton(AF_INET, ALL_ROUTERS, mcast_addr.imr_multiaddr) == 1); + mcast_addr.imr_multiaddr.s_addr = htonl(INADDR_ALLRTRS_GROUP); if (socket_reuse_port(s) 0) goto chs_error; @@ -206,8 +206,7 @@ create_hello_sockets() } lastifindex = UINT_MAX; - assert(inet_pton(AF_INET6, ALL_ROUTERS6, - mcast_addr6.ipv6mr_multiaddr) == 1); + mcast_addr6.ipv6mr_multiaddr = in6addr_linklocal_allrouters; for (ifb = ifa; ifb; ifb = ifb-ifa_next) { if_sa6 = (struct sockaddr_in6 *) ifb-ifa_addr; if (if_sa6-sin6_family != AF_INET6 || @@ -452,7 +451,7 @@ send_hello(void) sadest.sin_len = sizeof(sadest); sadest.sin_family = AF_INET; sadest.sin_port = htons(LDP_PORT); - inet_aton(ALL_ROUTERS, sadest.sin_addr); + sadest.sin_addr.s_addr = htonl(INADDR_ALLRTRS_GROUP); /* Find our socket */ SLIST_FOREACH(hs, hello_socket_head, listentry) @@ -516,7 +515,7 @@ send_hello(void) sadest6.sin6_len = sizeof(sadest6); sadest6.sin6_family = AF_INET6; sadest6.sin6_port = htons(LDP_PORT); - assert(inet_pton(AF_INET6, ALL_ROUTERS6, sadest6.sin6_addr) == 1); + sadest6.sin6_addr = in6addr_linklocal_allrouters; SLIST_FOREACH(hs, hello_socket_head, listentry) if (hs-type == AF_INET6) {
CVS commit: src/external/cddl/osnet/dist/lib/libzfs/common
Module Name:src Committed By: christos Date: Sat Jan 26 20:15:50 UTC 2013 Modified Files: src/external/cddl/osnet/dist/lib/libzfs/common: libzfs_util.c Log Message: Avoid comparison between pointer and integer. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 \ src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_util.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_util.c diff -u src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_util.c:1.5 src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_util.c:1.6 --- src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_util.c:1.5 Tue Jan 1 14:02:19 2013 +++ src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_util.c Sat Jan 26 15:15:50 2013 @@ -686,7 +686,7 @@ zcmd_alloc_dst_nvlist(libzfs_handle_t *h len = 4*1024; zc-zc_nvlist_dst_size = len; if ((zc-zc_nvlist_dst = (uint64_t)(uintptr_t) - zfs_alloc(hdl, zc-zc_nvlist_dst_size)) == NULL) + zfs_alloc(hdl, zc-zc_nvlist_dst_size)) == 0) return (-1); return (0); @@ -702,8 +702,7 @@ zcmd_expand_dst_nvlist(libzfs_handle_t * { free((void *)(uintptr_t)zc-zc_nvlist_dst); if ((zc-zc_nvlist_dst = (uint64_t)(uintptr_t) - zfs_alloc(hdl, zc-zc_nvlist_dst_size)) - == NULL) + zfs_alloc(hdl, zc-zc_nvlist_dst_size)) == 0) return (-1); return (0);
CVS commit: src/usr.sbin/ldpd
Module Name:src Committed By: kefren Date: Sat Jan 26 21:07:49 UTC 2013 Modified Files: src/usr.sbin/ldpd: conffile.c conffile.h socketops.c Log Message: * add a new keyword for config file - passive-if and check if it's allowed to use the interface before join/send mcast * check if interface supports multicast before join/send mcast To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/ldpd/conffile.c cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/ldpd/conffile.h cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/ldpd/socketops.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/ldpd/conffile.c diff -u src/usr.sbin/ldpd/conffile.c:1.4 src/usr.sbin/ldpd/conffile.c:1.5 --- src/usr.sbin/ldpd/conffile.c:1.4 Mon Nov 12 18:39:00 2012 +++ src/usr.sbin/ldpd/conffile.c Sat Jan 26 21:07:49 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: conffile.c,v 1.4 2012/11/12 18:39:00 kefren Exp $ */ +/* $NetBSD: conffile.c,v 1.5 2013/01/26 21:07:49 kefren Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -63,6 +63,7 @@ static int Fneighbour(char*); static int Gneighbour(struct conf_neighbour *, char *); static int Fnodefault(char*); static int Floopdetection(char*); +static int Fpassiveif(char*); struct conf_func { char com[64]; @@ -81,6 +82,7 @@ struct conf_func main_commands[] = { { neighbour, Fneighbour }, { no-default-route, Fnodefault }, { loop-detection, Floopdetection }, + { passive-if, Fpassiveif }, { , NULL }, }; @@ -94,6 +96,7 @@ conf_parsefile(char *fname) char buf[LINEMAXSIZE + 1]; SLIST_INIT(conei_head); + SLIST_INIT(passifs_head); conf_ldp_id.s_addr = 0; confh = open(fname, O_RDONLY, 0); @@ -324,3 +327,16 @@ Floopdetection(char *line) loop_detection = loopd; return 0; } + +int +Fpassiveif(char *line) +{ + struct passive_if *pif; + + if (strlen(line) IF_NAMESIZE - 1) + return E_CONF_PARAM; + pif = calloc(1, sizeof(*pif)); + strlcpy(pif-if_name, line, IF_NAMESIZE); + SLIST_INSERT_HEAD(passifs_head, pif, listentry); + return 0; +} Index: src/usr.sbin/ldpd/conffile.h diff -u src/usr.sbin/ldpd/conffile.h:1.1 src/usr.sbin/ldpd/conffile.h:1.2 --- src/usr.sbin/ldpd/conffile.h:1.1 Thu Dec 30 11:29:21 2010 +++ src/usr.sbin/ldpd/conffile.h Sat Jan 26 21:07:49 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: conffile.h,v 1.1 2010/12/30 11:29:21 kefren Exp $ */ +/* $NetBSD: conffile.h,v 1.2 2013/01/26 21:07:49 kefren Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -32,6 +32,7 @@ #ifndef __CONFFILE_H #define __CONFFILE_H +#include net/if.h #include netinet/in.h #include sys/queue.h @@ -50,6 +51,11 @@ struct conf_neighbour { }; SLIST_HEAD(,conf_neighbour) conei_head; +struct passive_if { + char if_name[IF_NAMESIZE]; + SLIST_ENTRY(passive_if) listentry; +}; +SLIST_HEAD(,passive_if) passifs_head; int conf_parsefile(char *fname); Index: src/usr.sbin/ldpd/socketops.c diff -u src/usr.sbin/ldpd/socketops.c:1.19 src/usr.sbin/ldpd/socketops.c:1.20 --- src/usr.sbin/ldpd/socketops.c:1.19 Sat Jan 26 19:44:52 2013 +++ src/usr.sbin/ldpd/socketops.c Sat Jan 26 21:07:49 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: socketops.c,v 1.19 2013/01/26 19:44:52 kefren Exp $ */ +/* $NetBSD: socketops.c,v 1.20 2013/01/26 21:07:49 kefren Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -47,6 +47,7 @@ #include strings.h #include unistd.h +#include conffile.h #include fsm.h #include ldp.h #include ldp_command.h @@ -83,6 +84,7 @@ static int set_tos(int); static int socket_reuse_port(int); static int get_local_addr(struct sockaddr_dl *, struct in_addr *); static int is_hello_socket(int); +static int is_passive_if(char *if_name); int create_hello_sockets() @@ -134,7 +136,9 @@ create_hello_sockets() struct sockaddr_in *if_sa = (struct sockaddr_in *) ifb-ifa_addr; if (if_sa-sin_family != AF_INET || (!(ifb-ifa_flags IFF_UP)) || (ifb-ifa_flags IFF_LOOPBACK) || + (!(ifb-ifa_flags IFF_MULTICAST)) || (ntohl(if_sa-sin_addr.s_addr) 24 == IN_LOOPBACKNET) || + is_passive_if(ifb-ifa_name) || lastifindex == if_nametoindex(ifb-ifa_name)) continue; lastifindex = if_nametoindex(ifb-ifa_name); @@ -211,7 +215,9 @@ create_hello_sockets() if_sa6 = (struct sockaddr_in6 *) ifb-ifa_addr; if (if_sa6-sin6_family != AF_INET6 || (!(ifb-ifa_flags IFF_UP)) || + (!(ifb-ifa_flags IFF_MULTICAST)) || (ifb-ifa_flags IFF_LOOPBACK) || + is_passive_if(ifb-ifa_name) || IN6_IS_ADDR_LOOPBACK(if_sa6-sin6_addr)) continue; /* @@ -275,6 +281,18 @@ is_hello_socket(int s) return 0; } +/* Check if interface is passive */ +static int +is_passive_if(char *if_name) +{ + struct passive_if *pif; + + SLIST_FOREACH(pif, passifs_head, listentry) + if (strncasecmp(if_name, pif-if_name, IF_NAMESIZE) == 0) + return 1; + return 0; +} + /* Sets the TTL to 1 as we don't want to transmit outside
CVS commit: [netbsd-6] src/sys/kern
Module Name:src Committed By: bouyer Date: Sat Jan 26 21:35:23 UTC 2013 Modified Files: src/sys/kern [netbsd-6]: subr_cprng.c Log Message: Pull up following revision(s) (requested by tls in ticket #800): sys/kern/subr_cprng.c: revision 1.15 Fix a security issue: when we are reseeding a PRNG seeded early in boot before we had ever had any entropy, if something else has consumed the entropy that triggered the immediate reseed, we can reseed with as little as sizeof(int) bytes of entropy. To generate a diff of this commit: cvs rdiff -u -r1.5.2.6 -r1.5.2.7 src/sys/kern/subr_cprng.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/subr_cprng.c diff -u src/sys/kern/subr_cprng.c:1.5.2.6 src/sys/kern/subr_cprng.c:1.5.2.7 --- src/sys/kern/subr_cprng.c:1.5.2.6 Sat Nov 24 20:58:00 2012 +++ src/sys/kern/subr_cprng.c Sat Jan 26 21:35:23 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_cprng.c,v 1.5.2.6 2012/11/24 20:58:00 jdc Exp $ */ +/* $NetBSD: subr_cprng.c,v 1.5.2.7 2013/01/26 21:35:23 bouyer Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -46,7 +46,7 @@ #include sys/cprng.h -__KERNEL_RCSID(0, $NetBSD: subr_cprng.c,v 1.5.2.6 2012/11/24 20:58:00 jdc Exp $); +__KERNEL_RCSID(0, $NetBSD: subr_cprng.c,v 1.5.2.7 2013/01/26 21:35:23 bouyer Exp $); void cprng_init(void) @@ -84,6 +84,8 @@ cprng_strong_doreseed(cprng_strong_t *co cc, sizeof(cc))) { panic(cprng %s: nist_ctr_drbg_reseed failed., c-name); } + memset(c-reseed.data, 0, c-reseed.len); + #ifdef RND_VERBOSE printf(cprng %s: reseeded with rnd_filled = %d\n, c-name, rnd_filled); @@ -154,6 +156,17 @@ cprng_strong_reseed(void *const arg) mutex_exit(c-mtx); } +static size_t +cprng_entropy_try(uint8_t *key, size_t keylen, int hard) +{ + int r; + r = rnd_extract_data(key, keylen, RND_EXTRACT_GOOD); + if (r != keylen !hard) { + rnd_extract_data(key + r, keylen - r, RND_EXTRACT_ANY); + } + return r; +} + cprng_strong_t * cprng_strong_create(const char *const name, int ipl, int flags) { @@ -183,15 +196,13 @@ cprng_strong_create(const char *const na selinit(c-selq); - r = rnd_extract_data(key, sizeof(key), RND_EXTRACT_GOOD); + r = cprng_entropy_try(key, sizeof(key), c-flags CPRNG_INIT_ANY); if (r != sizeof(key)) { if (c-flags CPRNG_INIT_ANY) { #ifdef DEBUG printf(cprng %s: WARNING insufficient entropy at creation.\n, name); #endif - rnd_extract_data(key + r, sizeof(key - r), - RND_EXTRACT_ANY); } else { hard++; } @@ -240,15 +251,18 @@ rekeyany: if (c-flags CPRNG_REKEY_ANY) { uint8_t key[NIST_BLOCK_KEYLEN_BYTES]; - printf(cprng %s: WARNING pseudorandom rekeying.\n, - c-name); -rnd_extract_data(key, sizeof(key), RND_EXTRACT_ANY); + if (cprng_entropy_try(key, sizeof(key), 0) != + sizeof(key)) { + printf(cprng %s: WARNING + pseudorandom rekeying.\n, c-name); + } cc = cprng_counter(); if (nist_ctr_drbg_reseed(c-drbg, key, sizeof(key), cc, sizeof(cc))) { panic(cprng %s: nist_ctr_drbg_reseed failed., c-name); } + memset(key, 0, sizeof(key)); } else { int wr;
CVS commit: [netbsd-6] src/doc
Module Name:src Committed By: bouyer Date: Sat Jan 26 21:36:06 UTC 2013 Modified Files: src/doc [netbsd-6]: CHANGES-6.1 Log Message: ticket 800 To generate a diff of this commit: cvs rdiff -u -r1.1.2.75 -r1.1.2.76 src/doc/CHANGES-6.1 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-6.1 diff -u src/doc/CHANGES-6.1:1.1.2.75 src/doc/CHANGES-6.1:1.1.2.76 --- src/doc/CHANGES-6.1:1.1.2.75 Sun Jan 13 19:09:38 2013 +++ src/doc/CHANGES-6.1 Sat Jan 26 21:36:05 2013 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-6.1,v 1.1.2.75 2013/01/13 19:09:38 bouyer Exp $ +# $NetBSD: CHANGES-6.1,v 1.1.2.76 2013/01/26 21:36:05 bouyer Exp $ A complete list of changes from the 6.0 release until the 6.1 release: @@ -8047,3 +8047,11 @@ gnu/dist/grep/src/search.c 1.4 [apb, ticket #780] +sys/kern/subr_cprng.c1.15 + + Fix a security issue: when we are reseeding a PRNG seeded early in + boot before we had ever had any entropy, if something else has + consumed the entropy that triggered the immediate reseed, we can + reseed with as little as sizeof(int) bytes of entropy. + [tls, ticket #800] +
CVS commit: [netbsd-6-0] src/sys/kern
Module Name:src Committed By: bouyer Date: Sat Jan 26 21:36:10 UTC 2013 Modified Files: src/sys/kern [netbsd-6-0]: subr_cprng.c Log Message: Pull up following revision(s) (requested by tls in ticket #800): sys/kern/subr_cprng.c: revision 1.15 Fix a security issue: when we are reseeding a PRNG seeded early in boot before we had ever had any entropy, if something else has consumed the entropy that triggered the immediate reseed, we can reseed with as little as sizeof(int) bytes of entropy. To generate a diff of this commit: cvs rdiff -u -r1.5.2.3 -r1.5.2.3.4.1 src/sys/kern/subr_cprng.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/subr_cprng.c diff -u src/sys/kern/subr_cprng.c:1.5.2.3 src/sys/kern/subr_cprng.c:1.5.2.3.4.1 --- src/sys/kern/subr_cprng.c:1.5.2.3 Mon May 21 16:49:54 2012 +++ src/sys/kern/subr_cprng.c Sat Jan 26 21:36:10 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_cprng.c,v 1.5.2.3 2012/05/21 16:49:54 jdc Exp $ */ +/* $NetBSD: subr_cprng.c,v 1.5.2.3.4.1 2013/01/26 21:36:10 bouyer Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -46,7 +46,7 @@ #include sys/cprng.h -__KERNEL_RCSID(0, $NetBSD: subr_cprng.c,v 1.5.2.3 2012/05/21 16:49:54 jdc Exp $); +__KERNEL_RCSID(0, $NetBSD: subr_cprng.c,v 1.5.2.3.4.1 2013/01/26 21:36:10 bouyer Exp $); void cprng_init(void) @@ -84,6 +84,8 @@ cprng_strong_doreseed(cprng_strong_t *co cc, sizeof(cc))) { panic(cprng %s: nist_ctr_drbg_reseed failed., c-name); } + memset(c-reseed.data, 0, c-reseed.len); + #ifdef RND_VERBOSE printf(cprng %s: reseeded with rnd_filled = %d\n, c-name, rnd_filled); @@ -154,6 +156,17 @@ cprng_strong_reseed(void *const arg) mutex_exit(c-mtx); } +static size_t +cprng_entropy_try(uint8_t *key, size_t keylen, int hard) +{ + int r; + r = rnd_extract_data(key, keylen, RND_EXTRACT_GOOD); + if (r != keylen !hard) { + rnd_extract_data(key + r, keylen - r, RND_EXTRACT_ANY); + } + return r; +} + cprng_strong_t * cprng_strong_create(const char *const name, int ipl, int flags) { @@ -183,15 +196,13 @@ cprng_strong_create(const char *const na selinit(c-selq); - r = rnd_extract_data(key, sizeof(key), RND_EXTRACT_GOOD); + r = cprng_entropy_try(key, sizeof(key), c-flags CPRNG_INIT_ANY); if (r != sizeof(key)) { if (c-flags CPRNG_INIT_ANY) { #ifdef DEBUG printf(cprng %s: WARNING insufficient entropy at creation.\n, name); #endif - rnd_extract_data(key + r, sizeof(key - r), - RND_EXTRACT_ANY); } else { hard++; } @@ -233,15 +244,18 @@ cprng_strong(cprng_strong_t *const c, vo if (c-flags CPRNG_REKEY_ANY) { uint8_t key[NIST_BLOCK_KEYLEN_BYTES]; - printf(cprng %s: WARNING pseudorandom rekeying.\n, - c-name); -rnd_extract_data(key, sizeof(key), RND_EXTRACT_ANY); + if (cprng_entropy_try(key, sizeof(key), 0) != + sizeof(key)) { + printf(cprng %s: WARNING + pseudorandom rekeying.\n, c-name); + } cc = cprng_counter(); if (nist_ctr_drbg_reseed(c-drbg, key, sizeof(key), cc, sizeof(cc))) { panic(cprng %s: nist_ctr_drbg_reseed failed., c-name); } + memset(key, 0, sizeof(key)); } else { int wr;
CVS commit: [netbsd-6-0] src/doc
Module Name:src Committed By: bouyer Date: Sat Jan 26 21:36:27 UTC 2013 Modified Files: src/doc [netbsd-6-0]: CHANGES-6.0.2 Log Message: ticket 800 To generate a diff of this commit: cvs rdiff -u -r1.1.2.6 -r1.1.2.7 src/doc/CHANGES-6.0.2 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-6.0.2 diff -u src/doc/CHANGES-6.0.2:1.1.2.6 src/doc/CHANGES-6.0.2:1.1.2.7 --- src/doc/CHANGES-6.0.2:1.1.2.6 Sun Jan 13 19:09:32 2013 +++ src/doc/CHANGES-6.0.2 Sat Jan 26 21:36:27 2013 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-6.0.2,v 1.1.2.6 2013/01/13 19:09:32 bouyer Exp $ +# $NetBSD: CHANGES-6.0.2,v 1.1.2.7 2013/01/26 21:36:27 bouyer Exp $ A complete list of changes from the NetBSD 6.0.1 release to the NetBSD 6.0.2 release: @@ -48,3 +48,11 @@ gnu/dist/grep/src/search.c 1.4 [apb, ticket #780] +sys/kern/subr_cprng.c1.15 + + Fix a security issue: when we are reseeding a PRNG seeded early in + boot before we had ever had any entropy, if something else has + consumed the entropy that triggered the immediate reseed, we can + reseed with as little as sizeof(int) bytes of entropy. + [tls, ticket #800] +
CVS commit: src/share/mk
Module Name:src Committed By: christos Date: Sat Jan 26 21:48:59 UTC 2013 Modified Files: src/share/mk: bsd.own.mk Log Message: include bsd.sys.mk This is a mess. HAS_SSP (which should really be HAVE_SSP), is defined in bsd.sys.mk. So things that need it, include the file directly. The trouble comes because bsd.sys.mk, needs stuff that bsd.own.mk defines, so including first does not work. Anyway most other files include bsd.sys.mk directly, so user Makefiles should just not do that, and just include bsd.own.mk to get all the defines they need. To generate a diff of this commit: cvs rdiff -u -r1.718 -r1.719 src/share/mk/bsd.own.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/mk/bsd.own.mk diff -u src/share/mk/bsd.own.mk:1.718 src/share/mk/bsd.own.mk:1.719 --- src/share/mk/bsd.own.mk:1.718 Fri Jan 18 14:32:09 2013 +++ src/share/mk/bsd.own.mk Sat Jan 26 16:48:58 2013 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.own.mk,v 1.718 2013/01/18 19:32:09 christos Exp $ +# $NetBSD: bsd.own.mk,v 1.719 2013/01/26 21:48:58 christos Exp $ # This needs to be before bsd.init.mk .if defined(BSD_MK_COMPAT_FILE) @@ -1238,4 +1238,6 @@ TARGETS+= lintmanpages TESTSBASE= /usr/tests +.include bsd.sys.mk + .endif # !defined(_BSD_OWN_MK_)
CVS commit: src/share/mk
Module Name:src Committed By: christos Date: Sat Jan 26 21:49:20 UTC 2013 Modified Files: src/share/mk: bsd.prog.mk bsd.sys.mk sys.mk Log Message: CTFCONVERT me harder. To generate a diff of this commit: cvs rdiff -u -r1.279 -r1.280 src/share/mk/bsd.prog.mk cvs rdiff -u -r1.220 -r1.221 src/share/mk/bsd.sys.mk cvs rdiff -u -r1.113 -r1.114 src/share/mk/sys.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/mk/bsd.prog.mk diff -u src/share/mk/bsd.prog.mk:1.279 src/share/mk/bsd.prog.mk:1.280 --- src/share/mk/bsd.prog.mk:1.279 Thu Jan 17 10:42:59 2013 +++ src/share/mk/bsd.prog.mk Sat Jan 26 16:49:20 2013 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.prog.mk,v 1.279 2013/01/17 15:42:59 christos Exp $ +# $NetBSD: bsd.prog.mk,v 1.280 2013/01/26 21:49:20 christos Exp $ # @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94 .ifndef HOSTPROG @@ -33,12 +33,18 @@ CLEANFILES+=strings .c.o: ${CC} -E ${CPPFLAGS} ${CFLAGS} ${.IMPSRC} | xstr -c - @${CC} ${CPPFLAGS} ${CFLAGS} -c x.c -o ${.TARGET} +.if defined(CTFCONVERT) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif @rm -f x.c .cc.o .cpp.o .cxx.o .C.o: ${CXX} -E ${CPPFLAGS} ${CXXFLAGS} ${.IMPSRC} | xstr -c - @mv -f x.c x.cc @${CXX} ${CPPFLAGS} ${CXXFLAGS} -c x.cc -o ${.TARGET} +.if defined(CTFCONVERT) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif @rm -f x.cc .endif Index: src/share/mk/bsd.sys.mk diff -u src/share/mk/bsd.sys.mk:1.220 src/share/mk/bsd.sys.mk:1.221 --- src/share/mk/bsd.sys.mk:1.220 Sun Sep 23 15:20:44 2012 +++ src/share/mk/bsd.sys.mk Sat Jan 26 16:49:20 2013 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.sys.mk,v 1.220 2012/09/23 19:20:44 joerg Exp $ +# $NetBSD: bsd.sys.mk,v 1.221 2013/01/26 21:49:20 christos Exp $ # # Build definitions used for NetBSD source tree builds. @@ -212,6 +212,9 @@ STRIP?= strip .cc.o .cpp.o .cxx.o .C.o: ${_MKTARGET_COMPILE} ${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} +.if defined(CTFCONVERT) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif # Objective C # (Defined here rather than in sys.mk because `.m' is not just Index: src/share/mk/sys.mk diff -u src/share/mk/sys.mk:1.113 src/share/mk/sys.mk:1.114 --- src/share/mk/sys.mk:1.113 Fri Jan 18 14:32:09 2013 +++ src/share/mk/sys.mk Sat Jan 26 16:49:20 2013 @@ -1,4 +1,4 @@ -# $NetBSD: sys.mk,v 1.113 2013/01/18 19:32:09 christos Exp $ +# $NetBSD: sys.mk,v 1.114 2013/01/26 21:49:20 christos Exp $ # @(#)sys.mk 8.2 (Berkeley) 3/21/94 # # This file contains the basic rules for make(1) and is read first @@ -135,6 +135,9 @@ YACC.y?= ${YACC} ${YFLAGS} ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} .cc.o .cpp.o .cxx.o .C.o: ${COMPILE.cc} ${.IMPSRC} +.if defined(CTFCONVERT) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .cc.a .cpp.a .cxx.a .C.a: ${COMPILE.cc} ${.IMPSRC} ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o @@ -145,6 +148,9 @@ YACC.y?= ${YACC} ${YFLAGS} ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} .f.o: ${COMPILE.f} ${.IMPSRC} +.if defined(CTFCONVERT) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .f.a: ${COMPILE.f} ${.IMPSRC} ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o @@ -169,6 +175,9 @@ YACC.y?= ${YACC} ${YFLAGS} ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} .r.o: ${COMPILE.r} ${.IMPSRC} +.if defined(CTFCONVERT) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif .r.a: ${COMPILE.r} ${.IMPSRC} ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o @@ -231,6 +240,9 @@ YACC.y?= ${YACC} ${YFLAGS} .l.o: ${LEX.l} ${.IMPSRC} ${COMPILE.c} -o ${.TARGET} lex.yy.c +.if defined(CTFCONVERT) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif rm -f lex.yy.c # Yacc @@ -244,6 +256,9 @@ YACC.y?= ${YACC} ${YFLAGS} .y.o: ${YACC.y} ${.IMPSRC} ${COMPILE.c} -o ${.TARGET} y.tab.c +.if defined(CTFCONVERT) + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.endif rm -f y.tab.c # Shell
CVS commit: src/tests/lib/libc
Module Name:src Committed By: christos Date: Sat Jan 26 21:58:41 UTC 2013 Modified Files: src/tests/lib/libc: Makefile Log Message: Don't include bsd.sys.mk; like sys.mk it is supposed to be used only internally. To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/tests/lib/libc/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libc/Makefile diff -u src/tests/lib/libc/Makefile:1.44 src/tests/lib/libc/Makefile:1.45 --- src/tests/lib/libc/Makefile:1.44 Sun Nov 18 12:41:54 2012 +++ src/tests/lib/libc/Makefile Sat Jan 26 16:58:41 2013 @@ -1,7 +1,6 @@ -# $NetBSD: Makefile,v 1.44 2012/11/18 17:41:54 manu Exp $ +# $NetBSD: Makefile,v 1.45 2013/01/26 21:58:41 christos Exp $ .include Makefile.inc -.include bsd.sys.mk .include bsd.own.mk SUBDIR+= tls_dso .WAIT
CVS commit: src/share/mk
Module Name:src Committed By: christos Date: Sat Jan 26 22:04:18 UTC 2013 Modified Files: src/share/mk: bsd.sys.mk sys.mk Log Message: CTFCONVERT complains and coredumps for c++ To generate a diff of this commit: cvs rdiff -u -r1.221 -r1.222 src/share/mk/bsd.sys.mk cvs rdiff -u -r1.114 -r1.115 src/share/mk/sys.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/mk/bsd.sys.mk diff -u src/share/mk/bsd.sys.mk:1.221 src/share/mk/bsd.sys.mk:1.222 --- src/share/mk/bsd.sys.mk:1.221 Sat Jan 26 16:49:20 2013 +++ src/share/mk/bsd.sys.mk Sat Jan 26 17:04:18 2013 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.sys.mk,v 1.221 2013/01/26 21:49:20 christos Exp $ +# $NetBSD: bsd.sys.mk,v 1.222 2013/01/26 22:04:18 christos Exp $ # # Build definitions used for NetBSD source tree builds. @@ -212,9 +212,6 @@ STRIP?= strip .cc.o .cpp.o .cxx.o .C.o: ${_MKTARGET_COMPILE} ${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -.if defined(CTFCONVERT) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif # Objective C # (Defined here rather than in sys.mk because `.m' is not just Index: src/share/mk/sys.mk diff -u src/share/mk/sys.mk:1.114 src/share/mk/sys.mk:1.115 --- src/share/mk/sys.mk:1.114 Sat Jan 26 16:49:20 2013 +++ src/share/mk/sys.mk Sat Jan 26 17:04:18 2013 @@ -1,4 +1,4 @@ -# $NetBSD: sys.mk,v 1.114 2013/01/26 21:49:20 christos Exp $ +# $NetBSD: sys.mk,v 1.115 2013/01/26 22:04:18 christos Exp $ # @(#)sys.mk 8.2 (Berkeley) 3/21/94 # # This file contains the basic rules for make(1) and is read first @@ -135,9 +135,6 @@ YACC.y?= ${YACC} ${YFLAGS} ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} .cc.o .cpp.o .cxx.o .C.o: ${COMPILE.cc} ${.IMPSRC} -.if defined(CTFCONVERT) - ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.endif .cc.a .cpp.a .cxx.a .C.a: ${COMPILE.cc} ${.IMPSRC} ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
CVS commit: src/sys/kern
Module Name:src Committed By: tls Date: Sat Jan 26 22:22:07 UTC 2013 Modified Files: src/sys/kern: kern_rndq.c Log Message: Tweak the previous a little: don't be so hasty to declare sources fast and process them in bulk, but, always declare hardware RNGs and VM system sources as fast since in these cases efficiency is important and data will be abundant. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/kern/kern_rndq.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_rndq.c diff -u src/sys/kern/kern_rndq.c:1.9 src/sys/kern/kern_rndq.c:1.10 --- src/sys/kern/kern_rndq.c:1.9 Sat Jan 26 19:05:12 2013 +++ src/sys/kern/kern_rndq.c Sat Jan 26 22:22:07 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_rndq.c,v 1.9 2013/01/26 19:05:12 tls Exp $ */ +/* $NetBSD: kern_rndq.c,v 1.10 2013/01/26 22:22:07 tls Exp $ */ /*- * Copyright (c) 1997-2013 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.9 2013/01/26 19:05:12 tls Exp $); +__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.10 2013/01/26 22:22:07 tls Exp $); #include sys/param.h #include sys/ioctl.h @@ -522,21 +522,24 @@ rnd_attach_source(krndsource_t *rs, cons rs-total = 0; /* - * Force network devices to not collect any entropy by - * default. + * Some source setup, by type */ - if (type == RND_TYPE_NET) - flags |= (RND_FLAG_NO_COLLECT | RND_FLAG_NO_ESTIMATE); + rs-test = NULL; + rs-test_cnt = -1; - /* - * Hardware RNGs get extra space for statistical testing. - */ - if (type == RND_TYPE_RNG) { + switch (type) { + case RND_TYPE_NET: /* Don't collect by default */ + flags |= (RND_FLAG_NO_COLLECT | RND_FLAG_NO_ESTIMATE); + break; + case RND_TYPE_RNG: /* Space for statistical testing */ rs-test = kmem_alloc(sizeof(rngtest_t), KM_NOSLEEP); rs-test_cnt = 0; - } else { - rs-test = NULL; - rs-test_cnt = -1; + /* FALLTHRU */ + case RND_TYPE_VM: /* Process samples in bulk always */ + flags |= RND_FLAG_FAST; + break; + default: + break; } rs-type = type; @@ -681,8 +684,9 @@ rnd_add_data_ts(krndsource_t *rs, const getmicrouptime(upt); if ((todo = RND_SAMPLE_COUNT) || - (rs-total upt.tv_sec) || - (upt.tv_sec 10 + (rs-total upt.tv_sec * 10) || + (upt.tv_sec 10 rs-total upt.tv_sec) || + (upt.tv_sec 100 rs-total upt.tv_sec / 10)) { #ifdef RND_VERBOSE printf(rnd: source %s is fast (%d samples
CVS commit: src/sys/dev/usb
Module Name:src Committed By: jakllsch Date: Sun Jan 27 01:35:29 UTC 2013 Modified Files: src/sys/dev/usb: usbdevs Log Message: Remove duplicate Quanta product. Add Ralink RT5370. To generate a diff of this commit: cvs rdiff -u -r1.636 -r1.637 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.636 src/sys/dev/usb/usbdevs:1.637 --- src/sys/dev/usb/usbdevs:1.636 Sun Jan 20 14:06:24 2013 +++ src/sys/dev/usb/usbdevs Sun Jan 27 01:35:28 2013 @@ -1,4 +1,4 @@ -$NetBSD: usbdevs,v 1.636 2013/01/20 14:06:24 pgoyette Exp $ +$NetBSD: usbdevs,v 1.637 2013/01/27 01:35:28 jakllsch Exp $ /* * Copyright (c) 1998-2004 The NetBSD Foundation, Inc. @@ -2563,7 +2563,6 @@ product QUICKSHOT STRIKEPAD 0x6238 USB S product RAINBOW IKEY2000 0x1200 i-Key 2000 /* Ralink Technology products */ -product QUANTA RT3070 0x0304 RT3070 product RALINK RT2570 0x1706 RT2570 product RALINK RT2070 0x2070 RT2070 product RALINK RT2570_2 0x2570 RT2570 @@ -2576,6 +2575,7 @@ product RALINK RT3071 0x3071 RT3071 product RALINK RT3072 0x3072 RT3072 product RALINK RT3370 0x3370 RT3370 product RALINK RT3572 0x3572 RT3572 +product RALINK RT5370 0x5370 RT5370 product RALINK RT8070 0x8070 RT8070 product RALINK RT2570_3 0x9020 RT2570
CVS commit: src/sys/dev/usb
Module Name:src Committed By: jakllsch Date: Sun Jan 27 01:36:34 UTC 2013 Modified Files: src/sys/dev/usb: usbdevs.h usbdevs_data.h Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.629 -r1.630 src/sys/dev/usb/usbdevs.h cvs rdiff -u -r1.630 -r1.631 src/sys/dev/usb/usbdevs_data.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/usb/usbdevs.h diff -u src/sys/dev/usb/usbdevs.h:1.629 src/sys/dev/usb/usbdevs.h:1.630 --- src/sys/dev/usb/usbdevs.h:1.629 Sun Jan 20 14:08:40 2013 +++ src/sys/dev/usb/usbdevs.h Sun Jan 27 01:36:33 2013 @@ -1,10 +1,10 @@ -/* $NetBSD: usbdevs.h,v 1.629 2013/01/20 14:08:40 pgoyette Exp $ */ +/* $NetBSD: usbdevs.h,v 1.630 2013/01/27 01:36:33 jakllsch Exp $ */ /* * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: usbdevs,v 1.636 2013/01/20 14:06:24 pgoyette Exp + * NetBSD: usbdevs,v 1.637 2013/01/27 01:35:28 jakllsch Exp */ /* @@ -2570,7 +2570,6 @@ #define USB_PRODUCT_RAINBOW_IKEY2000 0x1200 /* i-Key 2000 */ /* Ralink Technology products */ -#define USB_PRODUCT_QUANTA_RT3070 0x0304 /* RT3070 */ #define USB_PRODUCT_RALINK_RT2570 0x1706 /* RT2570 */ #define USB_PRODUCT_RALINK_RT2070 0x2070 /* RT2070 */ #define USB_PRODUCT_RALINK_RT2570_2 0x2570 /* RT2570 */ @@ -2583,6 +2582,7 @@ #define USB_PRODUCT_RALINK_RT3072 0x3072 /* RT3072 */ #define USB_PRODUCT_RALINK_RT3370 0x3370 /* RT3370 */ #define USB_PRODUCT_RALINK_RT3572 0x3572 /* RT3572 */ +#define USB_PRODUCT_RALINK_RT5370 0x5370 /* RT5370 */ #define USB_PRODUCT_RALINK_RT8070 0x8070 /* RT8070 */ #define USB_PRODUCT_RALINK_RT2570_3 0x9020 /* RT2570 */ Index: src/sys/dev/usb/usbdevs_data.h diff -u src/sys/dev/usb/usbdevs_data.h:1.630 src/sys/dev/usb/usbdevs_data.h:1.631 --- src/sys/dev/usb/usbdevs_data.h:1.630 Sun Jan 20 14:08:40 2013 +++ src/sys/dev/usb/usbdevs_data.h Sun Jan 27 01:36:33 2013 @@ -1,10 +1,10 @@ -/* $NetBSD: usbdevs_data.h,v 1.630 2013/01/20 14:08:40 pgoyette Exp $ */ +/* $NetBSD: usbdevs_data.h,v 1.631 2013/01/27 01:36:33 jakllsch Exp $ */ /* * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: usbdevs,v 1.636 2013/01/20 14:06:24 pgoyette Exp + * NetBSD: usbdevs,v 1.637 2013/01/27 01:35:28 jakllsch Exp */ /* @@ -7815,10 +7815,6 @@ const struct usb_product usb_products[] i-Key 2000, }, { - USB_VENDOR_QUANTA, USB_PRODUCT_QUANTA_RT3070, - RT3070, - }, - { USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT2570, RT2570, }, @@ -7867,6 +7863,10 @@ const struct usb_product usb_products[] RT3572, }, { + USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT5370, + RT5370, + }, + { USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT8070, RT8070, },
CVS commit: src/share/mk
Module Name:src Committed By: christos Date: Sun Jan 27 02:22:27 UTC 2013 Modified Files: src/share/mk: bsd.own.mk Log Message: we cannot include bsd.sys.mk because of YHEADER. The incestious relation of the .mk files needs to be fixed. To generate a diff of this commit: cvs rdiff -u -r1.719 -r1.720 src/share/mk/bsd.own.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/mk/bsd.own.mk diff -u src/share/mk/bsd.own.mk:1.719 src/share/mk/bsd.own.mk:1.720 --- src/share/mk/bsd.own.mk:1.719 Sat Jan 26 16:48:58 2013 +++ src/share/mk/bsd.own.mk Sat Jan 26 21:22:27 2013 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.own.mk,v 1.719 2013/01/26 21:48:58 christos Exp $ +# $NetBSD: bsd.own.mk,v 1.720 2013/01/27 02:22:27 christos Exp $ # This needs to be before bsd.init.mk .if defined(BSD_MK_COMPAT_FILE) @@ -1238,6 +1238,4 @@ TARGETS+= lintmanpages TESTSBASE= /usr/tests -.include bsd.sys.mk - .endif # !defined(_BSD_OWN_MK_)
CVS commit: src/share/mk
Module Name:src Committed By: christos Date: Sun Jan 27 02:31:44 UTC 2013 Modified Files: src/share/mk: bsd.own.mk bsd.sys.mk Log Message: Move HAS_SSP and USE_SSP out of bsd.sys.mk. They did not belong there in the first place. Rename HAS_SSP to HAVE_SSP to match existing practice. To generate a diff of this commit: cvs rdiff -u -r1.720 -r1.721 src/share/mk/bsd.own.mk cvs rdiff -u -r1.222 -r1.223 src/share/mk/bsd.sys.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/mk/bsd.own.mk diff -u src/share/mk/bsd.own.mk:1.720 src/share/mk/bsd.own.mk:1.721 --- src/share/mk/bsd.own.mk:1.720 Sat Jan 26 21:22:27 2013 +++ src/share/mk/bsd.own.mk Sat Jan 26 21:31:44 2013 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.own.mk,v 1.720 2013/01/27 02:22:27 christos Exp $ +# $NetBSD: bsd.own.mk,v 1.721 2013/01/27 02:31:44 christos Exp $ # This needs to be before bsd.init.mk .if defined(BSD_MK_COMPAT_FILE) @@ -70,6 +70,19 @@ USE_COMPILERCRTSTUFF?= yes HAVE_GDB?= 7 +.if (${MACHINE_ARCH} == alpha) || \ +(${MACHINE_ARCH} == hppa) || \ +(${MACHINE_ARCH} == ia64) || \ +(${MACHINE_ARCH} == mipsel) || (${MACHINE_ARCH} == mipseb) || \ +(${MACHINE_ARCH} == mips64el) || (${MACHINE_ARCH} == mips64eb) +HAVE_SSP?= no +.else +HAVE_SSP?= yes +.if ${USE_FORT:Uno} != no +USE_SSP?= yes +.endif +.endif + .if empty(.MAKEFLAGS:tW:M*-V .OBJDIR*) .if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR) PRINTOBJDIR= ${MAKE} -r -V .OBJDIR -f /dev/null xxx Index: src/share/mk/bsd.sys.mk diff -u src/share/mk/bsd.sys.mk:1.222 src/share/mk/bsd.sys.mk:1.223 --- src/share/mk/bsd.sys.mk:1.222 Sat Jan 26 17:04:18 2013 +++ src/share/mk/bsd.sys.mk Sat Jan 26 21:31:44 2013 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.sys.mk,v 1.222 2013/01/26 22:04:18 christos Exp $ +# $NetBSD: bsd.sys.mk,v 1.223 2013/01/27 02:31:44 christos Exp $ # # Build definitions used for NetBSD source tree builds. @@ -89,30 +89,14 @@ _NOWERROR= ${defined(NOGCCERROR) || (${A CFLAGS+= ${${_NOWERROR} == no :?-Werror:} ${CWARNFLAGS} LINTFLAGS+= ${DESTDIR:D-d ${DESTDIR}/usr/include} -.if (${MACHINE_ARCH} == alpha) || \ -(${MACHINE_ARCH} == hppa) || \ -(${MACHINE_ARCH} == ia64) || \ -(${MACHINE_ARCH} == mipsel) || (${MACHINE_ARCH} == mipseb) || \ -(${MACHINE_ARCH} == mips64el) || (${MACHINE_ARCH} == mips64eb) -HAS_SSP= no -.else -HAS_SSP= yes -.endif - -.if ${USE_FORT:Uno} != no -USE_SSP?= yes +.if (${USE_SSP:Uno} != no) (${BINDIR:Ux} != /usr/mdec) .if !defined(KERNSRCDIR) !defined(KERN) # not for kernels nor kern modules CPPFLAGS+= -D_FORTIFY_SOURCE=2 .endif -.endif - -.if (${USE_SSP:Uno} != no) (${BINDIR:Ux} != /usr/mdec) -.if ${HAS_SSP} == yes COPTS+= -fstack-protector -Wstack-protector COPTS+= ${${ACTIVE_CC} == clang:? --param ssp-buffer-size=1 :} COPTS+= ${${ACTIVE_CC} == gcc:? --param ssp-buffer-size=1 :} .endif -.endif .if ${MKSOFTFLOAT:Uno} != no COPTS+= -msoft-float
CVS commit: src/tests/lib/libc
Module Name:src Committed By: christos Date: Sun Jan 27 02:32:39 UTC 2013 Modified Files: src/tests/lib/libc: Makefile Log Message: rename the only use of HAS_SSP in the tree to HAVE_SSP. To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/tests/lib/libc/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libc/Makefile diff -u src/tests/lib/libc/Makefile:1.45 src/tests/lib/libc/Makefile:1.46 --- src/tests/lib/libc/Makefile:1.45 Sat Jan 26 16:58:41 2013 +++ src/tests/lib/libc/Makefile Sat Jan 26 21:32:39 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.45 2013/01/26 21:58:41 christos Exp $ +# $NetBSD: Makefile,v 1.46 2013/01/27 02:32:39 christos Exp $ .include Makefile.inc .include bsd.own.mk @@ -8,7 +8,7 @@ SUBDIR+= tls_dso .WAIT TESTS_SUBDIRS+= c063 db gen hash inet locale net regex rpc setjmp stdlib TESTS_SUBDIRS+= stdio string sys termios time tls ttyio -.if ${HAS_SSP} == yes +.if ${HAVE_SSP} == yes TESTS_SUBDIRS+= ssp .endif
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: macallan Date: Sun Jan 27 03:59:10 UTC 2013 Modified Files: src/sys/dev/wscons: wsdisplay_vconsvar.h Log Message: fix a typo in a comment To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/dev/wscons/wsdisplay_vconsvar.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/wscons/wsdisplay_vconsvar.h diff -u src/sys/dev/wscons/wsdisplay_vconsvar.h:1.21 src/sys/dev/wscons/wsdisplay_vconsvar.h:1.22 --- src/sys/dev/wscons/wsdisplay_vconsvar.h:1.21 Wed Jan 4 08:25:03 2012 +++ src/sys/dev/wscons/wsdisplay_vconsvar.h Sun Jan 27 03:59:09 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vconsvar.h,v 1.21 2012/01/04 08:25:03 macallan Exp $ */ +/* $NetBSD: wsdisplay_vconsvar.h,v 1.22 2013/01/27 03:59:09 macallan Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -59,7 +59,7 @@ struct vcons_screen { * for example, Sun's Creator boards can't accelerate copycols() */ #define VCONS_NO_COPYCOLS 0x10 /* use putchar() based copycols() */ -#define VCONS_NO_COPYROWS 0x20 /* use putchar() basec copyrows() */ +#define VCONS_NO_COPYROWS 0x20 /* use putchar() based copyrows() */ #define VCONS_DONT_READ 0x30 /* avoid framebuffer reads */ /* status flags used by vcons */ uint32_t scr_status;
CVS commit: src/usr.sbin/ldpd
Module Name:src Committed By: kefren Date: Sun Jan 27 05:53:21 UTC 2013 Modified Files: src/usr.sbin/ldpd: ldp_peer.c Log Message: re-enable peer authentication To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/ldpd/ldp_peer.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/ldpd/ldp_peer.c diff -u src/usr.sbin/ldpd/ldp_peer.c:1.5 src/usr.sbin/ldpd/ldp_peer.c:1.6 --- src/usr.sbin/ldpd/ldp_peer.c:1.5 Sat Jan 26 17:29:55 2013 +++ src/usr.sbin/ldpd/ldp_peer.c Sun Jan 27 05:53:21 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ldp_peer.c,v 1.5 2013/01/26 17:29:55 kefren Exp $ */ +/* $NetBSD: ldp_peer.c,v 1.6 2013/01/27 05:53:21 kefren Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -81,9 +81,8 @@ ldp_peer_new(const struct in_addr * ldp_ struct ldp_peer *p; int s = soc; struct sockaddr *connecting_sa = NULL; - /* disabled - see below struct conf_neighbour *cn; - */ + if (tradd != NULL) assert(tradd-sa_family == padd-sa_family); @@ -112,17 +111,16 @@ ldp_peer_new(const struct in_addr * ldp_ } /* MD5 authentication needed ? */ -/* XXX: disabled for now - need to make sure NetBSD handles TCPSIG correctly SLIST_FOREACH(cn, conei_head, neilist) - if (cn-authenticate != 0 (a-s_addr == cn-address.s_addr || - (tradd tradd-s_addr == cn-address.s_addr))) { + if (cn-authenticate != 0 + ldp_id-s_addr == cn-address.s_addr) { if (setsockopt(s, IPPROTO_TCP, TCP_MD5SIG, (int){1}, sizeof(int)) != 0) fatalp(setsockopt TCP_MD5SIG: %s\n, strerror(errno)); break; } -*/ + /* Set the peer in CONNECTING/CONNECTED state */ p = calloc(1, sizeof(*p));