CVS commit: src/lib/libc/citrus
Module Name:src Committed By: tnozaki Date: Sun Nov 20 07:43:53 UTC 2011 Modified Files: src/lib/libc/citrus: citrus_csmapper.c Log Message: add comment about r1.6 -> r1.7 change. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/lib/libc/citrus/citrus_csmapper.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/citrus_csmapper.c diff -u src/lib/libc/citrus/citrus_csmapper.c:1.10 src/lib/libc/citrus/citrus_csmapper.c:1.11 --- src/lib/libc/citrus/citrus_csmapper.c:1.10 Sun Jan 11 02:46:24 2009 +++ src/lib/libc/citrus/citrus_csmapper.c Sun Nov 20 07:43:52 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_csmapper.c,v 1.10 2009/01/11 02:46:24 christos Exp $ */ +/* $NetBSD: citrus_csmapper.c,v 1.11 2011/11/20 07:43:52 tnozaki Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -28,7 +28,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_csmapper.c,v 1.10 2009/01/11 02:46:24 christos Exp $"); +__RCSID("$NetBSD: citrus_csmapper.c,v 1.11 2011/11/20 07:43:52 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -142,6 +142,7 @@ find_best_pivot_pvdb(const char *src, co if (ret) goto quit3; if (_db_lookup_by_s(db3, dst, &r2, NULL) != 0) + /* don't break the loop, test all src/dst pairs. */ goto quit4; /* r2: norm among pivot and dst */ ret = get32(&r2, &val32);
CVS commit: [jmcneill-audiomp3] src/sys/dev/ofisa
Module Name:src Committed By: mrg Date: Sun Nov 20 05:35:20 UTC 2011 Modified Files: src/sys/dev/ofisa [jmcneill-audiomp3]: joy_ofisa.c Log Message: make this compile again. i think it is even right. To generate a diff of this commit: cvs rdiff -u -r1.14.36.1 -r1.14.36.2 src/sys/dev/ofisa/joy_ofisa.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/ofisa/joy_ofisa.c diff -u src/sys/dev/ofisa/joy_ofisa.c:1.14.36.1 src/sys/dev/ofisa/joy_ofisa.c:1.14.36.2 --- src/sys/dev/ofisa/joy_ofisa.c:1.14.36.1 Sat Nov 19 21:49:40 2011 +++ src/sys/dev/ofisa/joy_ofisa.c Sun Nov 20 05:35:20 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: joy_ofisa.c,v 1.14.36.1 2011/11/19 21:49:40 jmcneill Exp $ */ +/* $NetBSD: joy_ofisa.c,v 1.14.36.2 2011/11/20 05:35:20 mrg Exp $ */ /*- * Copyright (c) 1996, 1998, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: joy_ofisa.c,v 1.14.36.1 2011/11/19 21:49:40 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: joy_ofisa.c,v 1.14.36.2 2011/11/20 05:35:20 mrg Exp $"); #include #include @@ -76,8 +76,8 @@ joy_ofisa_match(device_t parent, cfdata_ static void joy_ofisa_attach(device_t parent, device_t self, void *aux) { - struct joy_softc *sc = device_private(self); - struct joy_ofisa_softc *sc = device_private(self); + struct joy_ofisa_softc *osc = device_private(self); + struct joy_softc *sc = &osc->sc_joy; struct ofisa_attach_args *aa = aux; struct ofisa_reg_desc reg; char *model = NULL;
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: jakllsch Date: Sun Nov 20 04:18:57 UTC 2011 Modified Files: src/sys/arch/evbarm/conf: MPCSA_GENERIC Log Message: Recent changes to the at91 code enable this kernel config to build after the hypothetical ds1672rtc(4) is commented out and symtab space is bumped. Fixes PR#43834. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbarm/conf/MPCSA_GENERIC Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/conf/MPCSA_GENERIC diff -u src/sys/arch/evbarm/conf/MPCSA_GENERIC:1.22 src/sys/arch/evbarm/conf/MPCSA_GENERIC:1.23 --- src/sys/arch/evbarm/conf/MPCSA_GENERIC:1.22 Sat Jul 23 21:12:57 2011 +++ src/sys/arch/evbarm/conf/MPCSA_GENERIC Sun Nov 20 04:18:57 2011 @@ -1,4 +1,4 @@ -# $NetBSD: MPCSA_GENERIC,v 1.22 2011/07/23 21:12:57 jakllsch Exp $ +# $NetBSD: MPCSA_GENERIC,v 1.23 2011/11/20 04:18:57 jakllsch Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/evbarm/conf/std.mpcsa" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.22 $" +#ident "GENERIC-$Revision: 1.23 $" maxusers 32 # estimated number of users @@ -93,7 +93,7 @@ options DDB_HISTORY_SIZE=512 # enable h #options KGDB # remote debugger #options KGDB_DEVNAME="\"com\"",KGDB_DEVADDR=0x3f8,KGDB_DEVRATE=9600 makeoptions DEBUG="-Os -g" # compile full symbol table -options SYMTAB_SPACE=45 +options SYMTAB_SPACE="(1024 * 606)" #options SYSCALL_STATS # per syscall counts #options SYSCALL_TIMES # per syscall times #options SYSCALL_TIMES_HASCOUNTER # use 'broken' rdtsc (soekris) @@ -311,7 +311,7 @@ gpio* at mpcsa_leds? # On-chip I2C at91twi0 at at91bus0 addr 0xfffb8000 size 0x4000 pid 12 iic0 at at91twi? -ds1672rtc* at iic0 addr 0x68 +#ds1672rtc* at iic0 addr 0x68 seeprom* at iic0 addr 0x50 size 4096 # Console Devices
CVS commit: src/sys/arch/zaurus/zaurus
Module Name:src Committed By: nonaka Date: Sun Nov 20 04:07:50 UTC 2011 Modified Files: src/sys/arch/zaurus/zaurus: kloader_machdep.c Log Message: compile again. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/zaurus/zaurus/kloader_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/zaurus/zaurus/kloader_machdep.c diff -u src/sys/arch/zaurus/zaurus/kloader_machdep.c:1.3 src/sys/arch/zaurus/zaurus/kloader_machdep.c:1.4 --- src/sys/arch/zaurus/zaurus/kloader_machdep.c:1.3 Sun Mar 15 02:23:52 2009 +++ src/sys/arch/zaurus/zaurus/kloader_machdep.c Sun Nov 20 04:07:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: kloader_machdep.c,v 1.3 2009/03/15 02:23:52 nonaka Exp $ */ +/* $NetBSD: kloader_machdep.c,v 1.4 2011/11/20 04:07:50 nonaka Exp $ */ /*- * Copyright (c) 2009 NONAKA Kimihiro @@ -27,12 +27,13 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kloader_machdep.c,v 1.3 2009/03/15 02:23:52 nonaka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kloader_machdep.c,v 1.4 2011/11/20 04:07:50 nonaka Exp $"); #include "debug_kloader.h" #include #include +#include #include #include
CVS commit: src/external/cddl/osnet/dist
Module Name:src Committed By: christos Date: Sun Nov 20 02:54:25 UTC 2011 Modified Files: src/external/cddl/osnet/dist/common/acl: acl_common.c src/external/cddl/osnet/dist/uts/common/fs/zfs: arc.c spa.c txg.c vdev.c vdev_disk.c zfs_ioctl.c zfs_vfsops.c zfs_vnops.c zfs_znode.c Log Message: enough with the compile time warnings. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/dist/common/acl/acl_common.c cvs rdiff -u -r1.9 -r1.10 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/dist/uts/common/fs/zfs/spa.c \ src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/dist/uts/common/fs/zfs/txg.c \ src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev.c cvs rdiff -u -r1.7 -r1.8 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c cvs rdiff -u -r1.6 -r1.7 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c cvs rdiff -u -r1.8 -r1.9 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c cvs rdiff -u -r1.11 -r1.12 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.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/common/acl/acl_common.c diff -u src/external/cddl/osnet/dist/common/acl/acl_common.c:1.4 src/external/cddl/osnet/dist/common/acl/acl_common.c:1.5 --- src/external/cddl/osnet/dist/common/acl/acl_common.c:1.4 Mon Mar 14 20:48:04 2011 +++ src/external/cddl/osnet/dist/common/acl/acl_common.c Sat Nov 19 21:54:25 2011 @@ -944,9 +944,9 @@ acevals_init(acevals_t *vals, uid_t key) static void ace_list_init(ace_list_t *al, int dfacl_flag) { - acevals_init(&al->user_obj, NULL); - acevals_init(&al->group_obj, NULL); - acevals_init(&al->other_obj, NULL); + acevals_init(&al->user_obj, 0); + acevals_init(&al->group_obj, 0); + acevals_init(&al->other_obj, 0); al->numusers = 0; al->numgroups = 0; al->acl_mask = 0; Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c:1.9 src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c:1.10 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c:1.9 Thu May 6 18:35:37 2010 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c Sat Nov 19 21:54:25 2011 @@ -2095,7 +2095,7 @@ arc_kmem_reap_now(arc_reclaim_strategy_t } static void -arc_reclaim_thread(void) +arc_reclaim_thread(void *unused __unused) { clock_t growtime = 0; arc_reclaim_strategy_t last_reclaim = ARC_RECLAIM_CONS; @@ -4473,7 +4473,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_de * heart of the L2ARC. */ static void -l2arc_feed_thread(void) +l2arc_feed_thread(void *unused __unused) { callb_cpr_t cpr; l2arc_dev_t *dev; Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/spa.c diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/spa.c:1.4 src/external/cddl/osnet/dist/uts/common/fs/zfs/spa.c:1.5 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/spa.c:1.4 Mon May 10 02:15:28 2010 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/spa.c Sat Nov 19 21:54:25 2011 @@ -4776,9 +4776,10 @@ spa_async_autoexpand(spa_t *spa, vdev_t } static void -spa_async_thread(spa_t *spa) +spa_async_thread(void *arg) { int tasks; + spa_t *spa = arg; ASSERT(spa->spa_sync_on); Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c:1.4 src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c:1.5 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c:1.4 Thu Jun 24 09:03:05 2010 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c Sat Nov 19 21:54:25 2011 @@ -290,9 +290,9 @@ vdev_disk_io_start(zio_t *zio) bp->b_private = zio; if (!(bp->b_flags & B_READ)) { - mutex_enter(&vp->v_interlock); + mutex_enter(vp->v_interlock); vp->v_numoutput++; - mutex_exit(&vp->v_interlock); + mutex_exit(vp->v_interlock); } if (bp->b_bcount <= MAXPHYS) { Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/txg.c diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/txg.c:1.3 src/external/cddl/osnet/dist/uts/common/fs/zfs/txg.c:1.4 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/txg.c:1.3 Sat Feb 27 18:43:53 2010 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/txg.c Sat Nov 19 21:54:25 2011 @@ -34,8 +34,8 @@ * Pool-wide transaction groups. */ -static void txg_sync_thread(dsl_pool_t *dp); -static void txg_quiesce_thread(dsl_pool_t *dp); +static void txg_sync_thread(void *); +static void txg_quiesce_thread(void *); int zfs_txg_timeout = 30; /* max seconds worth of delta per txg */ @@ -350,8 +350,9 @@ txg_dispatch_callbacks(dsl_pool_t *dp, u } static void -txg_sync_thread(dsl_pool_t *dp) +txg_sync_thread(void *arg) { + dsl_pool_t *dp = arg; spa_t *spa = dp->dp_spa;
CVS commit: src/sbin/iscsid
Module Name:src Committed By: agc Date: Sun Nov 20 01:23:57 UTC 2011 Modified Files: src/sbin/iscsid: iscsid_discover.c iscsid_driverif.c iscsid_globals.h iscsid_lists.c iscsid_main.c iscsid_targets.c Log Message: simplify code by removing a useless "#define STATIC static" in both debug and normal usage, and all of its uses. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sbin/iscsid/iscsid_discover.c \ src/sbin/iscsid/iscsid_driverif.c src/sbin/iscsid/iscsid_lists.c \ src/sbin/iscsid/iscsid_main.c src/sbin/iscsid/iscsid_targets.c cvs rdiff -u -r1.3 -r1.4 src/sbin/iscsid/iscsid_globals.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/iscsid/iscsid_discover.c diff -u src/sbin/iscsid/iscsid_discover.c:1.2 src/sbin/iscsid/iscsid_discover.c:1.3 --- src/sbin/iscsid/iscsid_discover.c:1.2 Sat Oct 29 16:54:49 2011 +++ src/sbin/iscsid/iscsid_discover.c Sun Nov 20 01:23:57 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: iscsid_discover.c,v 1.2 2011/10/29 16:54:49 christos Exp $ */ +/* $NetBSD: iscsid_discover.c,v 1.3 2011/11/20 01:23:57 agc Exp $ */ /*- * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ ISNS_HANDLE isns_handle = ISNS_INVALID_H * Returns: status */ -STATIC void +static void xlate_ip(uint8_t *dest, size_t size, void *data) { uint16_t *wdt = (uint16_t *) data; @@ -98,7 +98,7 @@ xlate_ip(uint8_t *dest, size_t size, voi * Returns: status */ -STATIC uint32_t +static uint32_t get_isns_target_info(isns_t * isns, uint8_t * TargetName) { int retval; @@ -678,7 +678,7 @@ update_isns_server_info(isns_t * isns) *Returns:Pointer to isns structure, NULL if allocation failed. */ -STATIC isns_t * +static isns_t * create_isns(iscsid_add_isns_server_req_t * req) { isns_t *isns; Index: src/sbin/iscsid/iscsid_driverif.c diff -u src/sbin/iscsid/iscsid_driverif.c:1.2 src/sbin/iscsid/iscsid_driverif.c:1.3 --- src/sbin/iscsid/iscsid_driverif.c:1.2 Sat Oct 29 16:54:49 2011 +++ src/sbin/iscsid/iscsid_driverif.c Sun Nov 20 01:23:57 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: iscsid_driverif.c,v 1.2 2011/10/29 16:54:49 christos Exp $ */ +/* $NetBSD: iscsid_driverif.c,v 1.3 2011/11/20 01:23:57 agc Exp $ */ /*- * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc. @@ -100,7 +100,7 @@ set_node_name(iscsid_set_node_name_req_t * TRUE on success, FALSE on error. */ -STATIC int +static int bind_socket(int sock, uint8_t * addr) { struct sockaddr_in serverAddress; @@ -134,7 +134,7 @@ bind_socket(int sock, uint8_t * addr) *Returns:The pointer to the first free portal (or NULL if none found) */ -STATIC portal_t * +static portal_t * find_free_portal(portal_group_t * group) { portal_t *curr, *m; @@ -176,7 +176,7 @@ find_free_portal(portal_group_t * group) *NOTE: Session list must be locked on entry. */ -STATIC connection_t * +static connection_t * make_connection(session_t * sess, iscsid_login_req_t * req, iscsid_response_t * res, uint32_t * stid) { @@ -501,7 +501,7 @@ make_connection(session_t * sess, iscsid * cid Connection ID */ -STATIC void +static void event_recover_connection(uint32_t sid, uint32_t cid) { int sock, ret; Index: src/sbin/iscsid/iscsid_lists.c diff -u src/sbin/iscsid/iscsid_lists.c:1.2 src/sbin/iscsid/iscsid_lists.c:1.3 --- src/sbin/iscsid/iscsid_lists.c:1.2 Sat Oct 29 16:54:49 2011 +++ src/sbin/iscsid/iscsid_lists.c Sun Nov 20 01:23:57 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: iscsid_lists.c,v 1.2 2011/10/29 16:54:49 christos Exp $ */ +/* $NetBSD: iscsid_lists.c,v 1.3 2011/11/20 01:23:57 agc Exp $ */ /*- * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #include "iscsid_globals.h" /* counter for initiator ID */ -STATIC uint32_t initiator_id = 0; +static uint32_t initiator_id = 0; /* -- */ @@ -47,7 +47,7 @@ STATIC uint32_t initiator_id = 0; * Parameter: The session pointer. */ -STATIC void +static void verify_session(session_t * sess) { generic_entry_t *curr, *next; @@ -683,7 +683,7 @@ get_connection_info(iscsid_get_connectio *Returns:The pointer to the portal (or NULL if not found) */ -STATIC initiator_t * +static initiator_t * find_initiator_by_addr(uint8_t * addr) { generic_entry_t *curr; Index: src/sbin/iscsid/iscsid_main.c diff -u src/sbin/iscsid/iscsid_main.c:1.2 src/sbin/iscsid/iscsid_main.c:1.3 --- src/sbin/iscsid/iscsid_main.c:1.2 Sat Oct 29 16:54:49 2011 +++ src/sbin/iscsid/iscsid_main.c Sun Nov 20 01:23:57 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: iscsid_main.c,v 1.2 2011/10/29 16:54:49 christos Exp $ */ +/* $NetBSD: iscsid_main.c,v 1.3 2011/11/20 01:23:57 agc Exp $ */ /*- * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc. @@ -63,8 +63,8 @@ int debug_level = ISCSI_DEBUG; /* Ho
CVS commit: src/sbin/iscsictl
Module Name:src Committed By: agc Date: Sun Nov 20 01:14:17 UTC 2011 Modified Files: src/sbin/iscsictl: iscsic_main.c Log Message: give the correct count of arguments to the sub-functions To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sbin/iscsictl/iscsic_main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/iscsictl/iscsic_main.c diff -u src/sbin/iscsictl/iscsic_main.c:1.4 src/sbin/iscsictl/iscsic_main.c:1.5 --- src/sbin/iscsictl/iscsic_main.c:1.4 Thu Nov 17 16:20:47 2011 +++ src/sbin/iscsictl/iscsic_main.c Sun Nov 20 01:14:17 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: iscsic_main.c,v 1.4 2011/11/17 16:20:47 joerg Exp $ */ +/* $NetBSD: iscsic_main.c,v 1.5 2011/11/20 01:14:17 agc Exp $ */ /*- * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc. @@ -596,7 +596,7 @@ main(int argc, char **argv) sizeof(daemon_name.sun_path)); /* dispatch command */ - res = (*c->proc)(optind + 1, &argv[optind + 1]); + res = (*c->proc)(argc - optind - 1, &argv[optind + 1]); /* cleanup */ close(sock);
CVS commit: src/sys/kern
Module Name:src Committed By: tls Date: Sun Nov 20 01:09:14 UTC 2011 Modified Files: src/sys/kern: init_sysctl.c Log Message: An undocumented behavior of the sysctl kern.arandom node used to allow sucking up to 8192 bytes out of the kernel arc4random() generator at a time. Supposedly some very old application code uses this to rekey other instances of RC4 in userspace (a truly great idea). Reduce the limit to 256 bytes -- and note that it will probably be reduced to sizeof(int) in the future, since this node is so documented. To generate a diff of this commit: cvs rdiff -u -r1.184 -r1.185 src/sys/kern/init_sysctl.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/init_sysctl.c diff -u src/sys/kern/init_sysctl.c:1.184 src/sys/kern/init_sysctl.c:1.185 --- src/sys/kern/init_sysctl.c:1.184 Sat Nov 19 22:51:25 2011 +++ src/sys/kern/init_sysctl.c Sun Nov 20 01:09:14 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: init_sysctl.c,v 1.184 2011/11/19 22:51:25 tls Exp $ */ +/* $NetBSD: init_sysctl.c,v 1.185 2011/11/20 01:09:14 tls Exp $ */ /*- * Copyright (c) 2003, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.184 2011/11/19 22:51:25 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.185 2011/11/20 01:09:14 tls Exp $"); #include "opt_sysv.h" #include "opt_compat_netbsd.h" @@ -1419,7 +1419,22 @@ sysctl_kern_arnd(SYSCTLFN_ARGS) if (*oldlenp == 0) return 0; - if (*oldlenp > 8192) + /* + * This code used to allow sucking 8192 bytes at a time out + * of the kernel arc4random generator. Evidently there is some + * very old OpenBSD application code that may try to do this. + * + * Note that this node is documented as type "INT" -- 4 or 8 + * bytes, not 8192. + * + * We continue to support this abuse of the "len" pointer here + * but only 256 bytes at a time, as, anecdotally, the actual + * application use here was to generate RC4 keys in userspace. + * + * Support for such large requests will probably be removed + * entirely in the future. + */ + if (*oldlenp > 256) return E2BIG; v = kmem_alloc(*oldlenp, KM_SLEEP);
CVS commit: src/sys/dev
Module Name:src Committed By: tls Date: Sun Nov 20 00:45:16 UTC 2011 Modified Files: src/sys/dev: rnd.c Log Message: Add very, very temporary and ugly work around for my braino about detaching bad devices. Will fix as soon as I have more time with the hardware where I can reproduce this. To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.85 src/sys/dev/rnd.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/rnd.c diff -u src/sys/dev/rnd.c:1.84 src/sys/dev/rnd.c:1.85 --- src/sys/dev/rnd.c:1.84 Sun Nov 20 00:28:51 2011 +++ src/sys/dev/rnd.c Sun Nov 20 00:45:15 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rnd.c,v 1.84 2011/11/20 00:28:51 tls Exp $ */ +/* $NetBSD: rnd.c,v 1.85 2011/11/20 00:45:15 tls Exp $ */ /*- * Copyright (c) 1997-2011 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.84 2011/11/20 00:28:51 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.85 2011/11/20 00:45:15 tls Exp $"); #include #include @@ -52,6 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.84 #include #include #include +#include /* XXX temporary, see rnd_detach_source */ #if defined(__HAVE_CPU_COUNTER) && !defined(_RUMPKERNEL) /* XXX: bad pooka */ #include @@ -968,13 +969,15 @@ rnd_detach_source(krndsource_t *source) mutex_spin_exit(&rnd_mtx); - if (source->state) { - rnd_sample_free(source->state); - source->state = NULL; - } + if (!cpu_softintr_p()) { /* XXX XXX very temporary "fix" */ + if (source->state) { + rnd_sample_free(source->state); + source->state = NULL; + } - if (source->test) { - kmem_free(source->test, sizeof(rngtest_t)); + if (source->test) { + kmem_free(source->test, sizeof(rngtest_t)); + } } #ifdef RND_VERBOSE
CVS commit: src/sys/dev
Module Name:src Committed By: tls Date: Sun Nov 20 00:28:51 UTC 2011 Modified Files: src/sys/dev: rnd.c Log Message: Fix a backwards memcmp() that was causing all hardware sources to detach. To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/sys/dev/rnd.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/rnd.c diff -u src/sys/dev/rnd.c:1.83 src/sys/dev/rnd.c:1.84 --- src/sys/dev/rnd.c:1.83 Sat Nov 19 22:51:22 2011 +++ src/sys/dev/rnd.c Sun Nov 20 00:28:51 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rnd.c,v 1.83 2011/11/19 22:51:22 tls Exp $ */ +/* $NetBSD: rnd.c,v 1.84 2011/11/20 00:28:51 tls Exp $ */ /*- * Copyright (c) 1997-2011 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.83 2011/11/19 22:51:22 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.84 2011/11/20 00:28:51 tls Exp $"); #include #include @@ -954,15 +954,6 @@ rnd_detach_source(krndsource_t *source) LIST_REMOVE(source, list); - if (source->state) { - rnd_sample_free(source->state); - source->state = NULL; - } - - if (source->test) { - kmem_free(source->test, sizeof(rngtest_t)); - } - /* * If there are samples queued up "remove" them from the sample queue * by setting the source to the no-collect pseudosource. @@ -976,6 +967,16 @@ rnd_detach_source(krndsource_t *source) } mutex_spin_exit(&rnd_mtx); + + if (source->state) { + rnd_sample_free(source->state); + source->state = NULL; + } + + if (source->test) { + kmem_free(source->test, sizeof(rngtest_t)); + } + #ifdef RND_VERBOSE printf("rnd: %s detached as an entropy source\n", source->name); #endif @@ -1133,9 +1134,17 @@ rnd_hwrng_test(rnd_sample_t *sample) v1 = (uint8_t *)sample->values; v2 = (uint8_t *)sample->values + cmplen; - if (__predict_false(memcmp(v1, v2, cmplen))) { - printf("rnd: source \"%s\" failed continuous-output test.", + if (__predict_false(!memcmp(v1, v2, cmplen))) { + int *dump; + printf("rnd: source \"%s\" failed continuous-output test.\n", source->name); + printf("rnd: bad buffer: "); + for (dump = (int *)sample->values; + dump < (int *)((uint8_t *)sample->values + + sizeof(sample->values)); dump += sizeof(int)) { + printf("%x ", *dump); + } + printf("\n"); return 1; }
CVS commit: [jmcneill-audiomp3] src/sys/dev/pci/hdaudio
Module Name:src Committed By: jmcneill Date: Sat Nov 19 23:40:07 UTC 2011 Modified Files: src/sys/dev/pci/hdaudio [jmcneill-audiomp3]: hdafg.c hdaudio.c hdaudio_pci.c Log Message: adapt to audiomp api changes To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.10.4.1 src/sys/dev/pci/hdaudio/hdafg.c cvs rdiff -u -r1.16 -r1.16.2.1 src/sys/dev/pci/hdaudio/hdaudio.c cvs rdiff -u -r1.8 -r1.8.6.1 src/sys/dev/pci/hdaudio/hdaudio_pci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/hdaudio/hdafg.c diff -u src/sys/dev/pci/hdaudio/hdafg.c:1.10 src/sys/dev/pci/hdaudio/hdafg.c:1.10.4.1 --- src/sys/dev/pci/hdaudio/hdafg.c:1.10 Tue Oct 25 00:00:13 2011 +++ src/sys/dev/pci/hdaudio/hdafg.c Sat Nov 19 23:40:07 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: hdafg.c,v 1.10 2011/10/25 00:00:13 jmcneill Exp $ */ +/* $NetBSD: hdafg.c,v 1.10.4.1 2011/11/19 23:40:07 jmcneill Exp $ */ /* * Copyright (c) 2009 Precedence Technologies Ltd @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.10 2011/10/25 00:00:13 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.10.4.1 2011/11/19 23:40:07 jmcneill Exp $"); #include #include @@ -285,6 +285,8 @@ struct hdaudio_audiodev { struct hdafg_softc { device_t sc_dev; + kmutex_t sc_lock; + kmutex_t sc_intr_lock; struct hdaudio_softc *sc_host; struct hdaudio_codec *sc_codec; struct hdaudio_function_group *sc_fg; @@ -361,8 +363,8 @@ static int hdafg_halt_input(void *); static int hdafg_set_port(void *, mixer_ctrl_t *); static int hdafg_get_port(void *, mixer_ctrl_t *); static int hdafg_query_devinfo(void *, mixer_devinfo_t *); -static void * hdafg_allocm(void *, int, size_t, struct malloc_type *, int); -static void hdafg_freem(void *, void *, struct malloc_type *); +static void * hdafg_allocm(void *, int, size_t); +static void hdafg_freem(void *, void *, size_t); static int hdafg_getdev(void *, struct audio_device *); static size_t hdafg_round_buffersize(void *, int, size_t); static paddr_t hdafg_mappage(void *, void *, off_t, int); @@ -373,6 +375,7 @@ static int hdafg_trigger_output(void *, static int hdafg_trigger_input(void *, void *, void *, int, void (*)(void *), void *, const audio_params_t *); +static void hdafg_get_locks(void *, kmutex_t **, kmutex_t **); static const struct audio_hw_if hdafg_hw_if = { .query_encoding = hdafg_query_encoding, @@ -392,6 +395,7 @@ static const struct audio_hw_if hdafg_hw .get_props = hdafg_get_props, .trigger_output = hdafg_trigger_output, .trigger_input = hdafg_trigger_input, + .get_locks = hdafg_get_locks, }; static int @@ -3545,6 +3549,9 @@ hdafg_attach(device_t parent, device_t s sc->sc_dev = self; + mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE); + mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED); + callout_init(&sc->sc_jack_callout, 0); callout_setfunc(&sc->sc_jack_callout, hdafg_hp_switch_handler, sc); @@ -3713,6 +3720,9 @@ hdafg_detach(device_t self, int flags) if (mx) kmem_free(mx, sc->sc_nmixers * sizeof(*mx)); + mutex_destroy(&sc->sc_lock); + mutex_destroy(&sc->sc_intr_lock); + pmf_device_deregister(self); return 0; @@ -4032,8 +4042,7 @@ hdafg_query_devinfo(void *opaque, mixer_ } static void * -hdafg_allocm(void *opaque, int direction, size_t size, -struct malloc_type *type, int flags) +hdafg_allocm(void *opaque, int direction, size_t size) { struct hdaudio_audiodev *ad = opaque; struct hdaudio_stream *st; @@ -4056,7 +4065,7 @@ hdafg_allocm(void *opaque, int direction } static void -hdafg_freem(void *opaque, void *addr, struct malloc_type *type) +hdafg_freem(void *opaque, void *addr, size_t size) { struct hdaudio_audiodev *ad = opaque; struct hdaudio_stream *st; @@ -4167,6 +4176,15 @@ hdafg_trigger_input(void *opaque, void * return 0; } +static void +hdafg_get_locks(void *opaque, kmutex_t **intr, kmutex_t **thread) +{ + struct hdaudio_audiodev *ad = opaque; + + *intr = &ad->ad_sc->sc_intr_lock; + *thread = &ad->ad_sc->sc_lock; +} + static int hdafg_unsol(device_t self, uint8_t tag) { Index: src/sys/dev/pci/hdaudio/hdaudio.c diff -u src/sys/dev/pci/hdaudio/hdaudio.c:1.16 src/sys/dev/pci/hdaudio/hdaudio.c:1.16.2.1 --- src/sys/dev/pci/hdaudio/hdaudio.c:1.16 Fri Nov 4 15:32:34 2011 +++ src/sys/dev/pci/hdaudio/hdaudio.c Sat Nov 19 23:40:07 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: hdaudio.c,v 1.16 2011/11/04 15:32:34 jakllsch Exp $ */ +/* $NetBSD: hdaudio.c,v 1.16.2.1 2011/11/19 23:40:07 jmcneill Exp $ */ /* * Copyright (c) 2009 Precedence Technologies Ltd @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.16 2011/11/04 15:32:34 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.16.2.1 2011/11/19 23:40:07 jmcneill Exp $"); #include #include @@ -778,8 +778,8 @@ hdaudio_attach(device_t dev, stru
CVS commit: [jmcneill-audiomp3] src/sys/dev/pci
Module Name:src Committed By: jmcneill Date: Sat Nov 19 23:36:38 UTC 2011 Modified Files: src/sys/dev/pci [jmcneill-audiomp3]: gcscaudio.c Log Message: add gcscaudio_get_locks() To generate a diff of this commit: cvs rdiff -u -r1.7.4.1 -r1.7.4.2 src/sys/dev/pci/gcscaudio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/gcscaudio.c diff -u src/sys/dev/pci/gcscaudio.c:1.7.4.1 src/sys/dev/pci/gcscaudio.c:1.7.4.2 --- src/sys/dev/pci/gcscaudio.c:1.7.4.1 Sat Nov 19 23:31:26 2011 +++ src/sys/dev/pci/gcscaudio.c Sat Nov 19 23:36:38 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: gcscaudio.c,v 1.7.4.1 2011/11/19 23:31:26 jmcneill Exp $ */ +/* $NetBSD: gcscaudio.c,v 1.7.4.2 2011/11/19 23:36:38 jmcneill Exp $ */ /*- * Copyright (c) 2008 SHIMIZU Ryo @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gcscaudio.c,v 1.7.4.1 2011/11/19 23:31:26 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gcscaudio.c,v 1.7.4.2 2011/11/19 23:36:38 jmcneill Exp $"); #include #include @@ -151,6 +151,7 @@ static int gcscaudio_trigger_output(void static int gcscaudio_trigger_input(void *, void *, void *, int, void (*)(void *), void *, const audio_params_t *); +static void gcscaudio_get_locks(void *, kmutex_t **, kmutex_t **); static bool gcscaudio_resume(device_t, const pmf_qual_t *); static int gcscaudio_intr(void *); @@ -211,7 +212,8 @@ static const struct audio_hw_if gcscaudi .trigger_output = gcscaudio_trigger_output, .trigger_input = gcscaudio_trigger_input, .dev_ioctl = NULL, - .powerstate = NULL + .powerstate = NULL, + .get_locks = gcscaudio_get_locks, }; static const struct audio_format gcscaudio_formats_2ch = { @@ -1187,6 +1189,17 @@ gcscaudio_trigger_input(void *addr, void return 0; } +static void +gcscaudio_get_locks(void *arg, kmutex_t **intr, kmutex_t **thread) +{ + struct gcscaudio_softc *sc; + + sc = (struct gcscaudio_softc *)arg; + + *intr = &sc->sc_intr_lock; + *thread = &sc->sc_lock; +} + static int gcscaudio_intr(void *arg) {
CVS commit: [jmcneill-audiomp3] src/sys/dev/pci
Module Name:src Committed By: jmcneill Date: Sat Nov 19 23:31:26 UTC 2011 Modified Files: src/sys/dev/pci [jmcneill-audiomp3]: gcscaudio.c Log Message: adapt to audiomp api changes To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.7.4.1 src/sys/dev/pci/gcscaudio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/gcscaudio.c diff -u src/sys/dev/pci/gcscaudio.c:1.7 src/sys/dev/pci/gcscaudio.c:1.7.4.1 --- src/sys/dev/pci/gcscaudio.c:1.7 Thu Jun 9 14:46:33 2011 +++ src/sys/dev/pci/gcscaudio.c Sat Nov 19 23:31:26 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: gcscaudio.c,v 1.7 2011/06/09 14:46:33 joerg Exp $ */ +/* $NetBSD: gcscaudio.c,v 1.7.4.1 2011/11/19 23:31:26 jmcneill Exp $ */ /*- * Copyright (c) 2008 SHIMIZU Ryo @@ -27,11 +27,11 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gcscaudio.c,v 1.7 2011/06/09 14:46:33 joerg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gcscaudio.c,v 1.7.4.1 2011/11/19 23:31:26 jmcneill Exp $"); #include #include -#include +#include #include #include @@ -85,6 +85,8 @@ struct gcscaudio_softc_ch { struct gcscaudio_softc { struct device sc_dev; + kmutex_t sc_lock; + kmutex_t sc_intr_lock; pci_chipset_tag_t sc_pc; pcitag_t sc_pt; void *sc_ih; @@ -138,8 +140,8 @@ static int gcscaudio_getdev(void *, stru static int gcscaudio_set_port(void *, mixer_ctrl_t *); static int gcscaudio_get_port(void *, mixer_ctrl_t *); static int gcscaudio_query_devinfo(void *, mixer_devinfo_t *); -static void *gcscaudio_malloc(void *, int, size_t, struct malloc_type *, int); -static void gcscaudio_free(void *, void *, struct malloc_type *); +static void *gcscaudio_malloc(void *, int, size_t); +static void gcscaudio_free(void *, void *, size_t); static size_t gcscaudio_round_buffersize(void *, int, size_t); static paddr_t gcscaudio_mappage(void *, void *, off_t, int); static int gcscaudio_get_props(void *); @@ -168,7 +170,7 @@ static int gcscaudio_set_params_ch(struc audio_params_t *, stream_filter_list_t *); static int gcscaudio_allocate_dma(struct gcscaudio_softc *, size_t, void **, bus_dma_segment_t *, int, int *, - int, bus_dmamap_t *); + bus_dmamap_t *); CFATTACH_DECL(gcscaudio, sizeof (struct gcscaudio_softc), @@ -271,6 +273,8 @@ gcscaudio_attach(device_t parent, device sc->sc_dmat = pa->pa_dmat; LIST_INIT(&sc->sc_dmalist); sc->sc_mch_split_buf = NULL; + mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE); + mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED); aprint_normal(": AMD Geode CS5536 Audio\n"); @@ -286,7 +290,7 @@ gcscaudio_attach(device_t parent, device } intrstr = pci_intr_string(sc->sc_pc, ih); - sc->sc_ih = pci_intr_establish(sc->sc_pc, ih, IPL_AUDIO, + sc->sc_ih = pci_intr_establish(sc->sc_pc, ih, IPL_SCHED, gcscaudio_intr, sc); if (sc->sc_ih == NULL) { aprint_error_dev(&sc->sc_dev, "couldn't establish interrupt"); @@ -301,7 +305,7 @@ gcscaudio_attach(device_t parent, device if (gcscaudio_allocate_dma(sc, sizeof(*sc->sc_prd.p_prdtables), (void **)&(sc->sc_prd.p_prdtables), sc->sc_prd.p_prdsegs, 1, - &(sc->sc_prd.p_prdnseg), M_WAITOK, &(sc->sc_prd.p_prdmap)) != 0) + &(sc->sc_prd.p_prdnseg), &(sc->sc_prd.p_prdmap)) != 0) goto attach_failure_intr; sc->host_if.arg = sc; @@ -311,7 +315,7 @@ gcscaudio_attach(device_t parent, device sc->host_if.reset = gcscaudio_reset_codec; sc->host_if.spdif_event = gcscaudio_spdif_event_codec; - if ((rc = ac97_attach(&sc->host_if, self)) != 0) { + if ((rc = ac97_attach(&sc->host_if, self, &sc->sc_lock)) != 0) { aprint_error_dev(&sc->sc_dev, "can't attach codec (error=%d)\n", rc); goto attach_failure_intr; @@ -607,7 +611,7 @@ gcscaudio_halt_output(void *arg) /* channel splitter */ sc->sc_mch_splitter = NULL; if (sc->sc_mch_split_buf) - gcscaudio_free(sc, sc->sc_mch_split_buf, M_DEVBUF); + gcscaudio_free(sc, sc->sc_mch_split_buf, sc->sc_mch_split_size); sc->sc_mch_split_buf = NULL; return 0; @@ -660,8 +664,7 @@ gcscaudio_query_devinfo(void *addr, mixe } static void * -gcscaudio_malloc(void *arg, int direction, size_t size, - struct malloc_type *pool, int flags) +gcscaudio_malloc(void *arg, int direction, size_t size) { struct gcscaudio_softc *sc; struct gcscaudio_dma *p; @@ -669,17 +672,15 @@ gcscaudio_malloc(void *arg, int directio sc = (struct gcscaudio_softc *)arg; - p = malloc(sizeof(*p), pool, flags); + p = kmem_alloc(sizeof(*p), KM_SLEEP); if (p == NULL) return NULL; p->size = size; error = gcscaudio_allocate_dma(sc, size, &p->addr, - p->segs, sizeof(p->segs)/sizeof(p->segs[0]), &p->nseg, - BUS_DMA_NOWAIT, &p->map); - + p->segs, sizeof(p->segs)/sizeof(p->segs[0]), &p->nseg, &p->map); if (error) { - free(p, pool);
CVS commit: [jmcneill-audiomp3] src/sys/dev/pci
Module Name:src Committed By: jmcneill Date: Sat Nov 19 23:19:01 UTC 2011 Modified Files: src/sys/dev/pci [jmcneill-audiomp3]: emuxki.c Log Message: adapt to audiomp api changes To generate a diff of this commit: cvs rdiff -u -r1.59.14.1 -r1.59.14.2 src/sys/dev/pci/emuxki.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/emuxki.c diff -u src/sys/dev/pci/emuxki.c:1.59.14.1 src/sys/dev/pci/emuxki.c:1.59.14.2 --- src/sys/dev/pci/emuxki.c:1.59.14.1 Sat Nov 19 21:49:42 2011 +++ src/sys/dev/pci/emuxki.c Sat Nov 19 23:19:00 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: emuxki.c,v 1.59.14.1 2011/11/19 21:49:42 jmcneill Exp $ */ +/* $NetBSD: emuxki.c,v 1.59.14.2 2011/11/19 23:19:00 jmcneill Exp $ */ /*- * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc. @@ -49,16 +49,17 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.59.14.1 2011/11/19 21:49:42 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.59.14.2 2011/11/19 23:19:00 jmcneill Exp $"); #include #include #include -#include #include #include #include #include +#include +#include #include #include @@ -81,18 +82,16 @@ static int emuxki_detach(device_t, int); /* DMA mem mgmt */ static struct dmamem *dmamem_alloc(bus_dma_tag_t, size_t, bus_size_t, - int, struct malloc_type *, int); -static void dmamem_free(struct dmamem *, struct malloc_type *); + int); +static void dmamem_free(struct dmamem *); /* Emu10k1 init & shutdown */ static int emuxki_init(struct emuxki_softc *); static void emuxki_shutdown(struct emuxki_softc *); /* Emu10k1 mem mgmt */ -static void *emuxki_pmem_alloc(struct emuxki_softc *, size_t, - struct malloc_type *,int); -static void *emuxki_rmem_alloc(struct emuxki_softc *, size_t, - struct malloc_type *,int); +static void *emuxki_pmem_alloc(struct emuxki_softc *, size_t); +static void *emuxki_rmem_alloc(struct emuxki_softc *, size_t); /* * Emu10k1 channels funcs : There is no direct access to channels, everything @@ -154,8 +153,8 @@ static int emuxki_set_port(void *, mixer static int emuxki_get_port(void *, mixer_ctrl_t *); static int emuxki_query_devinfo(void *, mixer_devinfo_t *); -static void*emuxki_allocm(void *, int, size_t, struct malloc_type *, int); -static void emuxki_freem(void *, void *, struct malloc_type *); +static void*emuxki_allocm(void *, int, size_t); +static void emuxki_freem(void *, void *, size_t); static paddr_t emuxki_mappage(void *, void *, off_t, int); static int emuxki_get_props(void *); @@ -241,22 +240,20 @@ static const struct audio_format emuxki_ */ static void -dmamem_delete(struct dmamem *mem, struct malloc_type *type) +dmamem_delete(struct dmamem *mem) { - free(mem->segs, type); - free(mem, type); + kmem_free(mem->segs, mem->nsegs * sizeof(*(mem->segs))); + kmem_free(mem, sizeof(*mem)); } static struct dmamem * -dmamem_alloc(bus_dma_tag_t dmat, size_t size, bus_size_t align, - int nsegs, struct malloc_type *type, int flags) +dmamem_alloc(bus_dma_tag_t dmat, size_t size, bus_size_t align, int nsegs) { struct dmamem *mem; - int bus_dma_flags; /* Allocate memory for structure */ - if ((mem = malloc(sizeof(*mem), type, flags)) == NULL) + if ((mem = kmem_alloc(sizeof(*mem), KM_SLEEP)) == NULL) return NULL; mem->dmat = dmat; mem->size = size; @@ -264,41 +261,40 @@ dmamem_alloc(bus_dma_tag_t dmat, size_t mem->nsegs = nsegs; mem->bound = 0; - mem->segs = malloc(mem->nsegs * sizeof(*(mem->segs)), type, flags); + mem->segs = kmem_alloc(mem->nsegs * sizeof(*(mem->segs)), KM_SLEEP); if (mem->segs == NULL) { - free(mem, type); + kmem_free(mem, sizeof(*mem)); return NULL; } - bus_dma_flags = (flags & M_NOWAIT) ? BUS_DMA_NOWAIT : BUS_DMA_WAITOK; if (bus_dmamem_alloc(dmat, mem->size, mem->align, mem->bound, mem->segs, mem->nsegs, &(mem->rsegs), - bus_dma_flags)) { - dmamem_delete(mem, type); + BUS_DMA_WAITOK)) { + dmamem_delete(mem); return NULL; } if (bus_dmamem_map(dmat, mem->segs, mem->nsegs, mem->size, - &(mem->kaddr), bus_dma_flags | BUS_DMA_COHERENT)) { + &(mem->kaddr), BUS_DMA_WAITOK | BUS_DMA_COHERENT)) { bus_dmamem_free(dmat, mem->segs, mem->nsegs); - dmamem_delete(mem, type); + dmamem_delete(mem); return NULL; } if (bus_dmamap_create(dmat, mem->size, mem->nsegs, mem->size, - mem->bound, bus_dma_flags, &(mem->map))) { + mem->bound, BUS_DMA_WAITOK, &(mem->map))) { bus_dmamem_unmap(dmat, mem->kaddr, mem->size); bus_dmamem_free(dmat, mem->segs, mem->nsegs); - dmamem_delete(mem, type); + dmamem_delete(mem); return NULL; } if (bus_dmamap_load(dmat, mem->map, mem->kaddr, - mem->size, NULL, bus_dma_flags)) { + mem->size, NULL, BUS_DMA_WAITOK)) { bus_dmamap_destroy(dmat, mem->map); bus_dmamem_unmap(dmat, mem->kaddr, mem->size); bus_dmamem_free(dmat, mem->segs, m
CVS commit: [netbsd-5-0] src/doc
Module Name:src Committed By: sborrill Date: Sat Nov 19 22:26:58 UTC 2011 Modified Files: src/doc [netbsd-5-0]: CHANGES-5.0.3 Log Message: Ticket #1695 To generate a diff of this commit: cvs rdiff -u -r1.1.2.55 -r1.1.2.56 src/doc/CHANGES-5.0.3 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-5.0.3 diff -u src/doc/CHANGES-5.0.3:1.1.2.55 src/doc/CHANGES-5.0.3:1.1.2.56 --- src/doc/CHANGES-5.0.3:1.1.2.55 Sat Nov 19 14:00:19 2011 +++ src/doc/CHANGES-5.0.3 Sat Nov 19 22:26:58 2011 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.0.3,v 1.1.2.55 2011/11/19 14:00:19 bouyer Exp $ +# $NetBSD: CHANGES-5.0.3,v 1.1.2.56 2011/11/19 22:26:58 sborrill Exp $ A complete list of changes from the NetBSD 5.0.2 release to the NetBSD 5.0.3 release: @@ -2875,3 +2875,9 @@ dist/openpam/lib/openpam_configure.c 1. (CVE-2011-4122) [drochner, ticket #1696] +sys/kern/kern_event.c1.74 + + kqueue_register: avoid calling fd_getfile() with + filedesc_t::fd_lock held. Fixes PR/45479 by KOGULE Ryo. + [rmind, ticket #1695] +
CVS commit: [netbsd-5-0] src/sys/kern
Module Name:src Committed By: sborrill Date: Sat Nov 19 22:24:12 UTC 2011 Modified Files: src/sys/kern [netbsd-5-0]: kern_event.c Log Message: Pull up the following revisions(s) (requested by rmind in ticket #1695): sys/kern/kern_event.c: revision 1.74 kqueue_register: avoid calling fd_getfile() with filedesc_t::fd_lock held. Fixes PR/45479 by KOGULE Ryo. To generate a diff of this commit: cvs rdiff -u -r1.60.6.1.2.1 -r1.60.6.1.2.2 src/sys/kern/kern_event.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_event.c diff -u src/sys/kern/kern_event.c:1.60.6.1.2.1 src/sys/kern/kern_event.c:1.60.6.1.2.2 --- src/sys/kern/kern_event.c:1.60.6.1.2.1 Sat Jan 9 01:10:52 2010 +++ src/sys/kern/kern_event.c Sat Nov 19 22:24:12 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_event.c,v 1.60.6.1.2.1 2010/01/09 01:10:52 snj Exp $ */ +/* $NetBSD: kern_event.c,v 1.60.6.1.2.2 2011/11/19 22:24:12 sborrill Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.60.6.1.2.1 2010/01/09 01:10:52 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.60.6.1.2.2 2011/11/19 22:24:12 sborrill Exp $"); #include #include @@ -866,18 +866,16 @@ kqueue_register(struct kqueue *kq, struc return (EINVAL); } - mutex_enter(&fdp->fd_lock); - /* search if knote already exists */ if (kfilter->filtops->f_isfd) { /* monitoring a file descriptor */ fd = kev->ident; if ((fp = fd_getfile(fd)) == NULL) { - mutex_exit(&fdp->fd_lock); rw_exit(&kqueue_filter_lock); kmem_free(newkn, sizeof(*newkn)); return EBADF; } + mutex_enter(&fdp->fd_lock); ff = fdp->fd_ofiles[fd]; if (fd <= fdp->fd_lastkqfile) { SLIST_FOREACH(kn, &ff->ff_knlist, kn_link) { @@ -891,6 +889,7 @@ kqueue_register(struct kqueue *kq, struc * not monitoring a file descriptor, so * lookup knotes in internal hash table */ + mutex_enter(&fdp->fd_lock); if (fdp->fd_knhashmask != 0) { list = &fdp->fd_knhash[ KN_HASH((u_long)kev->ident, fdp->fd_knhashmask)];
CVS commit: [netbsd-5-1] src/doc
Module Name:src Committed By: sborrill Date: Sat Nov 19 22:23:36 UTC 2011 Modified Files: src/doc [netbsd-5-1]: CHANGES-5.1.1 Log Message: Ticket #1695 To generate a diff of this commit: cvs rdiff -u -r1.1.2.41 -r1.1.2.42 src/doc/CHANGES-5.1.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-5.1.1 diff -u src/doc/CHANGES-5.1.1:1.1.2.41 src/doc/CHANGES-5.1.1:1.1.2.42 --- src/doc/CHANGES-5.1.1:1.1.2.41 Sat Nov 19 14:00:14 2011 +++ src/doc/CHANGES-5.1.1 Sat Nov 19 22:23:36 2011 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.1.1,v 1.1.2.41 2011/11/19 14:00:14 bouyer Exp $ +# $NetBSD: CHANGES-5.1.1,v 1.1.2.42 2011/11/19 22:23:36 sborrill Exp $ A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.1.1 release: @@ -2571,3 +2571,9 @@ dist/openpam/lib/openpam_configure.c 1. (CVE-2011-4122) [drochner, ticket #1696] +sys/kern/kern_event.c1.74 + + kqueue_register: avoid calling fd_getfile() with + filedesc_t::fd_lock held. Fixes PR/45479 by KOGULE Ryo. + [rmind, ticket #1695] +
CVS commit: [netbsd-5-1] src/sys/kern
Module Name:src Committed By: sborrill Date: Sat Nov 19 22:22:56 UTC 2011 Modified Files: src/sys/kern [netbsd-5-1]: kern_event.c Log Message: Pull up the following revisions(s) (requested by rmind in ticket #1695): sys/kern/kern_event.c: revision 1.74 kqueue_register: avoid calling fd_getfile() with filedesc_t::fd_lock held. Fixes PR/45479 by KOGULE Ryo. To generate a diff of this commit: cvs rdiff -u -r1.60.6.2 -r1.60.6.2.2.1 src/sys/kern/kern_event.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_event.c diff -u src/sys/kern/kern_event.c:1.60.6.2 src/sys/kern/kern_event.c:1.60.6.2.2.1 --- src/sys/kern/kern_event.c:1.60.6.2 Sat Jan 9 01:08:39 2010 +++ src/sys/kern/kern_event.c Sat Nov 19 22:22:56 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_event.c,v 1.60.6.2 2010/01/09 01:08:39 snj Exp $ */ +/* $NetBSD: kern_event.c,v 1.60.6.2.2.1 2011/11/19 22:22:56 sborrill Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.60.6.2 2010/01/09 01:08:39 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.60.6.2.2.1 2011/11/19 22:22:56 sborrill Exp $"); #include #include @@ -866,18 +866,16 @@ kqueue_register(struct kqueue *kq, struc return (EINVAL); } - mutex_enter(&fdp->fd_lock); - /* search if knote already exists */ if (kfilter->filtops->f_isfd) { /* monitoring a file descriptor */ fd = kev->ident; if ((fp = fd_getfile(fd)) == NULL) { - mutex_exit(&fdp->fd_lock); rw_exit(&kqueue_filter_lock); kmem_free(newkn, sizeof(*newkn)); return EBADF; } + mutex_enter(&fdp->fd_lock); ff = fdp->fd_ofiles[fd]; if (fd <= fdp->fd_lastkqfile) { SLIST_FOREACH(kn, &ff->ff_knlist, kn_link) { @@ -891,6 +889,7 @@ kqueue_register(struct kqueue *kq, struc * not monitoring a file descriptor, so * lookup knotes in internal hash table */ + mutex_enter(&fdp->fd_lock); if (fdp->fd_knhashmask != 0) { list = &fdp->fd_knhash[ KN_HASH((u_long)kev->ident, fdp->fd_knhashmask)];
CVS commit: [netbsd-5] src/doc
Module Name:src Committed By: sborrill Date: Sat Nov 19 22:00:28 UTC 2011 Modified Files: src/doc [netbsd-5]: CHANGES-5.2 Log Message: Ticket #1695 To generate a diff of this commit: cvs rdiff -u -r1.1.2.117 -r1.1.2.118 src/doc/CHANGES-5.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-5.2 diff -u src/doc/CHANGES-5.2:1.1.2.117 src/doc/CHANGES-5.2:1.1.2.118 --- src/doc/CHANGES-5.2:1.1.2.117 Sat Nov 19 14:00:18 2011 +++ src/doc/CHANGES-5.2 Sat Nov 19 22:00:28 2011 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.2,v 1.1.2.117 2011/11/19 14:00:18 bouyer Exp $ +# $NetBSD: CHANGES-5.2,v 1.1.2.118 2011/11/19 22:00:28 sborrill Exp $ A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2 release: @@ -5824,3 +5824,9 @@ dist/openpam/lib/openpam_configure.c 1. (CVE-2011-4122) [drochner, ticket #1696] +sys/kern/kern_event.c1.74 + + kqueue_register: avoid calling fd_getfile() with + filedesc_t::fd_lock held. Fixes PR/45479 by KOGULE Ryo. + [rmind, ticket #1695] +
CVS commit: [netbsd-5] src/sys/kern
Module Name:src Committed By: sborrill Date: Sat Nov 19 21:57:13 UTC 2011 Modified Files: src/sys/kern [netbsd-5]: kern_event.c Log Message: Pull up the following revisions(s) (requested by rmind in ticket #1695): sys/kern/kern_event.c: revision 1.74 kqueue_register: avoid calling fd_getfile() with filedesc_t::fd_lock held. Fixes PR/45479 by KOGULE Ryo. To generate a diff of this commit: cvs rdiff -u -r1.60.6.3 -r1.60.6.4 src/sys/kern/kern_event.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_event.c diff -u src/sys/kern/kern_event.c:1.60.6.3 src/sys/kern/kern_event.c:1.60.6.4 --- src/sys/kern/kern_event.c:1.60.6.3 Fri Nov 18 23:17:53 2011 +++ src/sys/kern/kern_event.c Sat Nov 19 21:57:12 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_event.c,v 1.60.6.3 2011/11/18 23:17:53 sborrill Exp $ */ +/* $NetBSD: kern_event.c,v 1.60.6.4 2011/11/19 21:57:12 sborrill Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.60.6.3 2011/11/18 23:17:53 sborrill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.60.6.4 2011/11/19 21:57:12 sborrill Exp $"); #include #include @@ -868,18 +868,16 @@ kqueue_register(struct kqueue *kq, struc return (EINVAL); } - mutex_enter(&fdp->fd_lock); - /* search if knote already exists */ if (kfilter->filtops->f_isfd) { /* monitoring a file descriptor */ fd = kev->ident; if ((fp = fd_getfile(fd)) == NULL) { - mutex_exit(&fdp->fd_lock); rw_exit(&kqueue_filter_lock); kmem_free(newkn, sizeof(*newkn)); return EBADF; } + mutex_enter(&fdp->fd_lock); ff = fdp->fd_ofiles[fd]; if (fd <= fdp->fd_lastkqfile) { SLIST_FOREACH(kn, &ff->ff_knlist, kn_link) { @@ -893,6 +891,7 @@ kqueue_register(struct kqueue *kq, struc * not monitoring a file descriptor, so * lookup knotes in internal hash table */ + mutex_enter(&fdp->fd_lock); if (fdp->fd_knhashmask != 0) { list = &fdp->fd_knhash[ KN_HASH((u_long)kev->ident, fdp->fd_knhashmask)];
CVS commit: src/games/fortune/datfiles
Module Name:src Committed By: jnemeth Date: Sat Nov 19 20:44:58 UTC 2011 Modified Files: src/games/fortune/datfiles: fortunes Log Message: grammar fix To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/games/fortune/datfiles/fortunes Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/fortune/datfiles/fortunes diff -u src/games/fortune/datfiles/fortunes:1.47 src/games/fortune/datfiles/fortunes:1.48 --- src/games/fortune/datfiles/fortunes:1.47 Mon Jan 24 15:30:54 2011 +++ src/games/fortune/datfiles/fortunes Sat Nov 19 20:44:58 2011 @@ -8504,7 +8504,7 @@ the message-of-the-day telling users to Malek's Law: Any simple idea will be worded in the most complicated way. % -Man 1: Ask me the what the most important thing about telling a good +Man 1: Ask me what the most important thing about telling a good joke is. Man 2: OK, what is the most impo --
CVS commit: src/lib/libc/citrus
Module Name:src Committed By: tnozaki Date: Sat Nov 19 18:39:58 UTC 2011 Modified Files: src/lib/libc/citrus: citrus_mapper.c citrus_stdenc.c Log Message: return EINVAL when module validation failed, pointed by nonaka-san(again). To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libc/citrus/citrus_mapper.c cvs rdiff -u -r1.3 -r1.4 src/lib/libc/citrus/citrus_stdenc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/citrus_mapper.c diff -u src/lib/libc/citrus/citrus_mapper.c:1.7 src/lib/libc/citrus/citrus_mapper.c:1.8 --- src/lib/libc/citrus/citrus_mapper.c:1.7 Fri Jul 25 14:05:25 2008 +++ src/lib/libc/citrus/citrus_mapper.c Sat Nov 19 18:39:58 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_mapper.c,v 1.7 2008/07/25 14:05:25 christos Exp $ */ +/* $NetBSD: citrus_mapper.c,v 1.8 2011/11/19 18:39:58 tnozaki Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -28,7 +28,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_mapper.c,v 1.7 2008/07/25 14:05:25 christos Exp $"); +__RCSID("$NetBSD: citrus_mapper.c,v 1.8 2011/11/19 18:39:58 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -251,8 +251,10 @@ mapper_open(struct _citrus_mapper_area * if (!cm->cm_ops->mo_init || !cm->cm_ops->mo_uninit || !cm->cm_ops->mo_convert || - !cm->cm_ops->mo_init_state) + !cm->cm_ops->mo_init_state) { + ret = EINVAL; goto err; + } /* allocate traits structure */ cm->cm_traits = malloc(sizeof(*cm->cm_traits)); Index: src/lib/libc/citrus/citrus_stdenc.c diff -u src/lib/libc/citrus/citrus_stdenc.c:1.3 src/lib/libc/citrus/citrus_stdenc.c:1.4 --- src/lib/libc/citrus/citrus_stdenc.c:1.3 Sat Oct 29 18:02:04 2005 +++ src/lib/libc/citrus/citrus_stdenc.c Sat Nov 19 18:39:58 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_stdenc.c,v 1.3 2005/10/29 18:02:04 tshiozak Exp $ */ +/* $NetBSD: citrus_stdenc.c,v 1.4 2011/11/19 18:39:58 tnozaki Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -28,7 +28,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_stdenc.c,v 1.3 2005/10/29 18:02:04 tshiozak Exp $"); +__RCSID("$NetBSD: citrus_stdenc.c,v 1.4 2011/11/19 18:39:58 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -128,8 +128,10 @@ _citrus_stdenc_open(struct _citrus_stden ce->ce_ops->eo_cstomb == NULL || ce->ce_ops->eo_mbtowc == NULL || ce->ce_ops->eo_wctomb == NULL || - ce->ce_ops->eo_get_state_desc == NULL) + ce->ce_ops->eo_get_state_desc == NULL) { + ret = EINVAL; goto bad; + } /* allocate traits */ ce->ce_traits = malloc(sizeof(*ce->ce_traits));
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: tnozaki Date: Sat Nov 19 18:48:39 UTC 2011 Modified Files: src/lib/libc/citrus/modules: citrus_mapper_std.c Log Message: fix memory leak, pointed by nonaka-san(again^3). To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/lib/libc/citrus/modules/citrus_mapper_std.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_mapper_std.c diff -u src/lib/libc/citrus/modules/citrus_mapper_std.c:1.9 src/lib/libc/citrus/modules/citrus_mapper_std.c:1.10 --- src/lib/libc/citrus/modules/citrus_mapper_std.c:1.9 Sun Oct 30 21:48:27 2011 +++ src/lib/libc/citrus/modules/citrus_mapper_std.c Sat Nov 19 18:48:39 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_mapper_std.c,v 1.9 2011/10/30 21:48:27 wiz Exp $ */ +/* $NetBSD: citrus_mapper_std.c,v 1.10 2011/11/19 18:48:39 tnozaki Exp $ */ /*- * Copyright (c)2003, 2006 Citrus Project, @@ -28,7 +28,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_mapper_std.c,v 1.9 2011/10/30 21:48:27 wiz Exp $"); +__RCSID("$NetBSD: citrus_mapper_std.c,v 1.10 2011/11/19 18:48:39 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -185,8 +185,11 @@ rowcol_parse_variable_compat(struct _cit n = be32toh(rcx->rcx_src_row_end); if (m + n > 0) { ret = set_linear_zone(lz, m, n); - if (ret != 0) + if (ret != 0) { + free(rc->rc_src_rowcol); + rc->rc_src_rowcol = NULL; return ret; + } ++rc->rc_src_rowcol_len, ++lz; } m = be32toh(rcx->rcx_src_col_begin);
CVS commit: src/lib/libc/citrus
Module Name:src Committed By: tnozaki Date: Sat Nov 19 18:43:40 UTC 2011 Modified Files: src/lib/libc/citrus: citrus_mapper.c Log Message: remove useless free(), pointed by nonaka-san(again^2). To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/libc/citrus/citrus_mapper.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/citrus_mapper.c diff -u src/lib/libc/citrus/citrus_mapper.c:1.8 src/lib/libc/citrus/citrus_mapper.c:1.9 --- src/lib/libc/citrus/citrus_mapper.c:1.8 Sat Nov 19 18:39:58 2011 +++ src/lib/libc/citrus/citrus_mapper.c Sat Nov 19 18:43:40 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_mapper.c,v 1.8 2011/11/19 18:39:58 tnozaki Exp $ */ +/* $NetBSD: citrus_mapper.c,v 1.9 2011/11/19 18:43:40 tnozaki Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -28,7 +28,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_mapper.c,v 1.8 2011/11/19 18:39:58 tnozaki Exp $"); +__RCSID("$NetBSD: citrus_mapper.c,v 1.9 2011/11/19 18:43:40 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -103,7 +103,6 @@ _citrus_mapper_create_area( ma->ma_dir = strdup(area); if (ma->ma_dir == NULL) { ret = errno; - free(ma->ma_dir); goto quit; } _CITRUS_HASH_INIT(&ma->ma_cache, CM_HASH_SIZE);
CVS commit: src/lib/libc/citrus
Module Name:src Committed By: tnozaki Date: Sat Nov 19 18:34:22 UTC 2011 Modified Files: src/lib/libc/citrus: citrus_ctype.c citrus_iconv.c Log Message: return EINVAL when module validation failed, pointed by nonaka-san(again). To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/lib/libc/citrus/citrus_ctype.c cvs rdiff -u -r1.9 -r1.10 src/lib/libc/citrus/citrus_iconv.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/citrus_ctype.c diff -u src/lib/libc/citrus/citrus_ctype.c:1.5 src/lib/libc/citrus/citrus_ctype.c:1.6 --- src/lib/libc/citrus/citrus_ctype.c:1.5 Sat Jun 14 16:01:07 2008 +++ src/lib/libc/citrus/citrus_ctype.c Sat Nov 19 18:34:21 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_ctype.c,v 1.5 2008/06/14 16:01:07 tnozaki Exp $ */ +/* $NetBSD: citrus_ctype.c,v 1.6 2011/11/19 18:34:21 tnozaki Exp $ */ /*- * Copyright (c)1999, 2000, 2001, 2002 Citrus Project, @@ -28,7 +28,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_ctype.c,v 1.5 2008/06/14 16:01:07 tnozaki Exp $"); +__RCSID("$NetBSD: citrus_ctype.c,v 1.6 2011/11/19 18:34:21 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -113,8 +113,10 @@ _initctypemodule(_citrus_ctype_t cc, cha cc->cc_ops->co_wcstombs == NULL || cc->cc_ops->co_wctomb == NULL || cc->cc_ops->co_btowc == NULL || - cc->cc_ops->co_wctob == NULL) + cc->cc_ops->co_wctob == NULL) { + ret = EINVAL; goto bad; + } /* init and get closure */ ret = (*cc->cc_ops->co_init)( Index: src/lib/libc/citrus/citrus_iconv.c diff -u src/lib/libc/citrus/citrus_iconv.c:1.9 src/lib/libc/citrus/citrus_iconv.c:1.10 --- src/lib/libc/citrus/citrus_iconv.c:1.9 Wed Mar 30 08:22:01 2011 +++ src/lib/libc/citrus/citrus_iconv.c Sat Nov 19 18:34:21 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_iconv.c,v 1.9 2011/03/30 08:22:01 jruoho Exp $ */ +/* $NetBSD: citrus_iconv.c,v 1.10 2011/11/19 18:34:21 tnozaki Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -28,7 +28,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_iconv.c,v 1.9 2011/03/30 08:22:01 jruoho Exp $"); +__RCSID("$NetBSD: citrus_iconv.c,v 1.10 2011/11/19 18:34:21 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -222,8 +222,10 @@ open_shared(struct _citrus_iconv_shared ci->ci_ops->io_uninit_shared == NULL || ci->ci_ops->io_init_context == NULL || ci->ci_ops->io_uninit_context == NULL || - ci->ci_ops->io_convert == NULL) + ci->ci_ops->io_convert == NULL) { + ret = EINVAL; goto err; + } /* initialize the converter */ ret = (*ci->ci_ops->io_init_shared)(ci, basedir, src, dst,
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: tnozaki Date: Sat Nov 19 18:20:13 UTC 2011 Modified Files: src/lib/libc/citrus/modules: citrus_dechanyu.c citrus_viqr.c Log Message: remove unused variable, pointed by nonaka-san, thanks. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/libc/citrus/modules/citrus_dechanyu.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/citrus/modules/citrus_viqr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_dechanyu.c diff -u src/lib/libc/citrus/modules/citrus_dechanyu.c:1.3 src/lib/libc/citrus/modules/citrus_dechanyu.c:1.4 --- src/lib/libc/citrus/modules/citrus_dechanyu.c:1.3 Sat Jun 14 16:01:07 2008 +++ src/lib/libc/citrus/modules/citrus_dechanyu.c Sat Nov 19 18:20:13 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_dechanyu.c,v 1.3 2008/06/14 16:01:07 tnozaki Exp $ */ +/* $NetBSD: citrus_dechanyu.c,v 1.4 2011/11/19 18:20:13 tnozaki Exp $ */ /*- * Copyright (c)2007 Citrus Project, @@ -27,7 +27,7 @@ */ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_dechanyu.c,v 1.3 2008/06/14 16:01:07 tnozaki Exp $"); +__RCSID("$NetBSD: citrus_dechanyu.c,v 1.4 2011/11/19 18:20:13 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -187,7 +187,7 @@ _citrus_DECHanyu_mbrtowc_priv(_DECHanyuE _DECHanyuState * __restrict psenc, size_t * __restrict nresult) { const char *s0; - int ch, i; + int ch; wchar_t wc; /* ei may be unused */ Index: src/lib/libc/citrus/modules/citrus_viqr.c diff -u src/lib/libc/citrus/modules/citrus_viqr.c:1.4 src/lib/libc/citrus/modules/citrus_viqr.c:1.5 --- src/lib/libc/citrus/modules/citrus_viqr.c:1.4 Sat Jun 14 16:01:08 2008 +++ src/lib/libc/citrus/modules/citrus_viqr.c Sat Nov 19 18:20:13 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_viqr.c,v 1.4 2008/06/14 16:01:08 tnozaki Exp $ */ +/* $NetBSD: citrus_viqr.c,v 1.5 2011/11/19 18:20:13 tnozaki Exp $ */ /*- * Copyright (c)2006 Citrus Project, @@ -29,7 +29,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_viqr.c,v 1.4 2008/06/14 16:01:08 tnozaki Exp $"); +__RCSID("$NetBSD: citrus_viqr.c,v 1.5 2011/11/19 18:20:13 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -360,7 +360,7 @@ _citrus_VIQR_wcrtomb_priv(_VIQREncodingI _VIQRState * __restrict psenc, size_t * __restrict nresult) { mnemonic_t *m; - int ch, escape; + int ch; const char *p; _DIAGASSERT(ei != NULL);
CVS commit: src/dist/nvi/regex
Module Name:src Committed By: tnozaki Date: Sat Nov 19 17:45:11 UTC 2011 Modified Files: src/dist/nvi/regex: engine.c regcomp.c regex2.h Log Message: reliability fix, merge libc/regex fix to avoid memory exhaust problem. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/dist/nvi/regex/engine.c \ src/dist/nvi/regex/regcomp.c cvs rdiff -u -r1.3 -r1.4 src/dist/nvi/regex/regex2.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/dist/nvi/regex/engine.c diff -u src/dist/nvi/regex/engine.c:1.6 src/dist/nvi/regex/engine.c:1.7 --- src/dist/nvi/regex/engine.c:1.6 Sun Apr 12 14:47:51 2009 +++ src/dist/nvi/regex/engine.c Sat Nov 19 17:45:11 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: engine.c,v 1.6 2009/04/12 14:47:51 tnozaki Exp $ */ +/* $NetBSD: engine.c,v 1.7 2011/11/19 17:45:11 tnozaki Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 Henry Spencer. @@ -168,8 +168,8 @@ int eflags; /* prescreening; this does wonders for this rather slow code */ if (g->must != NULL) { for (dp = start; dp < stop; dp++) - if (*dp == g->must[0] && stop - dp >= g->mlen && -MEMCMP(dp, g->must, (size_t)g->mlen) == 0) + if (*dp == g->must[0] && (size_t)(stop - dp) >= g->mlen && +MEMCMP(dp, g->must, g->mlen) == 0) break; if (dp == stop) /* we didn't find g->must */ return(REG_NOMATCH); Index: src/dist/nvi/regex/regcomp.c diff -u src/dist/nvi/regex/regcomp.c:1.6 src/dist/nvi/regex/regcomp.c:1.7 --- src/dist/nvi/regex/regcomp.c:1.6 Mon Mar 21 14:53:03 2011 +++ src/dist/nvi/regex/regcomp.c Sat Nov 19 17:45:11 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: regcomp.c,v 1.6 2011/03/21 14:53:03 tnozaki Exp $ */ +/* $NetBSD: regcomp.c,v 1.7 2011/11/19 17:45:11 tnozaki Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 Henry Spencer. @@ -82,11 +82,11 @@ extern "C" { #endif /* === regcomp.c === */ -static void p_ere __P((struct parse *p, int stop)); -static void p_ere_exp __P((struct parse *p)); +static void p_ere __P((struct parse *p, int stop, size_t reclimit)); +static void p_ere_exp __P((struct parse *p, size_t reclimit)); static void p_str __P((struct parse *p)); -static void p_bre __P((struct parse *p, int end1, int end2)); -static int p_simp_re __P((struct parse *p, int starordinary)); +static void p_bre __P((struct parse *p, int end1, int end2, size_t reclimit)); +static int p_simp_re __P((struct parse *p, int starordinary, size_t reclimit)); static int p_count __P((struct parse *p)); static void p_bracket __P((struct parse *p)); static void p_b_term __P((struct parse *p, cset *cs)); @@ -98,7 +98,7 @@ static char othercase __P((int ch)); static void bothcases __P((struct parse *p, int ch)); static void ordinary __P((struct parse *p, int ch)); static void nonnewline __P((struct parse *p)); -static void repeat __P((struct parse *p, sopno start, int from, int to)); +static void repeat __P((struct parse *p, sopno start, int from, int to, size_t reclimit)); static int seterr __P((struct parse *p, int e)); static cset *allocset __P((struct parse *p)); static void freeset __P((struct parse *p, cset *cs)); @@ -122,7 +122,7 @@ static sopno dupl __P((struct parse *p, static void doemit __P((struct parse *p, sop op, size_t opnd)); static void doinsert __P((struct parse *p, sop op, size_t opnd, sopno pos)); static void dofwd __P((struct parse *p, sopno pos, sop value)); -static void enlarge __P((struct parse *p, sopno size)); +static int enlarge __P((struct parse *p, sopno size)); static void stripsnug __P((struct parse *p, struct re_guts *g)); static void findmust __P((struct parse *p, struct re_guts *g)); static sopno pluscount __P((struct parse *p, struct re_guts *g)); @@ -170,6 +170,13 @@ static int never = 0; /* for use in ass #define never 0 /* some s have bugs too */ #endif +#define MEMLIMIT 0x800 +#define MEMSIZE(p) \ + ((p)->ncsalloc / CHAR_BIT * (p)->g->csetsize + \ + (p)->ncsalloc * sizeof(cset) + \ + (p)->ssize * sizeof(sop)) +#define RECLIMIT 256 + /* - regcomp - interface for parser and compilation = extern int regcomp(regex_t *, const RCHAR_T *, int); @@ -258,11 +265,11 @@ regcomp(regex_t *preg, const RCHAR_T *pa EMIT(OEND, 0); g->firststate = THERE(); if (cflags®_EXTENDED) - p_ere(p, OUT); + p_ere(p, OUT, 0); else if (cflags®_NOSPEC) p_str(p); else - p_bre(p, OUT, OUT); + p_bre(p, OUT, OUT, 0); EMIT(OEND, 0); g->laststate = THERE(); @@ -289,10 +296,10 @@ regcomp(regex_t *preg, const RCHAR_T *pa /* - p_ere - ERE parser top level, concatenation and alternation - == static void p_ere(register struct parse *p, int stop); + == static void p_ere(register struct parse *p, int stop, size_t reclimit); */ static void -p_ere(register struct parse *p, int stop) +p_ere(register struct parse *p, int stop, size_t reclimit) /* character this ERE should end at */ { @@ -302,11 +309,16 @@ p_ere(register st
CVS commit: src/share/misc
Module Name:src Committed By: mbalmer Date: Sat Nov 19 17:40:19 UTC 2011 Modified Files: src/share/misc: acronyms Log Message: One more. To generate a diff of this commit: cvs rdiff -u -r1.208 -r1.209 src/share/misc/acronyms Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/misc/acronyms diff -u src/share/misc/acronyms:1.208 src/share/misc/acronyms:1.209 --- src/share/misc/acronyms:1.208 Sat Nov 19 17:38:58 2011 +++ src/share/misc/acronyms Sat Nov 19 17:40:19 2011 @@ -1,4 +1,4 @@ -$NetBSD: acronyms,v 1.208 2011/11/19 17:38:58 mbalmer Exp $ +$NetBSD: acronyms,v 1.209 2011/11/19 17:40:19 mbalmer Exp $ 10Q thank you 10X thanks 1337 elite ("leet") @@ -72,6 +72,7 @@ BOHICA bend over here it comes again BOT back on topic BRB [I'll] be right back BS bullshit +BSD booze, sex, drugs BTDT been there, done that BTFT been there, fixed that BTTH boot to the head
CVS commit: src/share/misc
Module Name:src Committed By: mbalmer Date: Sat Nov 19 17:38:58 UTC 2011 Modified Files: src/share/misc: acronyms Log Message: Add a few. To generate a diff of this commit: cvs rdiff -u -r1.207 -r1.208 src/share/misc/acronyms Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/misc/acronyms diff -u src/share/misc/acronyms:1.207 src/share/misc/acronyms:1.208 --- src/share/misc/acronyms:1.207 Sun Aug 28 08:41:01 2011 +++ src/share/misc/acronyms Sat Nov 19 17:38:58 2011 @@ -1,4 +1,4 @@ -$NetBSD: acronyms,v 1.207 2011/08/28 08:41:01 jnemeth Exp $ +$NetBSD: acronyms,v 1.208 2011/11/19 17:38:58 mbalmer Exp $ 10Q thank you 10X thanks 1337 elite ("leet") @@ -104,7 +104,9 @@ DTRT do the right thing DTWT do the wrong thing DYK do you know? DWIM do what I mean +ECR electronic cash register EDS eternal downward spiral +EFT electronic funds transfer EG evil grin EIE enough is enough EMSG email message @@ -373,6 +375,7 @@ POC proof of concept POLA principle of least astonishment POLS principle of least surprise POS piece of shit +POS point of sale POV point of view PPL people PPL pretty please
CVS commit: src/sys/kern
Module Name:src Committed By: christos Date: Sat Nov 19 17:34:41 UTC 2011 Modified Files: src/sys/kern: cnmagic.c Log Message: Apply the better patch in the PR. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/kern/cnmagic.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/cnmagic.c diff -u src/sys/kern/cnmagic.c:1.12 src/sys/kern/cnmagic.c:1.13 --- src/sys/kern/cnmagic.c:1.12 Sat Nov 19 11:11:24 2011 +++ src/sys/kern/cnmagic.c Sat Nov 19 12:34:41 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: cnmagic.c,v 1.12 2011/11/19 16:11:24 christos Exp $ */ +/* $NetBSD: cnmagic.c,v 1.13 2011/11/19 17:34:41 christos Exp $ */ /* * Copyright (c) 2000 Eduardo Horvath @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cnmagic.c,v 1.12 2011/11/19 16:11:24 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cnmagic.c,v 1.13 2011/11/19 17:34:41 christos Exp $"); #include #include @@ -69,33 +69,24 @@ cn_set_magic(const char *smagic) for (i = 0; i < CNS_LEN; i++) { c = *magic++; - if (c == '\0') - return EINVAL; - n = *magic ? i + 1 : CNS_TERM; switch (c) { - case '\0': + case 0: /* End of string */ if (i == 0) { /* empty string? */ -cn_magic[0] = 0; #ifdef DEBUG printf("cn_set_magic(): empty!\n"); #endif -return 0; } - do + cn_magic[i] = 0; + while (i--) cn_magic[i] = m[i]; - while (i--); return 0; - - case '\'': + case 0x27: /* Escape sequence */ c = *magic++; - if (c == '\0') -return EINVAL; - n = *magic ? i + 1 : CNS_TERM; switch (c) { - case '\'': + case 0x27: break; case 0x01: /* BREAK */ @@ -103,12 +94,13 @@ cn_set_magic(const char *smagic) break; case 0x02: /* NUL */ -c = '\0'; +c = 0; break; } - /*FALLTHROUGH*/ + /* FALLTHROUGH */ default: /* Transition to the next state. */ + n = *magic ? i + 1 : CNS_TERM; #ifdef DEBUG if (!cold) aprint_normal("mag %d %x:%x\n", i, c, n); @@ -127,36 +119,51 @@ cn_set_magic(const char *smagic) int cn_get_magic(char *magic, size_t maglen) { - size_t i, c; + size_t i, n = 0; + +#define ADD_CHAR(x) \ +do \ + if (n < maglen) \ + magic[n++] = (x); \ + else \ + goto error; \ +while (/*CONSTCOND*/0) + + for (i = 0; i < CNS_LEN; /* empty */) { + unsigned short c = cn_magic[i]; + i = CNS_MAGIC_NEXT(c); + if (i == 0) + goto finish; - for (i = 0; i < CNS_LEN;) { - c = cn_magic[i]; /* Translate a character */ switch (CNS_MAGIC_VAL(c)) { case CNC_BREAK: - *magic++ = 0x27; - *magic++ = 0x01; + ADD_CHAR(0x27); + ADD_CHAR(0x01); break; case 0: - *magic++ = 0x27; - *magic++ = 0x02; + ADD_CHAR(0x27); + ADD_CHAR(0x02); break; case 0x27: - *magic++ = 0x27; - *magic++ = 0x27; + ADD_CHAR(0x27); + ADD_CHAR(0x27); break; default: - *magic++ = (c & 0x0ff); + ADD_CHAR(c); break; } /* Now go to the next state */ - i = CNS_MAGIC_NEXT(c); - if (i == CNS_TERM || i == 0) { - /* Either termination state or empty machine */ - *magic++ = 0; - return (0); - } + if (i == CNS_TERM) + goto finish; } - return (EINVAL); + +error: + return EINVAL; + +finish: + /* Either termination state or empty machine */ + ADD_CHAR('\0'); + return 0; }
CVS commit: src/etc
Module Name:src Committed By: mbalmer Date: Sat Nov 19 17:30:09 UTC 2011 Modified Files: src/etc: gpio.conf Log Message: Better wording. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/etc/gpio.conf Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/gpio.conf diff -u src/etc/gpio.conf:1.1 src/etc/gpio.conf:1.2 --- src/etc/gpio.conf:1.1 Sat Jul 25 16:20:10 2009 +++ src/etc/gpio.conf Sat Nov 19 17:30:09 2011 @@ -1,11 +1,11 @@ -# $NetBSD: gpio.conf,v 1.1 2009/07/25 16:20:10 mbalmer Exp $ +# $NetBSD: gpio.conf,v 1.2 2011/11/19 17:30:09 mbalmer Exp $ # # GPIO device and pin configuration -# The syntax is exactly like the gpioctl(8) command, but without the -# gpioctl word. +# The syntax of this file is like the command line arguments to the gpioctl(8) +# command. # -# E.g. define pin 6 of /dev/gpio0 as output and name it error_led: -# /dev/gpio0 6 set out error_led +# E.g. to define pin 6 of /dev/gpio0 as output and name it error_led, write +# gpio0 6 set out error_led # Empty lines and lines starting with # are ignored.
CVS commit: src/sys/arch/zaurus/conf
Module Name:src Committed By: nonaka Date: Sat Nov 19 17:17:42 UTC 2011 Modified Files: src/sys/arch/zaurus/conf: INSTALL Log Message: disable kloader(4). To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/zaurus/conf/INSTALL 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/zaurus/conf/INSTALL diff -u src/sys/arch/zaurus/conf/INSTALL:1.10 src/sys/arch/zaurus/conf/INSTALL:1.11 --- src/sys/arch/zaurus/conf/INSTALL:1.10 Sun Jun 19 16:20:09 2011 +++ src/sys/arch/zaurus/conf/INSTALL Sat Nov 19 17:17:41 2011 @@ -1,4 +1,4 @@ -# $NetBSD: INSTALL,v 1.10 2011/06/19 16:20:09 nonaka Exp $ +# $NetBSD: INSTALL,v 1.11 2011/11/19 17:17:41 nonaka Exp $ # # INSTALL config file (GENERIC with memory disk root) # @@ -18,6 +18,8 @@ options MEMORY_DISK_RBFLAGS=RB_SINGLE # makeoptions COPTS="-Os" +no options KLOADER + no options INSECURE no file-system KERNFS
CVS commit: src/sys/arch/zaurus/conf
Module Name:src Committed By: nonaka Date: Sat Nov 19 17:15:58 UTC 2011 Modified Files: src/sys/arch/zaurus/conf: GENERIC Log Message: enable kloader(4). To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sys/arch/zaurus/conf/GENERIC Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/zaurus/conf/GENERIC diff -u src/sys/arch/zaurus/conf/GENERIC:1.45 src/sys/arch/zaurus/conf/GENERIC:1.46 --- src/sys/arch/zaurus/conf/GENERIC:1.45 Fri Jul 15 13:47:12 2011 +++ src/sys/arch/zaurus/conf/GENERIC Sat Nov 19 17:15:58 2011 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.45 2011/07/15 13:47:12 nonaka Exp $ +# $NetBSD: GENERIC,v 1.46 2011/11/19 17:15:58 nonaka Exp $ # # GENERIC machine description file # @@ -36,7 +36,7 @@ options XSCALE_CACHE_READ_WRITE_ALLOCAT options PXAGPIO_HAS_GPION_INTRS # in-kernel bootloader, see kloader(4) -#options KLOADER +options KLOADER #options KLOADER_KERNEL_PATH="\"/netbsd\"" #options KLOADER_DEBUG
CVS commit: src/sys/arch
Module Name:src Committed By: cherry Date: Sat Nov 19 17:13:39 UTC 2011 Modified Files: src/sys/arch/x86/include: cpu.h src/sys/arch/xen/include: hypervisor.h src/sys/arch/xen/x86: hypervisor_machdep.c src/sys/arch/xen/xen: evtchn.c Log Message: [merging from cherry-xenmp] bring in bouyer@'s changes via: http://mail-index.netbsd.org/source-changes/2011/10/22/msg028271.html >From the Log: Log Message: Various interrupt fixes, mainly: keep a per-cpu mask of enabled events, and use it to get pending events. A cpu-specific event (all of them at this time) should not be ever masked by another CPU, because it may prevent the target CPU from seeing it (the clock events all fires at once for example). To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/sys/arch/x86/include/cpu.h cvs rdiff -u -r1.34 -r1.35 src/sys/arch/xen/include/hypervisor.h cvs rdiff -u -r1.16 -r1.17 src/sys/arch/xen/x86/hypervisor_machdep.c cvs rdiff -u -r1.55 -r1.56 src/sys/arch/xen/xen/evtchn.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/cpu.h diff -u src/sys/arch/x86/include/cpu.h:1.42 src/sys/arch/x86/include/cpu.h:1.43 --- src/sys/arch/x86/include/cpu.h:1.42 Thu Nov 10 00:12:05 2011 +++ src/sys/arch/x86/include/cpu.h Sat Nov 19 17:13:39 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.42 2011/11/10 00:12:05 jym Exp $ */ +/* $NetBSD: cpu.h,v 1.43 2011/11/19 17:13:39 cherry Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -126,6 +126,7 @@ struct cpu_info { #ifdef XEN struct iplsource *ci_isources[NIPL]; + u_long ci_evtmask[NR_EVENT_CHANNELS]; /* events allowed on this CPU */ #else struct intrsource *ci_isources[MAX_INTR_SOURCES]; #endif Index: src/sys/arch/xen/include/hypervisor.h diff -u src/sys/arch/xen/include/hypervisor.h:1.34 src/sys/arch/xen/include/hypervisor.h:1.35 --- src/sys/arch/xen/include/hypervisor.h:1.34 Sun Nov 6 11:40:47 2011 +++ src/sys/arch/xen/include/hypervisor.h Sat Nov 19 17:13:39 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: hypervisor.h,v 1.34 2011/11/06 11:40:47 cherry Exp $ */ +/* $NetBSD: hypervisor.h,v 1.35 2011/11/19 17:13:39 cherry Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -134,6 +134,7 @@ void do_hypervisor_callback(struct intrf void hypervisor_enable_event(unsigned int); /* hypervisor_machdep.c */ +void hypervisor_send_event(struct cpu_info *, unsigned int); void hypervisor_unmask_event(unsigned int); void hypervisor_mask_event(unsigned int); void hypervisor_clear_event(unsigned int); Index: src/sys/arch/xen/x86/hypervisor_machdep.c diff -u src/sys/arch/xen/x86/hypervisor_machdep.c:1.16 src/sys/arch/xen/x86/hypervisor_machdep.c:1.17 --- src/sys/arch/xen/x86/hypervisor_machdep.c:1.16 Tue Sep 20 00:12:24 2011 +++ src/sys/arch/xen/x86/hypervisor_machdep.c Sat Nov 19 17:13:39 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: hypervisor_machdep.c,v 1.16 2011/09/20 00:12:24 jym Exp $ */ +/* $NetBSD: hypervisor_machdep.c,v 1.17 2011/11/19 17:13:39 cherry Exp $ */ /* * @@ -54,7 +54,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.16 2011/09/20 00:12:24 jym Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.17 2011/11/19 17:13:39 cherry Exp $"); #include #include @@ -109,6 +109,7 @@ evt_iterate_bits(struct cpu_info *ci, vo l1 &= ~(1UL << l1i); l2 = pendingl2[l1i] & (mask != NULL ? ~mask[l1i] : -1UL); + l2 &= ci->ci_evtmask[l1i]; if (mask != NULL) xen_atomic_setbits_l(&mask[l1i], l2); xen_atomic_clearbits_l(&pendingl2[l1i], l2); @@ -140,8 +141,8 @@ evt_set_pending(struct cpu_info *ci, uns int *ret = args; if (evtsource[port]) { - hypervisor_set_ipending(ci, evtsource[port]->ev_imask, - l1i, l2i); + hypervisor_set_ipending(evtsource[port]->ev_cpu, + evtsource[port]->ev_imask, l1i, l2i); evtsource[port]->ev_evcnt.ev_count++; if (*ret == 0 && ci->ci_ilevel < evtsource[port]->ev_maxlevel) @@ -281,6 +282,36 @@ do_hypervisor_callback(struct intrframe } void +hypervisor_send_event(struct cpu_info *ci, unsigned int ev) +{ + KASSERT(ci != NULL); + + volatile shared_info_t *s = HYPERVISOR_shared_info; + volatile struct vcpu_info *vci = ci->ci_vcpu; + +#ifdef PORT_DEBUG + if (ev == PORT_DEBUG) + printf("hypervisor_send_event %d\n", ev); +#endif + + xen_atomic_set_bit(&s->evtchn_pending[0], ev); + xen_atomic_set_bit(&vci->evtchn_pending_sel, + ev >> LONG_SHIFT); + + xen_atomic_set_bit(&vci->evtchn_upcall_pending, 0); + + xen_atomic_clear_bit(&s->evtchn_mask[0], ev); + + if (__predict_true(ci == curcpu())) { + hypervisor_force_callback(); + } else { + if (xen_send_ipi(ci, XEN_IPI_HVCB)) { + panic("xen_send_ipi(cpu%d, XEN_IPI_HVCB) failed\n", (int) ci->ci_cpuid); + } + } +} + +void hypervisor_unmask_event(unsigned int ev) { volatile shared_info_t *s = HYPERVISOR_shared_info; @@ -375,6 +406,13 @@ hype
CVS commit: src/sys/dev/marvell
Module Name:src Committed By: jakllsch Date: Sat Nov 19 17:01:38 UTC 2011 Modified Files: src/sys/dev/marvell: if_mvgbe.c Log Message: Add workaround for infrequently encountered DMA engine limitation. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/dev/marvell/if_mvgbe.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/marvell/if_mvgbe.c diff -u src/sys/dev/marvell/if_mvgbe.c:1.13 src/sys/dev/marvell/if_mvgbe.c:1.14 --- src/sys/dev/marvell/if_mvgbe.c:1.13 Tue Sep 6 19:38:23 2011 +++ src/sys/dev/marvell/if_mvgbe.c Sat Nov 19 17:01:38 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: if_mvgbe.c,v 1.13 2011/09/06 19:38:23 rjs Exp $ */ +/* $NetBSD: if_mvgbe.c,v 1.14 2011/11/19 17:01:38 jakllsch Exp $ */ /* * Copyright (c) 2007, 2008 KIYOHARA Takashi * All rights reserved. @@ -25,7 +25,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.13 2011/09/06 19:38:23 rjs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.14 2011/11/19 17:01:38 jakllsch Exp $"); #include "rnd.h" @@ -1517,6 +1517,7 @@ mvgbe_encap(struct mvgbe_softc *sc, stru bus_dmamap_t txmap; uint32_t first, current, last, cmdsts = 0; int m_csumflags, i; + bool needs_defrag = false; DPRINTFN(3, ("mvgbe_encap\n")); @@ -1535,6 +1536,16 @@ mvgbe_encap(struct mvgbe_softc *sc, stru */ m_csumflags = m_head->m_pkthdr.csum_flags; +do_defrag: + if (__predict_false(needs_defrag == true)) { + /* A small unaligned segment was detected. */ + struct mbuf *m_new; + m_new = m_defrag(m_head, M_DONTWAIT); + if (m_new == NULL) + return EFBIG; + m_head = m_new; + } + /* * Start packing the mbufs in this chain into * the fragment pointers. Stop when we run out @@ -1545,6 +1556,25 @@ mvgbe_encap(struct mvgbe_softc *sc, stru return ENOBUFS; } + txseg = txmap->dm_segs; + + if (__predict_true(needs_defrag == false)) { + /* + * Detect rarely encountered DMA limitation. + */ + for (i = 0; i < txmap->dm_nsegs; i++) { + if (((txseg[i].ds_addr & 7) != 0) && + (txseg[i].ds_len <= 8) && + (txseg[i].ds_len >= 1) + ) { +txseg = NULL; +bus_dmamap_unload(sc->sc_dmat, txmap); +needs_defrag = true; +goto do_defrag; + } + } + } + /* Sync the DMA map. */ bus_dmamap_sync(sc->sc_dmat, txmap, 0, txmap->dm_mapsize, BUS_DMASYNC_PREWRITE); @@ -1556,7 +1586,6 @@ mvgbe_encap(struct mvgbe_softc *sc, stru return ENOBUFS; } - txseg = txmap->dm_segs; DPRINTFN(2, ("mvgbe_encap: dm_nsegs=%d\n", txmap->dm_nsegs));
CVS commit: src
Module Name:src Committed By: agc Date: Sat Nov 19 16:41:56 UTC 2011 Modified Files: src/etc: MAKEDEV.tmpl src/sys/conf: majors src/sys/dev/iscsi: iscsi.h Log Message: grab major 203 for the iSCSI communications device (between kernel driver and /sbin/iscsid) To generate a diff of this commit: cvs rdiff -u -r1.147 -r1.148 src/etc/MAKEDEV.tmpl cvs rdiff -u -r1.59 -r1.60 src/sys/conf/majors cvs rdiff -u -r1.2 -r1.3 src/sys/dev/iscsi/iscsi.h 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.147 src/etc/MAKEDEV.tmpl:1.148 --- src/etc/MAKEDEV.tmpl:1.147 Tue Nov 8 19:36:30 2011 +++ src/etc/MAKEDEV.tmpl Sat Nov 19 16:41:55 2011 @@ -1,5 +1,5 @@ #!/bin/sh - -# $NetBSD: MAKEDEV.tmpl,v 1.147 2011/11/08 19:36:30 apb Exp $ +# $NetBSD: MAKEDEV.tmpl,v 1.148 2011/11/19 16:41:55 agc Exp $ # # Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc. # All rights reserved. @@ -289,6 +289,9 @@ # wsfont* console font control # wsmux* wscons event multiplexor # xenevt Xen event interface +# +# iSCSI communication devices +# iscsi* iSCSI driver and /sbin/iscsid communication # @@ -2092,6 +2095,11 @@ zfs) makedir zpool 755 ;; +iscsi[0-9]*) + unit=${i#iscsi} + mkdev iscsi${unit} c %iscsi_chr% 0 600 + ;; + midevend) %MI_DEVICES_END% local) Index: src/sys/conf/majors diff -u src/sys/conf/majors:1.59 src/sys/conf/majors:1.60 --- src/sys/conf/majors:1.59 Sat Oct 15 10:18:24 2011 +++ src/sys/conf/majors Sat Nov 19 16:41:56 2011 @@ -1,4 +1,4 @@ -# $NetBSD: majors,v 1.59 2011/10/15 10:18:24 tron Exp $ +# $NetBSD: majors,v 1.60 2011/11/19 16:41:56 agc Exp $ # # Device majors for Machine-Independent drivers. # @@ -48,4 +48,5 @@ device-major flash char 199 block 19 device-major dtv char 200dtv device-major iic char 201iic device-major filemon char 202filemon +device-major iscsi char 203iscsi Index: src/sys/dev/iscsi/iscsi.h diff -u src/sys/dev/iscsi/iscsi.h:1.2 src/sys/dev/iscsi/iscsi.h:1.3 --- src/sys/dev/iscsi/iscsi.h:1.2 Sat Oct 29 16:04:39 2011 +++ src/sys/dev/iscsi/iscsi.h Sat Nov 19 16:41:56 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: iscsi.h,v 1.2 2011/10/29 16:04:39 christos Exp $ */ +/* $NetBSD: iscsi.h,v 1.3 2011/11/19 16:41:56 agc Exp $ */ /*- * Copyright (c) 2004,2006,2011 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #ifndef _ISCSI_H #define _ISCSI_H -#define ISCSI_DEV_MAJOR202 +#define ISCSI_DEV_MAJOR203 #define ISCSI_STRING_LENGTH (223+1) #define ISCSI_ADDRESS_LENGTH (255+1)
CVS commit: src/sys/kern
Module Name:src Committed By: christos Date: Sat Nov 19 16:11:24 UTC 2011 Modified Files: src/sys/kern: cnmagic.c Log Message: PR/45633: Christian Biere: Don't access byte after NUL when setting magic. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/kern/cnmagic.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/cnmagic.c diff -u src/sys/kern/cnmagic.c:1.11 src/sys/kern/cnmagic.c:1.12 --- src/sys/kern/cnmagic.c:1.11 Sat Jan 30 19:43:37 2010 +++ src/sys/kern/cnmagic.c Sat Nov 19 11:11:24 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: cnmagic.c,v 1.11 2010/01/31 00:43:37 hubertf Exp $ */ +/* $NetBSD: cnmagic.c,v 1.12 2011/11/19 16:11:24 christos Exp $ */ /* * Copyright (c) 2000 Eduardo Horvath @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cnmagic.c,v 1.11 2010/01/31 00:43:37 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cnmagic.c,v 1.12 2011/11/19 16:11:24 christos Exp $"); #include #include @@ -61,16 +61,19 @@ cn_destroy_magic(cnm_state_t *cnm) * machine table. */ int -cn_set_magic(const char *magic) +cn_set_magic(const char *smagic) { - unsigned int i, c, n; + const unsigned char *magic = (const unsigned char *)smagic; + unsigned short i, c, n; unsigned short m[CNS_LEN]; for (i = 0; i < CNS_LEN; i++) { - c = (*magic++) & 0xff; - n = *magic ? i+1 : CNS_TERM; + c = *magic++; + if (c == '\0') + return EINVAL; + n = *magic ? i + 1 : CNS_TERM; switch (c) { - case 0: + case '\0': /* End of string */ if (i == 0) { /* empty string? */ @@ -78,18 +81,21 @@ cn_set_magic(const char *magic) #ifdef DEBUG printf("cn_set_magic(): empty!\n"); #endif -return (0); +return 0; } - do { + do cn_magic[i] = m[i]; - } while (i--); - return(0); - case 0x27: + while (i--); + return 0; + + case '\'': /* Escape sequence */ - c = (*magic++) & 0xff; - n = *magic ? i+1 : CNS_TERM; + c = *magic++; + if (c == '\0') +return EINVAL; + n = *magic ? i + 1 : CNS_TERM; switch (c) { - case 0x27: + case '\'': break; case 0x01: /* BREAK */ @@ -97,10 +103,10 @@ cn_set_magic(const char *magic) break; case 0x02: /* NUL */ -c = 0; +c = '\0'; break; } - /* FALLTHROUGH */ + /*FALLTHROUGH*/ default: /* Transition to the next state. */ #ifdef DEBUG @@ -111,7 +117,7 @@ cn_set_magic(const char *magic) break; } } - return (EINVAL); + return EINVAL; } /*
CVS commit: [netbsd-4] src/doc
Module Name:src Committed By: bouyer Date: Sat Nov 19 14:40:07 UTC 2011 Modified Files: src/doc [netbsd-4]: CHANGES-4.1 Log Message: Tickets 1432, 1436, 1438, 1439 To generate a diff of this commit: cvs rdiff -u -r1.1.2.229 -r1.1.2.230 src/doc/CHANGES-4.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-4.1 diff -u src/doc/CHANGES-4.1:1.1.2.229 src/doc/CHANGES-4.1:1.1.2.230 --- src/doc/CHANGES-4.1:1.1.2.229 Wed Nov 2 18:29:10 2011 +++ src/doc/CHANGES-4.1 Sat Nov 19 14:40:07 2011 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-4.1,v 1.1.2.229 2011/11/02 18:29:10 riz Exp $ +# $NetBSD: CHANGES-4.1,v 1.1.2.230 2011/11/19 14:40:07 bouyer Exp $ A complete list of changes from the NetBSD 4.0 release to the NetBSD 4.1 release: @@ -4522,3 +4522,41 @@ share/zoneinfo/zone.tab patch Update to tzdata2011n. [apb, ticket #1435] +lib/librmt/rmtlib.c1.23, 1.24 + + Improve isrmt() check: it cannot be a rmt fd if there are no pipes + open for the fd. Prevents collision with rumphijack. + Also, prevent potential hyperspace memory access. + + PR/38413: Takahiro Kambe: mt(1) print some junk output when using + remote tape + Not all fields are valid in the ioctl to get tape info in the rmt + protocol. Zero out the struct so that we don't print junk. + [dholland, ticket #1432] + +sys/uvm/uvm_meter.c1.57 via patch + + if you are going to dereference a variable, check the variable itself, + not it cousin. + [christos, ticket #1436] + +sys/kern/kern_event.c1.73 + + PR/45618: Motoyuki OHMORI: kqueue EVFILT_TIMER with smaller timeout + value makes DIAGNOSTIC kernel panic: + KASSERT((c->c_flags & CALLOUT_PENDING) !=3D 0); + If the computed ticks are <= 0 set it to 1 + [christos, ticket #1438] + +dist/openpam/lib/openpam_configure.c 1.6 + + Don't allow '/' characters in the "service" argument to pam_start() + The "service" is blindly appended to config directories ("/etc/pam.d/"), + and if a user can control the "service" it can get PAM to read config + files from any location. + This is not a problem with most software because the "service" is + usually a constant string. The check protects 3rd party software + from being abused. + (CVE-2011-4122) + [drochner, ticket #1439] +
CVS commit: [netbsd-4-0] src/doc
Module Name:src Committed By: bouyer Date: Sat Nov 19 14:40:08 UTC 2011 Modified Files: src/doc [netbsd-4-0]: CHANGES-4.0.2 Log Message: Tickets 1436, 1438, 1439 To generate a diff of this commit: cvs rdiff -u -r1.1.2.90 -r1.1.2.91 src/doc/CHANGES-4.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-4.0.2 diff -u src/doc/CHANGES-4.0.2:1.1.2.90 src/doc/CHANGES-4.0.2:1.1.2.91 --- src/doc/CHANGES-4.0.2:1.1.2.90 Wed Nov 2 18:30:16 2011 +++ src/doc/CHANGES-4.0.2 Sat Nov 19 14:40:08 2011 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-4.0.2,v 1.1.2.90 2011/11/02 18:30:16 riz Exp $ +# $NetBSD: CHANGES-4.0.2,v 1.1.2.91 2011/11/19 14:40:08 bouyer Exp $ A complete list of changes from the NetBSD 4.0.1 release to the NetBSD 4.0.2 release: @@ -1273,3 +1273,29 @@ share/zoneinfo/zone.tab patch Update to tzdata2011n. [apb, ticket #1435] +sys/uvm/uvm_meter.c1.57 via patch + + if you are going to dereference a variable, check the variable itself, + not it cousin. + [christos, ticket #1436] + +sys/kern/kern_event.c1.73 + + PR/45618: Motoyuki OHMORI: kqueue EVFILT_TIMER with smaller timeout + value makes DIAGNOSTIC kernel panic: + KASSERT((c->c_flags & CALLOUT_PENDING) !=3D 0); + If the computed ticks are <= 0 set it to 1 + [christos, ticket #1438] + +dist/openpam/lib/openpam_configure.c 1.6 + + Don't allow '/' characters in the "service" argument to pam_start() + The "service" is blindly appended to config directories ("/etc/pam.d/"), + and if a user can control the "service" it can get PAM to read config + files from any location. + This is not a problem with most software because the "service" is + usually a constant string. The check protects 3rd party software + from being abused. + (CVE-2011-4122) + [drochner, ticket #1439] +
CVS commit: [netbsd-4-0] src/dist/openpam/lib
Module Name:src Committed By: bouyer Date: Sat Nov 19 14:38:31 UTC 2011 Modified Files: src/dist/openpam/lib [netbsd-4-0]: openpam_configure.c Log Message: Pull up following revision(s) (requested by drochner in ticket #1439): dist/openpam/lib/openpam_configure.c: revision 1.6 Don't allow '/' characters in the "service" argument to pam_start() The "service" is blindly appended to config directories ("/etc/pam.d/"), and if a user can control the "service" it can get PAM to read config files from any location. This is not a problem with most software because the "service" is usually a constant string. The check protects 3rd party software from being abused. (CVE-2011-4122) To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.4.20.1 src/dist/openpam/lib/openpam_configure.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/dist/openpam/lib/openpam_configure.c diff -u src/dist/openpam/lib/openpam_configure.c:1.4 src/dist/openpam/lib/openpam_configure.c:1.4.20.1 --- src/dist/openpam/lib/openpam_configure.c:1.4 Wed Mar 16 15:28:55 2005 +++ src/dist/openpam/lib/openpam_configure.c Sat Nov 19 14:38:31 2011 @@ -288,6 +288,12 @@ openpam_load_chain(pam_handle_t *pamh, size_t len; int r; + /* don't allow to escape from policy_path */ + if (strchr(service, '/')) { + openpam_log(PAM_LOG_ERROR, "illegal service \"%s\"", service); + return (-PAM_SYSTEM_ERR); + } + for (path = openpam_policy_path; *path != NULL; ++path) { len = strlen(*path); if ((*path)[len - 1] == '/') {
CVS commit: [netbsd-4] src/dist/openpam/lib
Module Name:src Committed By: bouyer Date: Sat Nov 19 14:38:29 UTC 2011 Modified Files: src/dist/openpam/lib [netbsd-4]: openpam_configure.c Log Message: Pull up following revision(s) (requested by drochner in ticket #1439): dist/openpam/lib/openpam_configure.c: revision 1.6 Don't allow '/' characters in the "service" argument to pam_start() The "service" is blindly appended to config directories ("/etc/pam.d/"), and if a user can control the "service" it can get PAM to read config files from any location. This is not a problem with most software because the "service" is usually a constant string. The check protects 3rd party software from being abused. (CVE-2011-4122) To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.4.10.1 src/dist/openpam/lib/openpam_configure.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/dist/openpam/lib/openpam_configure.c diff -u src/dist/openpam/lib/openpam_configure.c:1.4 src/dist/openpam/lib/openpam_configure.c:1.4.10.1 --- src/dist/openpam/lib/openpam_configure.c:1.4 Wed Mar 16 15:28:55 2005 +++ src/dist/openpam/lib/openpam_configure.c Sat Nov 19 14:38:29 2011 @@ -288,6 +288,12 @@ openpam_load_chain(pam_handle_t *pamh, size_t len; int r; + /* don't allow to escape from policy_path */ + if (strchr(service, '/')) { + openpam_log(PAM_LOG_ERROR, "illegal service \"%s\"", service); + return (-PAM_SYSTEM_ERR); + } + for (path = openpam_policy_path; *path != NULL; ++path) { len = strlen(*path); if ((*path)[len - 1] == '/') {
CVS commit: [netbsd-4-0] src/sys/kern
Module Name:src Committed By: bouyer Date: Sat Nov 19 14:37:09 UTC 2011 Modified Files: src/sys/kern [netbsd-4-0]: kern_event.c Log Message: Pull up following revision(s) (requested by christos in ticket #1438): sys/kern/kern_event.c: revision 1.73 PR/45618: Motoyuki OHMORI: kqueue EVFILT_TIMER with smaller timeout value makes DIAGNOSTIC kernel panic: KASSERT((c->c_flags & CALLOUT_PENDING) !=3D 0); If the computed ticks are <= 0 set it to 1 To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.33.8.1 src/sys/kern/kern_event.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_event.c diff -u src/sys/kern/kern_event.c:1.33 src/sys/kern/kern_event.c:1.33.8.1 --- src/sys/kern/kern_event.c:1.33 Wed Nov 1 10:17:58 2006 +++ src/sys/kern/kern_event.c Sat Nov 19 14:37:09 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_event.c,v 1.33 2006/11/01 10:17:58 yamt Exp $ */ +/* $NetBSD: kern_event.c,v 1.33.8.1 2011/11/19 14:37:09 bouyer Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.33 2006/11/01 10:17:58 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.33.8.1 2011/11/19 14:37:09 bouyer Exp $"); #include #include @@ -505,6 +505,8 @@ filt_timerexpire(void *knx) if ((kn->kn_flags & EV_ONESHOT) == 0) { tticks = mstohz(kn->kn_sdata); + if (tticks <= 0) + tticks = 1; callout_schedule((struct callout *)kn->kn_hook, tticks); } }
CVS commit: [netbsd-4] src/sys/kern
Module Name:src Committed By: bouyer Date: Sat Nov 19 14:37:02 UTC 2011 Modified Files: src/sys/kern [netbsd-4]: kern_event.c Log Message: Pull up following revision(s) (requested by christos in ticket #1438): sys/kern/kern_event.c: revision 1.73 PR/45618: Motoyuki OHMORI: kqueue EVFILT_TIMER with smaller timeout value makes DIAGNOSTIC kernel panic: KASSERT((c->c_flags & CALLOUT_PENDING) !=3D 0); If the computed ticks are <= 0 set it to 1 To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.33.2.1 src/sys/kern/kern_event.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_event.c diff -u src/sys/kern/kern_event.c:1.33 src/sys/kern/kern_event.c:1.33.2.1 --- src/sys/kern/kern_event.c:1.33 Wed Nov 1 10:17:58 2006 +++ src/sys/kern/kern_event.c Sat Nov 19 14:37:02 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_event.c,v 1.33 2006/11/01 10:17:58 yamt Exp $ */ +/* $NetBSD: kern_event.c,v 1.33.2.1 2011/11/19 14:37:02 bouyer Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.33 2006/11/01 10:17:58 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.33.2.1 2011/11/19 14:37:02 bouyer Exp $"); #include #include @@ -505,6 +505,8 @@ filt_timerexpire(void *knx) if ((kn->kn_flags & EV_ONESHOT) == 0) { tticks = mstohz(kn->kn_sdata); + if (tticks <= 0) + tticks = 1; callout_schedule((struct callout *)kn->kn_hook, tticks); } }
CVS commit: [netbsd-4-0] src/sys/uvm
Module Name:src Committed By: bouyer Date: Sat Nov 19 14:21:43 UTC 2011 Modified Files: src/sys/uvm [netbsd-4-0]: uvm_meter.c Log Message: Pull up following revision(s) (requested by christos in ticket #1436): sys/uvm/uvm_meter.c: revision 1.57 via patch if you are going to dereference a variable, check the variable itself, not it cousin. To generate a diff of this commit: cvs rdiff -u -r1.43.2.1 -r1.43.2.1.4.1 src/sys/uvm/uvm_meter.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/uvm/uvm_meter.c diff -u src/sys/uvm/uvm_meter.c:1.43.2.1 src/sys/uvm/uvm_meter.c:1.43.2.1.4.1 --- src/sys/uvm/uvm_meter.c:1.43.2.1 Fri Oct 12 22:36:07 2007 +++ src/sys/uvm/uvm_meter.c Sat Nov 19 14:21:43 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_meter.c,v 1.43.2.1 2007/10/12 22:36:07 riz Exp $ */ +/* $NetBSD: uvm_meter.c,v 1.43.2.1.4.1 2011/11/19 14:21:43 bouyer Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.43.2.1 2007/10/12 22:36:07 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.43.2.1.4.1 2011/11/19 14:21:43 bouyer Exp $"); #include #include @@ -148,7 +148,7 @@ sysctl_vm_uvmexp(SYSCTLFN_ARGS) struct sysctlnode node; node = *rnode; - if (oldp) + if (oldlenp) node.sysctl_size = min(*oldlenp, node.sysctl_size); return (sysctl_lookup(SYSCTLFN_CALL(&node)));
CVS commit: [netbsd-4] src/sys/uvm
Module Name:src Committed By: bouyer Date: Sat Nov 19 14:21:37 UTC 2011 Modified Files: src/sys/uvm [netbsd-4]: uvm_meter.c Log Message: Pull up following revision(s) (requested by christos in ticket #1436): sys/uvm/uvm_meter.c: revision 1.57 via patch if you are going to dereference a variable, check the variable itself, not it cousin. To generate a diff of this commit: cvs rdiff -u -r1.43.2.1 -r1.43.2.2 src/sys/uvm/uvm_meter.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/uvm/uvm_meter.c diff -u src/sys/uvm/uvm_meter.c:1.43.2.1 src/sys/uvm/uvm_meter.c:1.43.2.2 --- src/sys/uvm/uvm_meter.c:1.43.2.1 Fri Oct 12 22:36:07 2007 +++ src/sys/uvm/uvm_meter.c Sat Nov 19 14:21:37 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_meter.c,v 1.43.2.1 2007/10/12 22:36:07 riz Exp $ */ +/* $NetBSD: uvm_meter.c,v 1.43.2.2 2011/11/19 14:21:37 bouyer Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.43.2.1 2007/10/12 22:36:07 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.43.2.2 2011/11/19 14:21:37 bouyer Exp $"); #include #include @@ -148,7 +148,7 @@ sysctl_vm_uvmexp(SYSCTLFN_ARGS) struct sysctlnode node; node = *rnode; - if (oldp) + if (oldlenp) node.sysctl_size = min(*oldlenp, node.sysctl_size); return (sysctl_lookup(SYSCTLFN_CALL(&node)));
CVS commit: [netbsd-4] src/lib/librmt
Module Name:src Committed By: bouyer Date: Sat Nov 19 14:18:29 UTC 2011 Modified Files: src/lib/librmt [netbsd-4]: rmtlib.c Log Message: Pull up following revision(s) (requested by dholland in ticket #1432): lib/librmt/rmtlib.c: revision 1.23 lib/librmt/rmtlib.c: revision 1.24 Improve isrmt() check: it cannot be a rmt fd if there are no pipes open for the fd. Prevents collision with rumphijack. Also, prevent potential hyperspace memory access. Does someone want to write tests for this facility? PR/38413: Takahiro Kambe: mt(1) print some junk output when using remote tape Not all fields are valid in the ioctl to get tape info in the rmt protocol. Zero out the struct so that we don't print junk. While here, KNF. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.21.4.1 src/lib/librmt/rmtlib.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/librmt/rmtlib.c diff -u src/lib/librmt/rmtlib.c:1.21 src/lib/librmt/rmtlib.c:1.21.4.1 --- src/lib/librmt/rmtlib.c:1.21 Sun Mar 19 23:05:50 2006 +++ src/lib/librmt/rmtlib.c Sat Nov 19 14:18:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rmtlib.c,v 1.21 2006/03/19 23:05:50 christos Exp $ */ +/* $NetBSD: rmtlib.c,v 1.21.4.1 2011/11/19 14:18:29 bouyer Exp $ */ /* * rmt --- remote tape emulator subroutines @@ -28,7 +28,7 @@ */ #include -__RCSID("$NetBSD: rmtlib.c,v 1.21 2006/03/19 23:05:50 christos Exp $"); +__RCSID("$NetBSD: rmtlib.c,v 1.21.4.1 2011/11/19 14:18:29 bouyer Exp $"); #define RMTIOCTL 1 /* #define USE_REXEC 1 */ /* rexec code courtesy of Dan Kegel, srs!dan */ @@ -50,6 +50,7 @@ __RCSID("$NetBSD: rmtlib.c,v 1.21 2006/0 #include #include #include +#include #ifdef USE_REXEC #include @@ -66,7 +67,7 @@ static off_t _rmt_lseek(int, off_t, int) static int _rmt_open(const char *, int, int); static ssize_t _rmt_read(int, void *, size_t); static ssize_t _rmt_write(int, const void *, size_t); -static int command(int, char *); +static int command(int, const char *); static int remdev(const char *); static void rmtabort(int); static int status(int); @@ -102,10 +103,10 @@ rmtabort(int fildes) * command --- attempt to perform a remote tape command */ static int -command(int fildes, char *buf) +command(int fildes, const char *buf) { size_t blen; - void (*pstat)(int); + sig_t pstat; _DIAGASSERT(buf != NULL); @@ -117,7 +118,7 @@ command(int fildes, char *buf) pstat = signal(SIGPIPE, SIG_IGN); if (write(WRITE(fildes), buf, blen) == blen) { signal(SIGPIPE, pstat); - return (0); + return 0; } /* @@ -128,7 +129,7 @@ command(int fildes, char *buf) rmtabort(fildes); errno = EIO; - return (-1); + return -1; } @@ -150,7 +151,7 @@ status(int fildes) if (read(READ(fildes), cp, 1) != 1) { rmtabort(fildes); errno = EIO; - return (-1); + return -1; } if (*cp == '\n') { *cp = 0; @@ -161,7 +162,7 @@ status(int fildes) if (i == BUFMAGIC) { rmtabort(fildes); errno = EIO; - return (-1); + return -1; } /* @@ -181,7 +182,7 @@ status(int fildes) if (*cp == 'F') rmtabort(fildes); - return (-1); + return -1; } /* @@ -191,10 +192,10 @@ status(int fildes) if (*cp != 'A') { rmtabort(fildes); errno = EIO; - return (-1); + return -1; } - return (atoi(cp + 1)); + return atoi(cp + 1); } @@ -224,14 +225,12 @@ _rmt_rexec(const char *host, const char /* user may be NULL */ rexecserv = getservbyname("exec", "tcp"); - if (rexecserv == NULL) { - fprintf(stderr, "? exec/tcp: service not available."); - exit(1); - } + if (rexecserv == NULL) + errx(1, exec/tcp: service not available."); if ((user != NULL) && *user == '\0') user = NULL; - return (rexec(&host, rexecserv->s_port, user, NULL, - "/etc/rmt", NULL)); + return rexec(&host, rexecserv->s_port, user, NULL, + "/etc/rmt", NULL); } #endif /* USE_REXEC */ @@ -251,12 +250,13 @@ static int /*ARGSUSED*/ _rmt_open(const char *path, int oflag, int mode) { - int i, rc; + int i; char buffer[BUFMAGIC]; char host[MAXHOSTLEN]; char device[BUFMAGIC]; char login[BUFMAGIC]; char *sys, *dev, *user; + char *rshpath, *rsh; _DIAGASSERT(path != NULL); @@ -274,7 +274,7 @@ _rmt_open(const char *path, int oflag, i if (i == MAXUNIT) { errno = EMFILE; - return (-1); + return -1; } /* @@ -326,21 +326,20 @@ _rmt_open(const char *path, int oflag, i */ READ(i) = WRITE(i) = _rmt_rexec(host, login); if (READ(i) < 0) - return (-1); + return -1; #else /* * setup the pipes for the 'rsh' command and fork */ if (pipe(Ptc[i]) == -1 || pipe(Ctp[i]) == -1) - return (-1); - - if ((rc = fork()) == -1) - return (-1); + return -1; - if (rc == 0) { - char *rshpath, *rsh; + switch (fork()) { + case -1: + return -1; + case 0: close(0); dup(Ptc[i][0]); close(Ptc[i][0]); close(Ptc[i][1]); @@ -358,19 +357,19 @@ _rmt_open(const char *path, i
CVS commit: [netbsd-5] src/doc
Module Name:src Committed By: bouyer Date: Sat Nov 19 14:00:18 UTC 2011 Modified Files: src/doc [netbsd-5]: CHANGES-5.2 Log Message: ticket 1696 To generate a diff of this commit: cvs rdiff -u -r1.1.2.116 -r1.1.2.117 src/doc/CHANGES-5.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-5.2 diff -u src/doc/CHANGES-5.2:1.1.2.116 src/doc/CHANGES-5.2:1.1.2.117 --- src/doc/CHANGES-5.2:1.1.2.116 Fri Nov 18 23:27:59 2011 +++ src/doc/CHANGES-5.2 Sat Nov 19 14:00:18 2011 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.2,v 1.1.2.116 2011/11/18 23:27:59 sborrill Exp $ +# $NetBSD: CHANGES-5.2,v 1.1.2.117 2011/11/19 14:00:18 bouyer Exp $ A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2 release: @@ -5812,3 +5812,15 @@ sys/dev/pci/if_age.c1.40 via patch not be properly reenabled after this, leading do watchdog timeouts. [bouyer, ticket #1694] +dist/openpam/lib/openpam_configure.c 1.6 + + Don't allow '/' characters in the "service" argument to pam_start() + The "service" is blindly appended to config directories ("/etc/pam.d/"), + and if a user can control the "service" it can get PAM to read config + files from any location. + This is not a problem with most software because the "service" is + usually a constant string. The check protects 3rd party software + from being abused. + (CVE-2011-4122) + [drochner, ticket #1696] +
CVS commit: [netbsd-5-0] src/doc
Module Name:src Committed By: bouyer Date: Sat Nov 19 14:00:19 UTC 2011 Modified Files: src/doc [netbsd-5-0]: CHANGES-5.0.3 Log Message: ticket 1696 To generate a diff of this commit: cvs rdiff -u -r1.1.2.54 -r1.1.2.55 src/doc/CHANGES-5.0.3 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-5.0.3 diff -u src/doc/CHANGES-5.0.3:1.1.2.54 src/doc/CHANGES-5.0.3:1.1.2.55 --- src/doc/CHANGES-5.0.3:1.1.2.54 Fri Nov 18 23:08:39 2011 +++ src/doc/CHANGES-5.0.3 Sat Nov 19 14:00:19 2011 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.0.3,v 1.1.2.54 2011/11/18 23:08:39 sborrill Exp $ +# $NetBSD: CHANGES-5.0.3,v 1.1.2.55 2011/11/19 14:00:19 bouyer Exp $ A complete list of changes from the NetBSD 5.0.2 release to the NetBSD 5.0.3 release: @@ -2863,3 +2863,15 @@ dist/bind/lib/dns/rbtdb.c patch records, leading to an assertion failure. Fixes CVE-2011-4313. [christos, ticket #1692] +dist/openpam/lib/openpam_configure.c 1.6 + + Don't allow '/' characters in the "service" argument to pam_start() + The "service" is blindly appended to config directories ("/etc/pam.d/"), + and if a user can control the "service" it can get PAM to read config + files from any location. + This is not a problem with most software because the "service" is + usually a constant string. The check protects 3rd party software + from being abused. + (CVE-2011-4122) + [drochner, ticket #1696] +
CVS commit: [netbsd-5-1] src/doc
Module Name:src Committed By: bouyer Date: Sat Nov 19 14:00:14 UTC 2011 Modified Files: src/doc [netbsd-5-1]: CHANGES-5.1.1 Log Message: ticket 1696 To generate a diff of this commit: cvs rdiff -u -r1.1.2.40 -r1.1.2.41 src/doc/CHANGES-5.1.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-5.1.1 diff -u src/doc/CHANGES-5.1.1:1.1.2.40 src/doc/CHANGES-5.1.1:1.1.2.41 --- src/doc/CHANGES-5.1.1:1.1.2.40 Fri Nov 18 23:09:48 2011 +++ src/doc/CHANGES-5.1.1 Sat Nov 19 14:00:14 2011 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.1.1,v 1.1.2.40 2011/11/18 23:09:48 sborrill Exp $ +# $NetBSD: CHANGES-5.1.1,v 1.1.2.41 2011/11/19 14:00:14 bouyer Exp $ A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.1.1 release: @@ -2559,3 +2559,15 @@ dist/bind/lib/dns/rbtdb.c patch records, leading to an assertion failure. Fixes CVE-2011-4313. [christos, ticket #1692] +dist/openpam/lib/openpam_configure.c 1.6 + + Don't allow '/' characters in the "service" argument to pam_start() + The "service" is blindly appended to config directories ("/etc/pam.d/"), + and if a user can control the "service" it can get PAM to read config + files from any location. + This is not a problem with most software because the "service" is + usually a constant string. The check protects 3rd party software + from being abused. + (CVE-2011-4122) + [drochner, ticket #1696] +
CVS commit: [netbsd-5-1] src/dist/openpam/lib
Module Name:src Committed By: bouyer Date: Sat Nov 19 13:59:30 UTC 2011 Modified Files: src/dist/openpam/lib [netbsd-5-1]: openpam_configure.c Log Message: Pull up following revision(s) (requested by drochner in ticket #1696): dist/openpam/lib/openpam_configure.c: revision 1.6 Don't allow '/' characters in the "service" argument to pam_start() The "service" is blindly appended to config directories ("/etc/pam.d/"), and if a user can control the "service" it can get PAM to read config files from any location. This is not a problem with most software because the "service" is usually a constant string. The check protects 3rd party software from being abused. (CVE-2011-4122) To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.5.18.1 src/dist/openpam/lib/openpam_configure.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/dist/openpam/lib/openpam_configure.c diff -u src/dist/openpam/lib/openpam_configure.c:1.5 src/dist/openpam/lib/openpam_configure.c:1.5.18.1 --- src/dist/openpam/lib/openpam_configure.c:1.5 Sun Jan 27 01:22:59 2008 +++ src/dist/openpam/lib/openpam_configure.c Sat Nov 19 13:59:30 2011 @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: openpam_configure.c,v 1.5 2008/01/27 01:22:59 christos Exp $ + * $Id: openpam_configure.c,v 1.5.18.1 2011/11/19 13:59:30 bouyer Exp $ */ #include @@ -289,6 +289,12 @@ openpam_load_chain(pam_handle_t *pamh, size_t len; int r; + /* don't allow to escape from policy_path */ + if (strchr(service, '/')) { + openpam_log(PAM_LOG_ERROR, "illegal service \"%s\"", service); + return (-PAM_SYSTEM_ERR); + } + for (path = openpam_policy_path; *path != NULL; ++path) { len = strlen(*path); if ((*path)[len - 1] == '/') {
CVS commit: [netbsd-5-0] src/dist/openpam/lib
Module Name:src Committed By: bouyer Date: Sat Nov 19 13:59:26 UTC 2011 Modified Files: src/dist/openpam/lib [netbsd-5-0]: openpam_configure.c Log Message: Pull up following revision(s) (requested by drochner in ticket #1696): dist/openpam/lib/openpam_configure.c: revision 1.6 Don't allow '/' characters in the "service" argument to pam_start() The "service" is blindly appended to config directories ("/etc/pam.d/"), and if a user can control the "service" it can get PAM to read config files from any location. This is not a problem with most software because the "service" is usually a constant string. The check protects 3rd party software from being abused. (CVE-2011-4122) To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.5.14.1 src/dist/openpam/lib/openpam_configure.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/dist/openpam/lib/openpam_configure.c diff -u src/dist/openpam/lib/openpam_configure.c:1.5 src/dist/openpam/lib/openpam_configure.c:1.5.14.1 --- src/dist/openpam/lib/openpam_configure.c:1.5 Sun Jan 27 01:22:59 2008 +++ src/dist/openpam/lib/openpam_configure.c Sat Nov 19 13:59:26 2011 @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: openpam_configure.c,v 1.5 2008/01/27 01:22:59 christos Exp $ + * $Id: openpam_configure.c,v 1.5.14.1 2011/11/19 13:59:26 bouyer Exp $ */ #include @@ -289,6 +289,12 @@ openpam_load_chain(pam_handle_t *pamh, size_t len; int r; + /* don't allow to escape from policy_path */ + if (strchr(service, '/')) { + openpam_log(PAM_LOG_ERROR, "illegal service \"%s\"", service); + return (-PAM_SYSTEM_ERR); + } + for (path = openpam_policy_path; *path != NULL; ++path) { len = strlen(*path); if ((*path)[len - 1] == '/') {
CVS commit: [netbsd-5] src/dist/openpam/lib
Module Name:src Committed By: bouyer Date: Sat Nov 19 13:59:22 UTC 2011 Modified Files: src/dist/openpam/lib [netbsd-5]: openpam_configure.c Log Message: Pull up following revision(s) (requested by drochner in ticket #1696): dist/openpam/lib/openpam_configure.c: revision 1.6 Don't allow '/' characters in the "service" argument to pam_start() The "service" is blindly appended to config directories ("/etc/pam.d/"), and if a user can control the "service" it can get PAM to read config files from any location. This is not a problem with most software because the "service" is usually a constant string. The check protects 3rd party software from being abused. (CVE-2011-4122) To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.5.10.1 src/dist/openpam/lib/openpam_configure.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/dist/openpam/lib/openpam_configure.c diff -u src/dist/openpam/lib/openpam_configure.c:1.5 src/dist/openpam/lib/openpam_configure.c:1.5.10.1 --- src/dist/openpam/lib/openpam_configure.c:1.5 Sun Jan 27 01:22:59 2008 +++ src/dist/openpam/lib/openpam_configure.c Sat Nov 19 13:59:21 2011 @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: openpam_configure.c,v 1.5 2008/01/27 01:22:59 christos Exp $ + * $Id: openpam_configure.c,v 1.5.10.1 2011/11/19 13:59:21 bouyer Exp $ */ #include @@ -289,6 +289,12 @@ openpam_load_chain(pam_handle_t *pamh, size_t len; int r; + /* don't allow to escape from policy_path */ + if (strchr(service, '/')) { + openpam_log(PAM_LOG_ERROR, "illegal service \"%s\"", service); + return (-PAM_SYSTEM_ERR); + } + for (path = openpam_policy_path; *path != NULL; ++path) { len = strlen(*path); if ((*path)[len - 1] == '/') {
CVS commit: src/external/gpl3/gdb/dist/gdb
Module Name:src Committed By: mlelstv Date: Sat Nov 19 13:00:38 UTC 2011 Modified Files: src/external/gpl3/gdb/dist/gdb: m68kbsd-tdep.c Log Message: Fix passing of floating point registers. To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/m68kbsd-tdep.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/gpl3/gdb/dist/gdb/m68kbsd-tdep.c diff -u src/external/gpl3/gdb/dist/gdb/m68kbsd-tdep.c:1.1.1.1 src/external/gpl3/gdb/dist/gdb/m68kbsd-tdep.c:1.2 --- src/external/gpl3/gdb/dist/gdb/m68kbsd-tdep.c:1.1.1.1 Sat Sep 24 20:11:18 2011 +++ src/external/gpl3/gdb/dist/gdb/m68kbsd-tdep.c Sat Nov 19 13:00:38 2011 @@ -45,7 +45,7 @@ int m68kbsd_fpreg_offset (struct gdbarch *gdbarch, int regnum) { - int fp_len = TYPE_LENGTH (gdbarch_register_type (gdbarch, regnum)); + int fp_len = TYPE_LENGTH (gdbarch_register_type (gdbarch, M68K_FP0_REGNUM)); if (regnum >= M68K_FPC_REGNUM) return 8 * fp_len + (regnum - M68K_FPC_REGNUM) * 4; @@ -68,7 +68,7 @@ m68kbsd_supply_fpregset (const struct re gdb_assert (len >= M68KBSD_SIZEOF_FPREGS); - for (i = M68K_FP0_REGNUM; i <= M68K_PC_REGNUM; i++) + for (i = M68K_FP0_REGNUM; i <= M68K_FPI_REGNUM; i++) { if (regnum == i || regnum == -1) regcache_raw_supply (regcache, i,
CVS commit: src/tests/lib/libm
Module Name:src Committed By: mlelstv Date: Sat Nov 19 12:46:41 UTC 2011 Modified Files: src/tests/lib/libm: t_sqrt.c Log Message: The compiler is allowed to use intermediate higher precision for float arithmetic, which may cause differences smaller than float precision but still much larger than eps = 1e-30. Forcing intermediate results to volatile variables removes the excess precision. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libm/t_sqrt.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/lib/libm/t_sqrt.c diff -u src/tests/lib/libm/t_sqrt.c:1.1 src/tests/lib/libm/t_sqrt.c:1.2 --- src/tests/lib/libm/t_sqrt.c:1.1 Sun Oct 16 08:25:40 2011 +++ src/tests/lib/libm/t_sqrt.c Sat Nov 19 12:46:41 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: t_sqrt.c,v 1.1 2011/10/16 08:25:40 jruoho Exp $ */ +/* $NetBSD: t_sqrt.c,v 1.2 2011/11/19 12:46:41 mlelstv Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_sqrt.c,v 1.1 2011/10/16 08:25:40 jruoho Exp $"); +__RCSID("$NetBSD: t_sqrt.c,v 1.2 2011/11/19 12:46:41 mlelstv Exp $"); #include #include @@ -177,7 +177,7 @@ ATF_TC_BODY(sqrtf_powf, tc) #ifndef __vax__ const float x[] = { 0.0, 0.005, 1.0, 99.0, 123.123, . }; const float eps = 1.0e-30; - float y, z; + volatile float y, z; size_t i; for (i = 0; i < __arraycount(x); i++) { @@ -187,7 +187,7 @@ ATF_TC_BODY(sqrtf_powf, tc) if (fabsf(y - z) > eps) atf_tc_fail_nonfatal("sqrtf(%0.03f) != " - "powf(%0.03f, 1/3)\n", x[i], x[i]); + "powf(%0.03f, 1/2)\n", x[i], x[i]); } #endif }
CVS commit: src/sys/dev/pci
Module Name:src Committed By: jmcneill Date: Sat Nov 19 12:32:54 UTC 2011 Modified Files: src/sys/dev/pci: if_vioif.c Log Message: fix build when ALTQ is defined To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/if_vioif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_vioif.c diff -u src/sys/dev/pci/if_vioif.c:1.1 src/sys/dev/pci/if_vioif.c:1.2 --- src/sys/dev/pci/if_vioif.c:1.1 Sun Oct 30 12:12:21 2011 +++ src/sys/dev/pci/if_vioif.c Sat Nov 19 12:32:54 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vioif.c,v 1.1 2011/10/30 12:12:21 hannken Exp $ */ +/* $NetBSD: if_vioif.c,v 1.2 2011/11/19 12:32:54 jmcneill Exp $ */ /* * Copyright (c) 2010 Minoura Makoto. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.1 2011/10/30 12:12:21 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.2 2011/11/19 12:32:54 jmcneill Exp $"); #include #include @@ -675,9 +675,13 @@ vioif_start(struct ifnet *ifp) if ((ifp->if_flags & (IFF_RUNNING|IFF_OACTIVE)) != IFF_RUNNING) return; - while (IFQ_POLL(&ifp->if_snd, m), m != NULL) { + for (;;) { int slot, r; + IFQ_POLL(&ifp->if_snd, m); + if (m == NULL) + break; + r = virtio_enqueue_prep(vsc, vq, &slot); if (r == EAGAIN) { ifp->if_flags |= IFF_OACTIVE;
CVS commit: src/doc
Module Name:src Committed By: isaki Date: Sat Nov 19 12:30:51 UTC 2011 Modified Files: src/doc: CHANGES Log Message: Note pow(4)/rtcalarm(8). To generate a diff of this commit: cvs rdiff -u -r1.1627 -r1.1628 src/doc/CHANGES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.1627 src/doc/CHANGES:1.1628 --- src/doc/CHANGES:1.1627 Fri Nov 18 10:06:56 2011 +++ src/doc/CHANGES Sat Nov 19 12:30:51 2011 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1627 $> +# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1628 $> # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -1170,3 +1170,4 @@ Changes from NetBSD 5.0 to NetBSD 6.0: gpiopwm(4): A new driver to pulse GPIO pins in software. [mbalmer 2013] httpd(8): Import bozohttpd-2018. [mrg 2018] + x68k: Remove pow(4) and rtcalarm(8) [isaki 2019]
CVS commit: src
Module Name:src Committed By: isaki Date: Sat Nov 19 12:27:44 UTC 2011 Modified Files: src/distrib/sets/lists/base: md.x68k src/distrib/sets/lists/comp: md.x68k src/distrib/sets/lists/man: mi src/share/man/man4/man4.x68k: Makefile src/share/man/man8/man8.x68k: Makefile src/sys/arch/x68k/conf: GENERIC INSTALL files.x68k majors.x68k src/sys/arch/x68k/include: Makefile src/sys/arch/x68k/usr.bin: Makefile Removed Files: src/share/man/man4/man4.x68k: pow.4 src/share/man/man8/man8.x68k: rtcalarm.8 src/sys/arch/x68k/dev: pow.c powvar.h src/sys/arch/x68k/include: powioctl.h src/sys/arch/x68k/usr.bin/rtcalarm: Makefile rtcalarm.c Log Message: Obsolete pow(4) and rtcalarm(8). Discussed in port-x68k@. Probably the combination of pow(4) ioctl and rtcalarm(8) does not work for a long time, and nobody uses them. I'll rewrite a part about power switch handler as a new device. To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/distrib/sets/lists/base/md.x68k cvs rdiff -u -r1.58 -r1.59 src/distrib/sets/lists/comp/md.x68k cvs rdiff -u -r1.1355 -r1.1356 src/distrib/sets/lists/man/mi cvs rdiff -u -r1.7 -r1.8 src/share/man/man4/man4.x68k/Makefile cvs rdiff -u -r1.14 -r0 src/share/man/man4/man4.x68k/pow.4 cvs rdiff -u -r1.9 -r1.10 src/share/man/man8/man8.x68k/Makefile cvs rdiff -u -r1.9 -r0 src/share/man/man8/man8.x68k/rtcalarm.8 cvs rdiff -u -r1.155 -r1.156 src/sys/arch/x68k/conf/GENERIC cvs rdiff -u -r1.91 -r1.92 src/sys/arch/x68k/conf/INSTALL cvs rdiff -u -r1.75 -r1.76 src/sys/arch/x68k/conf/files.x68k cvs rdiff -u -r1.24 -r1.25 src/sys/arch/x68k/conf/majors.x68k cvs rdiff -u -r1.23 -r0 src/sys/arch/x68k/dev/pow.c cvs rdiff -u -r1.4 -r0 src/sys/arch/x68k/dev/powvar.h cvs rdiff -u -r1.35 -r1.36 src/sys/arch/x68k/include/Makefile cvs rdiff -u -r1.4 -r0 src/sys/arch/x68k/include/powioctl.h cvs rdiff -u -r1.1.1.1 -r1.2 src/sys/arch/x68k/usr.bin/Makefile cvs rdiff -u -r1.7 -r0 src/sys/arch/x68k/usr.bin/rtcalarm/Makefile cvs rdiff -u -r1.11 -r0 src/sys/arch/x68k/usr.bin/rtcalarm/rtcalarm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/base/md.x68k diff -u src/distrib/sets/lists/base/md.x68k:1.42 src/distrib/sets/lists/base/md.x68k:1.43 --- src/distrib/sets/lists/base/md.x68k:1.42 Sat Dec 20 13:20:58 2008 +++ src/distrib/sets/lists/base/md.x68k Sat Nov 19 12:27:42 2011 @@ -1,10 +1,11 @@ -# $NetBSD: md.x68k,v 1.42 2008/12/20 13:20:58 isaki Exp $ +# $NetBSD: md.x68k,v 1.43 2011/11/19 12:27:42 isaki Exp $ +./dev/pow0 base-obsolete obsolete ./dev/pow1 base-obsolete obsolete ./usr/bin/bellctrlbase-util-bin ./usr/bin/loadfontbase-util-bin ./usr/bin/loadkmapbase-util-bin ./usr/bin/palettebase-util-bin -./usr/bin/rtcalarmbase-util-bin +./usr/bin/rtcalarmbase-obsolete obsolete ./usr/bin/tvctrlbase-util-bin ./usr/mdec/boot base-sysutil-bin ./usr/mdec/fdboot_ufsbase-sysutil-bin Index: src/distrib/sets/lists/comp/md.x68k diff -u src/distrib/sets/lists/comp/md.x68k:1.58 src/distrib/sets/lists/comp/md.x68k:1.59 --- src/distrib/sets/lists/comp/md.x68k:1.58 Sun Jul 17 20:54:32 2011 +++ src/distrib/sets/lists/comp/md.x68k Sat Nov 19 12:27:42 2011 @@ -1,4 +1,4 @@ -# $NetBSD: md.x68k,v 1.58 2011/07/17 20:54:32 joerg Exp $ +# $NetBSD: md.x68k,v 1.59 2011/11/19 12:27:42 isaki Exp $ ./usr/include/ieeefp.hcomp-c-include ./usr/include/x68kcomp-c-include ./usr/include/x68k/_G_config.h comp-obsolete obsolete @@ -46,7 +46,7 @@ ./usr/include/x68k/pci_machdep.h comp-obsolete obsolete ./usr/include/x68k/pmap.h comp-c-include ./usr/include/x68k/pmc.h comp-c-include -./usr/include/x68k/powioctl.h comp-c-include +./usr/include/x68k/powioctl.h comp-obsolete obsolete ./usr/include/x68k/proc.h comp-c-include ./usr/include/x68k/profile.h comp-c-include ./usr/include/x68k/psl.h comp-c-include Index: src/distrib/sets/lists/man/mi diff -u src/distrib/sets/lists/man/mi:1.1355 src/distrib/sets/lists/man/mi:1.1356 --- src/distrib/sets/lists/man/mi:1.1355 Tue Nov 15 16:50:45 2011 +++ src/distrib/sets/lists/man/mi Sat Nov 19 12:27:42 2011 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1355 2011/11/15 16:50:45 riz Exp $ +# $NetBSD: mi,v 1.1356 2011/11/19 12:27:42 isaki Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -1823,7 +1823,7 @@ ./usr/share/man/cat4/x68k/intro.0 man-sys-catman .cat ./usr/share/man/cat4/x68k/mfp.0 man-sys-catman .cat ./usr/share/man/cat4/x68k/neptune.0 man-sys-catman .cat -./usr/share/man/cat4/x68k/pow.0 man-sys-catman .cat +./usr/share/man/cat4/x68k/pow.0 man-obsolete obsolete ./usr/share/man/cat4/x68k/vs.0 man-sys-catman .cat ./usr/share/man/cat4/x86/amdpcib.0 man-sys-catman .cat ./usr/share/man/cat4/x86/apic.0 man-sys-catman .cat @@ -2942,7 +2942,7 @@ ./