CVS commit: src/lib/libc/string
Module Name:src Committed By: wiz Date: Sat May 2 09:31:01 UTC 2009 Modified Files: src/lib/libc/string: wmemchr.3 Log Message: Remove duplicate entry. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/lib/libc/string/wmemchr.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/string/wmemchr.3 diff -u src/lib/libc/string/wmemchr.3:1.13 src/lib/libc/string/wmemchr.3:1.14 --- src/lib/libc/string/wmemchr.3:1.13 Fri May 1 17:27:01 2009 +++ src/lib/libc/string/wmemchr.3 Sat May 2 09:31:01 2009 @@ -1,4 +1,4 @@ -.\ $NetBSD: wmemchr.3,v 1.13 2009/05/01 17:27:01 perry Exp $ +.\ $NetBSD: wmemchr.3,v 1.14 2009/05/02 09:31:01 wiz Exp $ .\ .\ Copyright (c) 1990, 1991, 1993 .\ The Regents of the University of California. All rights reserved. @@ -138,7 +138,6 @@ .Xr strlcat 3 , .Xr strlcpy 3 , .Xr strlen 3 , -.Xr strnlen 3 , .Xr strncat 3 , .Xr strncmp 3 , .Xr strncpy 3 ,
CVS commit: src/lib/libc/string
Module Name:src Committed By: wiz Date: Sat May 2 09:31:08 UTC 2009 Modified Files: src/lib/libc/string: strcpy.3 Log Message: Sort sections. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/lib/libc/string/strcpy.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/string/strcpy.3 diff -u src/lib/libc/string/strcpy.3:1.18 src/lib/libc/string/strcpy.3:1.19 --- src/lib/libc/string/strcpy.3:1.18 Fri May 1 17:27:01 2009 +++ src/lib/libc/string/strcpy.3 Sat May 2 09:31:08 2009 @@ -30,7 +30,7 @@ .\ SUCH DAMAGE. .\ .\ from: @(#)strcpy.3 8.1 (Berkeley) 6/4/93 -.\ $NetBSD: strcpy.3,v 1.18 2009/05/01 17:27:01 perry Exp $ +.\ $NetBSD: strcpy.3,v 1.19 2009/05/02 09:31:08 wiz Exp $ .\ .Dd May 1, 2009 .Dt STRCPY 3 @@ -184,14 +184,6 @@ .Xr strlcpy 3 is not defined in any standards, it should only be used when portability is not a concern. -.Sh SECURITY CONSIDERATIONS -The -.Fn strcpy -and -.Fn stpcpy -functions are easily misused in a manner which enables malicious users -to arbitrarily change a running program's functionality through a -buffer overflow attack. .Sh SEE ALSO .Xr bcopy 3 , .Xr memccpy 3 , @@ -220,3 +212,11 @@ .Fn stpncpy functions first appeared in .Nx 6.0 . +.Sh SECURITY CONSIDERATIONS +The +.Fn strcpy +and +.Fn stpcpy +functions are easily misused in a manner which enables malicious users +to arbitrarily change a running program's functionality through a +buffer overflow attack.
CVS commit: src/lib/libc/string
Module Name:src Committed By: wiz Date: Sat May 2 09:37:33 UTC 2009 Modified Files: src/lib/libc/string: strcpy.3 Log Message: Improve formatting and punctuation for NUL-terminate. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/lib/libc/string/strcpy.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/string/strcpy.3 diff -u src/lib/libc/string/strcpy.3:1.19 src/lib/libc/string/strcpy.3:1.20 --- src/lib/libc/string/strcpy.3:1.19 Sat May 2 09:31:08 2009 +++ src/lib/libc/string/strcpy.3 Sat May 2 09:37:32 2009 @@ -30,7 +30,7 @@ .\ SUCH DAMAGE. .\ .\ from: @(#)strcpy.3 8.1 (Berkeley) 6/4/93 -.\ $NetBSD: strcpy.3,v 1.19 2009/05/02 09:31:08 wiz Exp $ +.\ $NetBSD: strcpy.3,v 1.20 2009/05/02 09:37:32 wiz Exp $ .\ .Dd May 1, 2009 .Dt STRCPY 3 @@ -140,15 +140,13 @@ .Pp Note that it does .Em not -.Tn NUL -terminate +.Dv NUL Ns No -terminate .Va chararray because the length of the source string is greater than or equal to the length parameter. .Fn strncpy .Em only -.Tn NUL -terminates +.Dv NUL Ns No -terminates the destination string when the length of the source string is less than the length parameter. .Pp @@ -157,15 +155,15 @@ to .Va buf as will fit and -.Tn NUL -terminates the result. +.Dv NUL Ns No -terminates +the result. Because .Fn strncpy does .Em not guarantee to -.Tn NUL -terminate the string itself, this must be done explicitly. +.Dv NUL Ns No -terminate +the string itself, this must be done explicitly. .Bd -literal -offset indent char buf[1024];
CVS commit: src/crypto/external/bsd/netpgp/dist/src/lib
Module Name:src Committed By: wiz Date: Sat May 2 09:40:01 UTC 2009 Modified Files: src/crypto/external/bsd/netpgp/dist/src/lib: libnetpgp.3 Log Message: Bump date for netpgp_sign_file signature change. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3 diff -u src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3:1.4 src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3:1.5 --- src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3:1.4 Sat May 2 02:44:36 2009 +++ src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3 Sat May 2 09:40:01 2009 @@ -1,4 +1,4 @@ -.\ $NetBSD: libnetpgp.3,v 1.4 2009/05/02 02:44:36 agc Exp $ +.\ $NetBSD: libnetpgp.3,v 1.5 2009/05/02 09:40:01 wiz Exp $ .\ .\ Copyright (c) 2009 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -27,7 +27,7 @@ .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\ POSSIBILITY OF SUCH DAMAGE. .\ -.Dd January 30, 2009 +.Dd May 2, 2009 .Dt LIBNETPGP 3 .Os .Sh NAME
CVS commit: src/crypto/external/bsd/netpgp/dist/src/bin
Module Name:src Committed By: wiz Date: Sat May 2 09:40:33 UTC 2009 Modified Files: src/crypto/external/bsd/netpgp/dist/src/bin: netpgp.1 Log Message: Punctuation. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/crypto/external/bsd/netpgp/dist/src/bin/netpgp.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/external/bsd/netpgp/dist/src/bin/netpgp.1 diff -u src/crypto/external/bsd/netpgp/dist/src/bin/netpgp.1:1.5 src/crypto/external/bsd/netpgp/dist/src/bin/netpgp.1:1.6 --- src/crypto/external/bsd/netpgp/dist/src/bin/netpgp.1:1.5 Sat May 2 02:43:15 2009 +++ src/crypto/external/bsd/netpgp/dist/src/bin/netpgp.1 Sat May 2 09:40:33 2009 @@ -1,4 +1,4 @@ -.\ $NetBSD: netpgp.1,v 1.5 2009/05/02 02:43:15 agc Exp $ +.\ $NetBSD: netpgp.1,v 1.6 2009/05/02 09:40:33 wiz Exp $ .\ .\ Copyright (c) 2009 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -271,9 +271,9 @@ command first appeared in .Nx 6.0 . .Sh AUTHORS -.An Ben Laurie -.An Rachel Willmer +.An Ben Laurie , +.An Rachel Willmer , and overhauled and rewritten by -.An Alistair Crooks +.An Alistair Crooks . This manual page was also written by -.An Alistair Crooks +.An Alistair Crooks .
CVS commit: src/sys/rump/librump/rumpkern
Module Name:src Committed By: pooka Date: Sat May 2 14:16:52 UTC 2009 Modified Files: src/sys/rump/librump/rumpkern: Makefile.rumpkern misc_stub.c Log Message: Do not include securelevel, it includes too many dependencies on vfs in its current form. To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/rump/librump/rumpkern/Makefile.rumpkern cvs rdiff -u -r1.21 -r1.22 src/sys/rump/librump/rumpkern/misc_stub.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/rump/librump/rumpkern/Makefile.rumpkern diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.44 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.45 --- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.44 Wed Apr 29 17:51:47 2009 +++ src/sys/rump/librump/rumpkern/Makefile.rumpkern Sat May 2 14:16:52 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rumpkern,v 1.44 2009/04/29 17:51:47 pooka Exp $ +# $NetBSD: Makefile.rumpkern,v 1.45 2009/05/02 14:16:52 pooka Exp $ # .include ${RUMPTOP}/Makefile.rump @@ -9,7 +9,7 @@ ${RUMPTOP}/../kern \ ${RUMPTOP}/../conf \ ${RUMPTOP}/../dev \ - ${RUMPTOP}/../secmodel/bsd44 ${RUMPTOP}/../secmodel/securelevel + ${RUMPTOP}/../secmodel/bsd44 # # Source modules, first the ones specifically implemented for librump. @@ -40,8 +40,7 @@ subr_specificdata.c subr_time.c subr_workqueue.c # 4.4BSD secmodel. selection is hardcoded for now -SRCS+= secmodel_bsd44.c secmodel_bsd44_logic.c secmodel_bsd44_suser.c \ - secmodel_securelevel.c +SRCS+= secmodel_bsd44.c secmodel_bsd44_logic.c secmodel_bsd44_suser.c # the funny bit. this doesn't really belong here, but helps with the # needs of kern_descrip.c. And since it's a fully dynamic interface, Index: src/sys/rump/librump/rumpkern/misc_stub.c diff -u src/sys/rump/librump/rumpkern/misc_stub.c:1.21 src/sys/rump/librump/rumpkern/misc_stub.c:1.22 --- src/sys/rump/librump/rumpkern/misc_stub.c:1.21 Sun Mar 29 18:22:08 2009 +++ src/sys/rump/librump/rumpkern/misc_stub.c Sat May 2 14:16:52 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: misc_stub.c,v 1.21 2009/03/29 18:22:08 pooka Exp $ */ +/* $NetBSD: misc_stub.c,v 1.22 2009/05/02 14:16:52 pooka Exp $ */ /* * Copyright (c) 2007 Antti Kantee. All Rights Reserved. @@ -28,18 +28,21 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: misc_stub.c,v 1.21 2009/03/29 18:22:08 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: misc_stub.c,v 1.22 2009/05/02 14:16:52 pooka Exp $); #include sys/param.h #include sys/cpu.h #include sys/evcnt.h #include sys/event.h +#include sys/kauth.h #include sys/sched.h #include sys/sysctl.h #include sys/systm.h #include sys/syscallvar.h #include sys/xcall.h +#include secmodel/securelevel/securelevel.h + #ifdef __sparc__ /* * XXX Least common denominator - smallest sparc pagesize. @@ -109,3 +112,25 @@ { } + +/* + * XXX: bsd44 secmodel depends on securelevel + */ +int +secmodel_securelevel_sysctl(SYSCTLFN_ARGS) +{ + + return 0; +} + +void +secmodel_securelevel_init() +{ + +} + +void +secmodel_securelevel_start() +{ + +}
CVS commit: src
Module Name:src Committed By: pooka Date: Sat May 2 15:20:08 UTC 2009 Modified Files: src/lib/libukfs: ukfs.c src/sys/rump/include/rump: rump.h src/sys/rump/librump/rumpkern: rump.c Log Message: Since rump_module_load() doesn't actually load the module, change the name to rump_module_init(). Also, adjust the signature to take a direct pointer to modinfo and allow passing of props. Finally, provide rump_module_fini(). To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/lib/libukfs/ukfs.c cvs rdiff -u -r1.13 -r1.14 src/sys/rump/include/rump/rump.h cvs rdiff -u -r1.105 -r1.106 src/sys/rump/librump/rumpkern/rump.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libukfs/ukfs.c diff -u src/lib/libukfs/ukfs.c:1.25 src/lib/libukfs/ukfs.c:1.26 --- src/lib/libukfs/ukfs.c:1.25 Sat May 2 01:15:52 2009 +++ src/lib/libukfs/ukfs.c Sat May 2 15:20:08 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: ukfs.c,v 1.25 2009/05/02 01:15:52 pooka Exp $ */ +/* $NetBSD: ukfs.c,v 1.26 2009/05/02 15:20:08 pooka Exp $ */ /* * Copyright (c) 2007, 2008 Antti Kantee. All Rights Reserved. @@ -675,7 +675,8 @@ int ukfs_modload(const char *fname) { - void *handle, *thesym; + void *handle; + struct modinfo **mi; struct stat sb; int error; @@ -692,9 +693,9 @@ return -1; } - thesym = dlsym(handle, __start_link_set_modules); - if (thesym) { - error = rump_module_load(thesym); + mi = dlsym(handle, __start_link_set_modules); + if (mi) { + error = rump_module_init(*mi, NULL); if (error) goto errclose; return 1; Index: src/sys/rump/include/rump/rump.h diff -u src/sys/rump/include/rump/rump.h:1.13 src/sys/rump/include/rump/rump.h:1.14 --- src/sys/rump/include/rump/rump.h:1.13 Wed Apr 29 18:00:49 2009 +++ src/sys/rump/include/rump/rump.h Sat May 2 15:20:08 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rump.h,v 1.13 2009/04/29 18:00:49 pooka Exp $ */ +/* $NetBSD: rump.h,v 1.14 2009/05/02 15:20:08 pooka Exp $ */ /* * Copyright (c) 2007 Antti Kantee. All Rights Reserved. @@ -43,10 +43,17 @@ struct fid; struct statvfs; +/* yetch */ #if !defined(_RUMPKERNEL) !defined(__NetBSD__) struct kauth_cred; typedef struct kauth_cred *kauth_cred_t; #endif +#if defined(__NetBSD__) +#include prop/proplib.h +#else +struct prop_dictionary; +typedef struct prop_dictionary *prop_dictionary_t; +#endif /* __NetBSD__ */ struct lwp; struct modinfo; @@ -64,7 +71,8 @@ */ #define RUMP_VERSION 01 #define rump_init() rump__init(RUMP_VERSION) -int rump_module_load(struct modinfo **); +int rump_module_init(struct modinfo *, prop_dictionary_t props); +int rump_module_fini(struct modinfo *); int rump__init(int); struct mount *rump_mnt_init(struct vfsops *, int); Index: src/sys/rump/librump/rumpkern/rump.c diff -u src/sys/rump/librump/rumpkern/rump.c:1.105 src/sys/rump/librump/rumpkern/rump.c:1.106 --- src/sys/rump/librump/rumpkern/rump.c:1.105 Thu Apr 30 16:59:32 2009 +++ src/sys/rump/librump/rumpkern/rump.c Sat May 2 15:20:08 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rump.c,v 1.105 2009/04/30 16:59:32 pooka Exp $ */ +/* $NetBSD: rump.c,v 1.106 2009/05/02 15:20:08 pooka Exp $ */ /* * Copyright (c) 2007 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.105 2009/04/30 16:59:32 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.106 2009/05/02 15:20:08 pooka Exp $); #include sys/param.h #include sys/atomic.h @@ -482,13 +482,20 @@ } int -rump_module_load(struct modinfo **mi) +rump_module_init(struct modinfo *mi, prop_dictionary_t props) { - if (!module_compatible((*mi)-mi_version, __NetBSD_Version__)) + if (!module_compatible(mi-mi_version, __NetBSD_Version__)) return EPROGMISMATCH; - return (*mi)-mi_modcmd(MODULE_CMD_INIT, NULL); + return mi-mi_modcmd(MODULE_CMD_INIT, props); +} + +int +rump_module_fini(struct modinfo *mi) +{ + + return mi-mi_modcmd(MODULE_CMD_FINI, NULL); } int _syspuffs_stub(int, int *);
CVS commit: src
Module Name:src Committed By: pooka Date: Sat May 2 16:02:19 UTC 2009 Modified Files: src/etc/mtree: NetBSD.dist src/tests: Makefile Added Files: src/tests/rump: Atffile Makefile src/tests/rump/rumpkern: Atffile Makefile t_modcmd.c Log Message: add regression test for module init/fini in rump To generate a diff of this commit: cvs rdiff -u -r1.398 -r1.399 src/etc/mtree/NetBSD.dist cvs rdiff -u -r1.14 -r1.15 src/tests/Makefile cvs rdiff -u -r0 -r1.1 src/tests/rump/Atffile src/tests/rump/Makefile cvs rdiff -u -r0 -r1.1 src/tests/rump/rumpkern/Atffile \ src/tests/rump/rumpkern/Makefile src/tests/rump/rumpkern/t_modcmd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/mtree/NetBSD.dist diff -u src/etc/mtree/NetBSD.dist:1.398 src/etc/mtree/NetBSD.dist:1.399 --- src/etc/mtree/NetBSD.dist:1.398 Mon Apr 27 14:22:40 2009 +++ src/etc/mtree/NetBSD.dist Sat May 2 16:02:19 2009 @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.dist,v 1.398 2009/04/27 14:22:40 njoly Exp $ +# $NetBSD: NetBSD.dist,v 1.399 2009/05/02 16:02:19 pooka Exp $ # @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93 # Do not customize this file as it may be overwritten on upgrades. @@ -555,6 +555,8 @@ ./usr/libdata/debug/usr/tests/modules ./usr/libdata/debug/usr/tests/net ./usr/libdata/debug/usr/tests/net/sys +./usr/libdata/debug/usr/tests/rump +./usr/libdata/debug/usr/tests/rump/rumpkern ./usr/libdata/debug/usr/tests/syscall ./usr/libdata/debug/usr/tests/util ./usr/libdata/debug/usr/tests/util/df @@ -1425,6 +1427,8 @@ ./usr/tests/modules ./usr/tests/net ./usr/tests/net/sys +./usr/tests/rump +./usr/tests/rump/rumpkern ./usr/tests/syscall ./usr/tests/util ./usr/tests/util/awk Index: src/tests/Makefile diff -u src/tests/Makefile:1.14 src/tests/Makefile:1.15 --- src/tests/Makefile:1.14 Fri Feb 20 21:39:57 2009 +++ src/tests/Makefile Sat May 2 16:02:18 2009 @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.14 2009/02/20 21:39:57 jmmv Exp $ +# $NetBSD: Makefile,v 1.15 2009/05/02 16:02:18 pooka Exp $ .include bsd.own.mk -SUBDIR= crypto fs games ipf kernel net util syscall +SUBDIR= crypto fs games ipf kernel net rump syscall util .if ${MACHINE} != evbppc SUBDIR+= modules Added files: Index: src/tests/rump/Atffile diff -u /dev/null src/tests/rump/Atffile:1.1 --- /dev/null Sat May 2 16:02:19 2009 +++ src/tests/rump/Atffile Sat May 2 16:02:19 2009 @@ -0,0 +1,6 @@ +Content-Type: application/X-atf-atffile; version=1 +X-NetBSD-Id: $NetBSD: Atffile,v 1.1 2009/05/02 16:02:19 pooka Exp $ + +prop: test-suite = NetBSD + +tp-glob: * Index: src/tests/rump/Makefile diff -u /dev/null src/tests/rump/Makefile:1.1 --- /dev/null Sat May 2 16:02:19 2009 +++ src/tests/rump/Makefile Sat May 2 16:02:19 2009 @@ -0,0 +1,11 @@ +# $NetBSD: Makefile,v 1.1 2009/05/02 16:02:19 pooka Exp $ +# + +.include bsd.own.mk + +TESTSDIR= ${TESTSBASE}/rump + +SUBDIR= rumpkern + +.include bsd.test.mk +.include bsd.subdir.mk Index: src/tests/rump/rumpkern/Atffile diff -u /dev/null src/tests/rump/rumpkern/Atffile:1.1 --- /dev/null Sat May 2 16:02:19 2009 +++ src/tests/rump/rumpkern/Atffile Sat May 2 16:02:19 2009 @@ -0,0 +1,6 @@ +Content-Type: application/X-atf-atffile; version=1 +X-NetBSD-Id: $NetBSD: Atffile,v 1.1 2009/05/02 16:02:19 pooka Exp $ + +prop: test-suite = NetBSD + +tp-glob: t_* Index: src/tests/rump/rumpkern/Makefile diff -u /dev/null src/tests/rump/rumpkern/Makefile:1.1 --- /dev/null Sat May 2 16:02:19 2009 +++ src/tests/rump/rumpkern/Makefile Sat May 2 16:02:19 2009 @@ -0,0 +1,11 @@ +# $NetBSD: Makefile,v 1.1 2009/05/02 16:02:19 pooka Exp $ + +.include bsd.own.mk + +TESTSDIR= ${TESTSBASE}/rump/rumpkern + +TESTS_C= t_modcmd + +LDADD+= -lrumpvfs -lrump -lrumpuser -lpthread + +.include bsd.test.mk Index: src/tests/rump/rumpkern/t_modcmd.c diff -u /dev/null src/tests/rump/rumpkern/t_modcmd.c:1.1 --- /dev/null Sat May 2 16:02:19 2009 +++ src/tests/rump/rumpkern/t_modcmd.c Sat May 2 16:02:19 2009 @@ -0,0 +1,109 @@ +/* $NetBSD: t_modcmd.c,v 1.1 2009/05/02 16:02:19 pooka Exp $ */ + +/* + * Copyright (c) 2009 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND + * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: christos Date: Sat May 2 16:10:49 UTC 2009 Modified Files: src/usr.bin/xlint/lint1: cgram.y err.c externs1.h scan.l tree.c Log Message: Add __alignof__. To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/usr.bin/xlint/lint1/cgram.y \ src/usr.bin/xlint/lint1/scan.l cvs rdiff -u -r1.41 -r1.42 src/usr.bin/xlint/lint1/err.c cvs rdiff -u -r1.26 -r1.27 src/usr.bin/xlint/lint1/externs1.h cvs rdiff -u -r1.58 -r1.59 src/usr.bin/xlint/lint1/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/cgram.y diff -u src/usr.bin/xlint/lint1/cgram.y:1.43 src/usr.bin/xlint/lint1/cgram.y:1.44 --- src/usr.bin/xlint/lint1/cgram.y:1.43 Fri May 1 18:03:36 2009 +++ src/usr.bin/xlint/lint1/cgram.y Sat May 2 12:10:49 2009 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.43 2009/05/01 22:03:36 christos Exp $ */ +/* $NetBSD: cgram.y,v 1.44 2009/05/02 16:10:49 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -35,7 +35,7 @@ #include sys/cdefs.h #if defined(__RCSID) !defined(lint) -__RCSID($NetBSD: cgram.y,v 1.43 2009/05/01 22:03:36 christos Exp $); +__RCSID($NetBSD: cgram.y,v 1.44 2009/05/02 16:10:49 christos Exp $); #endif #include stdlib.h @@ -130,6 +130,7 @@ %token y_op T_UNOP %token y_op T_INCDEC %token T_SIZEOF +%token T_ALIGNOF %token y_op T_MULT %token y_op T_DIVOP %token y_op T_ADDOP @@ -195,7 +196,7 @@ %left T_SHFTOP %left T_ADDOP %left T_MULT T_DIVOP -%right T_UNOP T_INCDEC T_SIZEOF T_REAL T_IMAG +%right T_UNOP T_INCDEC T_SIZEOF T_ALIGNOF T_REAL T_IMAG %left T_LPARN T_LBRACK T_STROP %token y_sb T_NAME @@ -1694,6 +1695,9 @@ | T_SIZEOF T_LPARN type_name T_RPARN %prec T_SIZEOF { $$ = bldszof($3); } + | T_ALIGNOF T_LPARN type_name T_RPARN %prec T_ALIGNOF { + $$ = bldalof($3); + } | T_LPARN type_name T_RPARN term %prec T_UNOP { $$ = cast($4, $2); } Index: src/usr.bin/xlint/lint1/scan.l diff -u src/usr.bin/xlint/lint1/scan.l:1.43 src/usr.bin/xlint/lint1/scan.l:1.44 --- src/usr.bin/xlint/lint1/scan.l:1.43 Tue Apr 14 21:20:57 2009 +++ src/usr.bin/xlint/lint1/scan.l Sat May 2 12:10:49 2009 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: scan.l,v 1.43 2009/04/15 01:20:57 christos Exp $ */ +/* $NetBSD: scan.l,v 1.44 2009/05/02 16:10:49 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -35,7 +35,7 @@ #include sys/cdefs.h #if defined(__RCSID) !defined(lint) -__RCSID($NetBSD: scan.l,v 1.43 2009/04/15 01:20:57 christos Exp $); +__RCSID($NetBSD: scan.l,v 1.44 2009/05/02 16:10:49 christos Exp $); #endif #include stdlib.h @@ -193,6 +193,7 @@ u_int kw_c99; /* c99 keyword */ u_int kw_gcc; /* GCC keyword */ } kwtab[] = { + { __alignof__,T_ALIGNOF, 0, 0, 0, 0, 0, 0 }, { asm, T_ASM, 0, 0, 0, 0, 0, 1 }, { __asm, T_ASM, 0, 0, 0, 0, 0, 0 }, { __asm__, T_ASM, 0, 0, 0, 0, 0, 0 }, Index: src/usr.bin/xlint/lint1/err.c diff -u src/usr.bin/xlint/lint1/err.c:1.41 src/usr.bin/xlint/lint1/err.c:1.42 --- src/usr.bin/xlint/lint1/err.c:1.41 Fri May 1 18:03:36 2009 +++ src/usr.bin/xlint/lint1/err.c Sat May 2 12:10:49 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: err.c,v 1.41 2009/05/01 22:03:36 christos Exp $ */ +/* $NetBSD: err.c,v 1.42 2009/05/02 16:10:49 christos Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include sys/cdefs.h #if defined(__RCSID) !defined(lint) -__RCSID($NetBSD: err.c,v 1.41 2009/05/01 22:03:36 christos Exp $); +__RCSID($NetBSD: err.c,v 1.42 2009/05/02 16:10:49 christos Exp $); #endif #include sys/types.h @@ -202,10 +202,10 @@ modulus by 0, /* 140 */ integer overflow detected, op %s, /* 141 */ floating point overflow detected, op %s, /* 142 */ - cannot take size of incomplete type, /* 143 */ - cannot take size of function, /* 144 */ - cannot take size of bit-field, /* 145 */ - cannot take size of void, /* 146 */ + cannot take size/alignment of incomplete type, /* 143 */ + cannot take size/alignment of function, /* 144 */ + cannot take size/alignment of bit-field, /* 145 */ + cannot take size/alignment of void, /* 146 */ invalid cast expression, /* 147 */ improper cast of void expression, /* 148 */ illegal function, /* 149 */ Index: src/usr.bin/xlint/lint1/externs1.h diff -u src/usr.bin/xlint/lint1/externs1.h:1.26 src/usr.bin/xlint/lint1/externs1.h:1.27 --- src/usr.bin/xlint/lint1/externs1.h:1.26 Tue Apr 14 21:20:57 2009 +++ src/usr.bin/xlint/lint1/externs1.h Sat May 2 12:10:49 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: externs1.h,v 1.26 2009/04/15 01:20:57 christos Exp $ */ +/* $NetBSD: externs1.h,v 1.27 2009/05/02 16:10:49 christos Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -200,6 +200,7 @@ extern tnode_t *convert(op_t, int,
CVS commit: src/regress/usr.bin/xlint/lint1
Module Name:src Committed By: christos Date: Sat May 2 16:12:12 UTC 2009 Added Files: src/regress/usr.bin/xlint/lint1: test25.c Log Message: Add __alignof__ test To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/regress/usr.bin/xlint/lint1/test25.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/regress/usr.bin/xlint/lint1/test25.c diff -u /dev/null src/regress/usr.bin/xlint/lint1/test25.c:1.1 --- /dev/null Sat May 2 12:12:12 2009 +++ src/regress/usr.bin/xlint/lint1/test25.c Sat May 2 12:12:12 2009 @@ -0,0 +1,6 @@ +/* __alignof__ */ +int +main(void) +{ + return __alignof__(short); +}
CVS commit: src/tests/rump/rumpkern
Module Name:src Committed By: pooka Date: Sat May 2 16:18:13 UTC 2009 Modified Files: src/tests/rump/rumpkern: t_modcmd.c Log Message: don't hardcode /usr/lib path To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/rump/rumpkern/t_modcmd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/rump/rumpkern/t_modcmd.c diff -u src/tests/rump/rumpkern/t_modcmd.c:1.1 src/tests/rump/rumpkern/t_modcmd.c:1.2 --- src/tests/rump/rumpkern/t_modcmd.c:1.1 Sat May 2 16:02:19 2009 +++ src/tests/rump/rumpkern/t_modcmd.c Sat May 2 16:18:13 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: t_modcmd.c,v 1.1 2009/05/02 16:02:19 pooka Exp $ */ +/* $NetBSD: t_modcmd.c,v 1.2 2009/05/02 16:18:13 pooka Exp $ */ /* * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ a module (vfs/tmpfs) is possible); } -#define TMPFSMODULE /usr/lib/librumpfs_tmpfs.so +#define TMPFSMODULE librumpfs_tmpfs.so ATF_TC_BODY(cmsg_modcmd, tc) { struct tmpfs_args args;
CVS commit: src/usr.sbin/paxctl
Module Name:src Committed By: christos Date: Sat May 2 16:19:36 UTC 2009 Modified Files: src/usr.sbin/paxctl: paxctl.c Log Message: easier done with a goto instead of closing in each error. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/paxctl/paxctl.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/paxctl/paxctl.c diff -u src/usr.sbin/paxctl/paxctl.c:1.10 src/usr.sbin/paxctl/paxctl.c:1.11 --- src/usr.sbin/paxctl/paxctl.c:1.10 Sat May 2 02:01:30 2009 +++ src/usr.sbin/paxctl/paxctl.c Sat May 2 12:19:36 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: paxctl.c,v 1.10 2009/05/02 06:01:30 elad Exp $ */ +/* $NetBSD: paxctl.c,v 1.11 2009/05/02 16:19:36 christos Exp $ */ /*- * Copyright (c) 2006 Elad Efrat e...@netbsd.org @@ -34,7 +34,7 @@ #include sys/cdefs.h #ifndef lint #ifdef __RCSID -__RCSID($NetBSD: paxctl.c,v 1.10 2009/05/02 06:01:30 elad Exp $); +__RCSID($NetBSD: paxctl.c,v 1.11 2009/05/02 16:19:36 christos Exp $); #endif #endif /* not lint */ @@ -193,25 +193,23 @@ char name[ELF_NOTE_PAX_NAMESZ]; uint32_t flags; } pax_tag; - int fd, size, ok = 0, flagged = 0, swap; + int fd, size, ok = 0, flagged = 0, swap, error = 1; size_t i; fd = open(name, list ? O_RDONLY: O_RDWR, 0); if (fd == -1) { warn(Can't open `%s', name); - return 1; + return error; } if (read(fd, e, sizeof(e)) != sizeof(e)) { warn(Can't read ELF header from `%s', name); - (void)close(fd); - return 1; + goto out; } if (memcmp(e.h32.e_ident, ELFMAG, SELFMAG) != 0) { warnx(Bad ELF magic from `%s' (maybe it's not an ELF?), name); - (void)close(fd); - return 1; + goto out; } if (e.h32.e_ehsize == sizeof(e.h32)) { @@ -229,16 +227,14 @@ } else { warnx(Bad ELF size %d from `%s' (maybe it's not an ELF?), (int)e.h32.e_ehsize, name); - (void)close(fd); - return 1; + goto out; } for (i = 0; i EH(e_phnum); i++) { - if ((size_t)pread(fd, p, PHSIZE, (off_t)EH(e_phoff) + i * PHSIZE) != - PHSIZE) { + if ((size_t)pread(fd, p, PHSIZE, + (off_t)EH(e_phoff) + i * PHSIZE) != PHSIZE) { warn(Can't read program header data from `%s', name); - (void)close(fd); - return 1; + goto out; } if (PH(p_type) != PT_NOTE) @@ -246,8 +242,7 @@ if (pread(fd, n, NHSIZE, (off_t)PH(p_offset)) != NHSIZE) { warn(Can't read note header from `%s', name); - (void)close(fd); - return 1; + goto out; } if (NH(n_type) != ELF_NOTE_TYPE_PAX_TAG || NH(n_descsz) != ELF_NOTE_PAX_DESCSZ || @@ -256,16 +251,14 @@ if (pread(fd, pax_tag, sizeof(pax_tag), PH(p_offset) + NHSIZE) != sizeof(pax_tag)) { warn(Can't read pax_tag from `%s', name); - (void)close(fd); - return 1; + goto out; } if (memcmp(pax_tag.name, ELF_NOTE_PAX_NAME, sizeof(pax_tag.name)) != 0) { warn(Unknown pax_tag name `%*.*s' from `%s', ELF_NOTE_PAX_NAMESZ, ELF_NOTE_PAX_NAMESZ, pax_tag.name, name); - (void)close(fd); - return 1; + goto out; } ok = 1; @@ -282,9 +275,7 @@ (void)printf(PaX flags:\n); pax_printflags(name, many, SWAP(pax_tag.flags)); - flagged = 1; - break; } @@ -294,8 +285,7 @@ if (!pax_flags_sane(SWAP(pax_tag.flags))) { warnx(New flags 0x%x don't make sense, (uint32_t)SWAP(pax_tag.flags)); - (void)close(fd); - return 1; + goto out; } if (pwrite(fd, pax_tag, sizeof(pax_tag), @@ -304,20 +294,21 @@ break; } - (void)close(fd); - if (!ok) { warnx(Could not find an ELF PaX PT_NOTE section in `%s', name); - return 1; + goto out; } + error = 0; if (list !flagged) { if (many) (void)printf(%s: , name); (void)printf(No PaX flags.\n); } - return 0; +out: + (void)close(fd); + return error; } int
CVS commit: src/sys/arch/xen/xen
Module Name:src Committed By: bouyer Date: Sat May 2 18:18:44 UTC 2009 Modified Files: src/sys/arch/xen/xen: if_xennet_xenbus.c Log Message: Patch from Brian Marcotte on port-xen@: write a feature-rx-notify to the xenstore, which is used by recent linux dom0 kernels. This reduce packet loss when using a NetBSD domU on such linux dom0. This entry is ignored by NetBSD and older linux domUs. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/arch/xen/xen/if_xennet_xenbus.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/xen/xen/if_xennet_xenbus.c diff -u src/sys/arch/xen/xen/if_xennet_xenbus.c:1.35 src/sys/arch/xen/xen/if_xennet_xenbus.c:1.36 --- src/sys/arch/xen/xen/if_xennet_xenbus.c:1.35 Wed Apr 29 22:21:49 2009 +++ src/sys/arch/xen/xen/if_xennet_xenbus.c Sat May 2 18:18:44 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: if_xennet_xenbus.c,v 1.35 2009/04/29 22:21:49 jym Exp $ */ +/* $NetBSD: if_xennet_xenbus.c,v 1.36 2009/05/02 18:18:44 bouyer Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -95,7 +95,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: if_xennet_xenbus.c,v 1.35 2009/04/29 22:21:49 jym Exp $); +__KERNEL_RCSID(0, $NetBSD: if_xennet_xenbus.c,v 1.36 2009/05/02 18:18:44 bouyer Exp $); #include opt_xen.h #include opt_nfs_boot.h @@ -502,6 +502,12 @@ goto abort_transaction; } error = xenbus_printf(xbt, sc-sc_xbusd-xbusd_path, + feature-rx-notify, %u, 1); + if (error) { + errmsg = writing feature-rx-notify; + goto abort_transaction; + } + error = xenbus_printf(xbt, sc-sc_xbusd-xbusd_path, event-channel, %u, sc-sc_evtchn); if (error) { errmsg = writing event channel;
CVS commit: src/usr.bin/ktruss
Module Name:src Committed By: christos Date: Sat May 2 18:26:53 UTC 2009 Modified Files: src/usr.bin/ktruss: dump.c Log Message: PR/41338: Michael van Elst: ktruss mixes filename arguments Restore call to dumppendq. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/usr.bin/ktruss/dump.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/ktruss/dump.c diff -u src/usr.bin/ktruss/dump.c:1.33 src/usr.bin/ktruss/dump.c:1.34 --- src/usr.bin/ktruss/dump.c:1.33 Sun Apr 12 07:24:18 2009 +++ src/usr.bin/ktruss/dump.c Sat May 2 14:26:53 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: dump.c,v 1.33 2009/04/12 11:24:18 lukem Exp $ */ +/* $NetBSD: dump.c,v 1.34 2009/05/02 18:26:53 christos Exp $ */ /*- * Copyright (c) 1988, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = @(#)kdump.c 8.4 (Berkeley) 4/28/95; #endif -__RCSID($NetBSD: dump.c,v 1.33 2009/04/12 11:24:18 lukem Exp $); +__RCSID($NetBSD: dump.c,v 1.34 2009/05/02 18:26:53 christos Exp $); #endif /* not lint */ #include sys/param.h @@ -676,9 +676,7 @@ free(genio); } -#if 0 /* Why? */ flushpendq(kte); -#endif free(kte); }
CVS commit: src/usr.sbin/btpand
Module Name:src Committed By: plunky Date: Sat May 2 20:13:44 UTC 2009 Modified Files: src/usr.sbin/btpand: bnep.c Log Message: add a noisy debug message for overlong packets (I do get them from my phone) To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/btpand/bnep.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/btpand/bnep.c diff -u src/usr.sbin/btpand/bnep.c:1.4 src/usr.sbin/btpand/bnep.c:1.5 --- src/usr.sbin/btpand/bnep.c:1.4 Sat May 2 20:07:51 2009 +++ src/usr.sbin/btpand/bnep.c Sat May 2 20:13:44 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: bnep.c,v 1.4 2009/05/02 20:07:51 plunky Exp $ */ +/* $NetBSD: bnep.c,v 1.5 2009/05/02 20:13:44 plunky Exp $ */ /*- * Copyright (c) 2008 Iain Hibbert @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: bnep.c,v 1.4 2009/05/02 20:07:51 plunky Exp $); +__RCSID($NetBSD: bnep.c,v 1.5 2009/05/02 20:13:44 plunky Exp $); #include bluetooth.h #include sdp.h @@ -168,6 +168,11 @@ || pkt-chan-state != CHANNEL_OPEN) return false; /* no forwarding */ + if (pkt-len ETHER_MAX_LEN) + log_debug(received long packet + (type=0x%2.2x, proto=0x%4.4x, len=%d), + type, be16dec(pkt-type), pkt-len); + return true; }
CVS commit: src/usr.bin/ktruss
Module Name:src Committed By: mlelstv Date: Sat May 2 21:01:01 UTC 2009 Modified Files: src/usr.bin/ktruss: dump.c Log Message: make flushpendq drop only entries for the current thread. To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/usr.bin/ktruss/dump.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/ktruss/dump.c diff -u src/usr.bin/ktruss/dump.c:1.34 src/usr.bin/ktruss/dump.c:1.35 --- src/usr.bin/ktruss/dump.c:1.34 Sat May 2 18:26:53 2009 +++ src/usr.bin/ktruss/dump.c Sat May 2 21:01:01 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: dump.c,v 1.34 2009/05/02 18:26:53 christos Exp $ */ +/* $NetBSD: dump.c,v 1.35 2009/05/02 21:01:01 mlelstv Exp $ */ /*- * Copyright (c) 1988, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = @(#)kdump.c 8.4 (Berkeley) 4/28/95; #endif -__RCSID($NetBSD: dump.c,v 1.34 2009/05/02 18:26:53 christos Exp $); +__RCSID($NetBSD: dump.c,v 1.35 2009/05/02 21:01:01 mlelstv Exp $); #endif /* not lint */ #include sys/param.h @@ -216,11 +216,11 @@ flushpendq(struct ktr_entry *us) { struct ktr_entry *kte, *kte_next; - int pid = KTE_PID(us); + int pid = KTE_PID(us), lid = KTE_LID(us); for (kte = TAILQ_FIRST(ktependq); kte != NULL; kte = kte_next) { kte_next = TAILQ_NEXT(kte, kte_list); - if (KTE_PID(kte) == pid) { + if (KTE_PID(kte) == pid || KTE_LID(kte) == lid) { TAILQ_REMOVE(ktependq, kte, kte_list); free(kte); }
CVS commit: src/sys/kern
Module Name:src Committed By: elad Date: Sat May 2 21:47:12 UTC 2009 Modified Files: src/sys/kern: kern_verifiedexec.c Log Message: Fix locking around mountlist usage, as pointed out by ad@ in: http://mail-index.netbsd.org/source-changes-d/2009/04/22/msg000322.html http://mail-index.netbsd.org/tech-kern/2009/04/22/msg004897.html Use vfs_busy() and vfs_unbusy(), and properly iterate the mountlist. To generate a diff of this commit: cvs rdiff -u -r1.113 -r1.114 src/sys/kern/kern_verifiedexec.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_verifiedexec.c diff -u src/sys/kern/kern_verifiedexec.c:1.113 src/sys/kern/kern_verifiedexec.c:1.114 --- src/sys/kern/kern_verifiedexec.c:1.113 Mon Apr 20 22:09:54 2009 +++ src/sys/kern/kern_verifiedexec.c Sat May 2 21:47:12 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_verifiedexec.c,v 1.113 2009/04/20 22:09:54 elad Exp $ */ +/* $NetBSD: kern_verifiedexec.c,v 1.114 2009/05/02 21:47:12 elad Exp $ */ /*- * Copyright (c) 2005, 2006 Elad Efrat e...@netbsd.org @@ -29,7 +29,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kern_verifiedexec.c,v 1.113 2009/04/20 22:09:54 elad Exp $); +__KERNEL_RCSID(0, $NetBSD: kern_verifiedexec.c,v 1.114 2009/05/02 21:47:12 elad Exp $); #include opt_veriexec.h @@ -1535,12 +1535,19 @@ int veriexec_dump(struct lwp *l, prop_array_t rarray) { - struct mount *mp; + struct mount *mp, *nmp; mutex_enter(mountlist_lock); - CIRCLEQ_FOREACH(mp, mountlist, mnt_list) { + for (mp = CIRCLEQ_FIRST(mountlist); mp != (void *)mountlist; + mp = nmp) { + /* If it fails, the file-system is [being] unmounted. */ + if (vfs_busy(mp, nmp) != 0) + continue; + fileassoc_table_run(mp, veriexec_hook, (fileassoc_cb_t)veriexec_file_dump, rarray); + + vfs_unbusy(mp, false, nmp); } mutex_exit(mountlist_lock); @@ -1550,16 +1557,23 @@ int veriexec_flush(struct lwp *l) { - struct mount *mp; + struct mount *mp, *nmp; int error = 0; mutex_enter(mountlist_lock); - CIRCLEQ_FOREACH(mp, mountlist, mnt_list) { + for (mp = CIRCLEQ_FIRST(mountlist); mp != (void *)mountlist; + mp = nmp) { int lerror; + /* If it fails, the file-system is [being] unmounted. */ + if (vfs_busy(mp, nmp) != 0) + continue; + lerror = veriexec_table_delete(l, mp); if (lerror lerror != ENOENT) error = lerror; + + vfs_unbusy(mp, false, nmp); } mutex_exit(mountlist_lock);
CVS commit: src/sys/dev/usb
Module Name:src Committed By: martin Date: Sat May 2 22:09:39 UTC 2009 Modified Files: src/sys/dev/usb: uhci.c Log Message: If we are unlucky, during detach of child devices, after a uhub has detached, our uhci_poll_hub callout might strike. The detaching of the uhub has left the device member in the pipe NULL, so make sure we do not dereference it. We could halt the callout before detaching child devices, but it this would likely interfere with proper servicing the child devices while they are still around. To generate a diff of this commit: cvs rdiff -u -r1.226 -r1.227 src/sys/dev/usb/uhci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/uhci.c diff -u src/sys/dev/usb/uhci.c:1.226 src/sys/dev/usb/uhci.c:1.227 --- src/sys/dev/usb/uhci.c:1.226 Sun Apr 19 12:32:52 2009 +++ src/sys/dev/usb/uhci.c Sat May 2 22:09:39 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: uhci.c,v 1.226 2009/04/19 12:32:52 ad Exp $ */ +/* $NetBSD: uhci.c,v 1.227 2009/05/02 22:09:39 martin Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */ /* @@ -42,7 +42,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uhci.c,v 1.226 2009/04/19 12:32:52 ad Exp $); +__KERNEL_RCSID(0, $NetBSD: uhci.c,v 1.227 2009/05/02 22:09:39 martin Exp $); #include sys/param.h #include sys/systm.h @@ -1034,12 +1034,14 @@ { usbd_xfer_handle xfer = addr; usbd_pipe_handle pipe = xfer-pipe; - uhci_softc_t *sc = pipe-device-bus-hci_private; + uhci_softc_t *sc; int s; u_char *p; DPRINTFN(20, (uhci_poll_hub\n)); + if (pipe-device == NULL) return; /* device has detached */ + sc = pipe-device-bus-hci_private; usb_callout(sc-sc_poll_handle, sc-sc_ival, uhci_poll_hub, xfer); p = KERNADDR(xfer-dmabuf, 0);