From owner-svn-src-stable@FreeBSD.ORG Sun Oct 18 15:58:57 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7CF8106566C; Sun, 18 Oct 2009 15:58:57 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9749A8FC16; Sun, 18 Oct 2009 15:58:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9IFwvDq073108; Sun, 18 Oct 2009 15:58:57 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9IFwvk5073106; Sun, 18 Oct 2009 15:58:57 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910181558.n9IFwvk5073106@svn.freebsd.org> From: Robert Watson Date: Sun, 18 Oct 2009 15:58:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198209 - stable/8/usr.bin/netstat X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 15:58:57 -0000 Author: rwatson Date: Sun Oct 18 15:58:57 2009 New Revision: 198209 URL: http://svn.freebsd.org/changeset/base/198209 Log: Merge r198118 from head to stable/8: Print routing statistics as unsigned short rather than unsigned int, otherwise sign extension leads to unlikely values when in the negative range of the signed short structure fields that hold the statistics. The type used to hold routing statistics is arguably also incorrect. Approved by: re (bz) Modified: stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/netstat/route.c Modified: stable/8/usr.bin/netstat/route.c ============================================================================== --- stable/8/usr.bin/netstat/route.c Sun Oct 18 15:21:48 2009 (r198208) +++ stable/8/usr.bin/netstat/route.c Sun Oct 18 15:58:57 2009 (r198209) @@ -1008,11 +1008,11 @@ rt_stats(u_long rtsaddr, u_long rttaddr) #define p(f, m) if (rtstat.f || sflag <= 1) \ printf(m, rtstat.f, plural(rtstat.f)) - p(rts_badredirect, "\t%u bad routing redirect%s\n"); - p(rts_dynamic, "\t%u dynamically created route%s\n"); - p(rts_newgateway, "\t%u new gateway%s due to redirects\n"); - p(rts_unreach, "\t%u destination%s found unreachable\n"); - p(rts_wildcard, "\t%u use%s of a wildcard route\n"); + p(rts_badredirect, "\t%hu bad routing redirect%s\n"); + p(rts_dynamic, "\t%hu dynamically created route%s\n"); + p(rts_newgateway, "\t%hu new gateway%s due to redirects\n"); + p(rts_unreach, "\t%hu destination%s found unreachable\n"); + p(rts_wildcard, "\t%hu use%s of a wildcard route\n"); #undef p if (rttrash || sflag <= 1) From owner-svn-src-stable@FreeBSD.ORG Mon Oct 19 08:43:11 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFC1610656C3; Mon, 19 Oct 2009 08:43:11 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE9E78FC0A; Mon, 19 Oct 2009 08:43:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9J8hBtW096234; Mon, 19 Oct 2009 08:43:11 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9J8hBQe096231; Mon, 19 Oct 2009 08:43:11 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200910190843.n9J8hBQe096231@svn.freebsd.org> From: Christian Brueffer Date: Mon, 19 Oct 2009 08:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198227 - stable/8/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 08:43:11 -0000 Author: brueffer Date: Mon Oct 19 08:43:11 2009 New Revision: 198227 URL: http://svn.freebsd.org/changeset/base/198227 Log: MFC: r198125 Use our standard section 4 SYNOPSIS. Approved by: re (hrs) Modified: stable/8/share/man/man4/ (props changed) stable/8/share/man/man4/sbp_targ.4 stable/8/share/man/man4/targ.4 Modified: stable/8/share/man/man4/sbp_targ.4 ============================================================================== --- stable/8/share/man/man4/sbp_targ.4 Mon Oct 19 08:26:30 2009 (r198226) +++ stable/8/share/man/man4/sbp_targ.4 Mon Oct 19 08:43:11 2009 (r198227) @@ -38,16 +38,24 @@ .Nm sbp_targ .Nd Serial Bus Protocol 2 (SBP-2) Target Mode devices driver .Sh SYNOPSIS -.Cd "kldload firewire" -.Cd "kldload cam" -.Cd "kldload sbp_targ" -.Pp -or -.Pp +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent .Cd "device sbp_targ" .Cd "device firewire" .Cd "device scbus" .Cd "device targ" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following lines in +.Xr loader.conf 5 : +.Bd -literal -offset indent +firewire_load="YES" +cam_load="YES" +sbp_targ_load"YES" +.Ed .Sh DESCRIPTION The .Nm Modified: stable/8/share/man/man4/targ.4 ============================================================================== --- stable/8/share/man/man4/targ.4 Mon Oct 19 08:26:30 2009 (r198226) +++ stable/8/share/man/man4/targ.4 Mon Oct 19 08:43:11 2009 (r198227) @@ -31,7 +31,12 @@ .Nm targ .Nd SCSI target emulator driver .Sh SYNOPSIS -.Cd device targ +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device targ" +.Ed .Sh DESCRIPTION The .Nm From owner-svn-src-stable@FreeBSD.ORG Mon Oct 19 08:52:58 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45F5E1065670; Mon, 19 Oct 2009 08:52:58 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34EF48FC17; Mon, 19 Oct 2009 08:52:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9J8qv8L096517; Mon, 19 Oct 2009 08:52:57 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9J8qvM0096514; Mon, 19 Oct 2009 08:52:57 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200910190852.n9J8qvM0096514@svn.freebsd.org> From: Christian Brueffer Date: Mon, 19 Oct 2009 08:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198228 - stable/7/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 08:52:58 -0000 Author: brueffer Date: Mon Oct 19 08:52:57 2009 New Revision: 198228 URL: http://svn.freebsd.org/changeset/base/198228 Log: MFC: r198125 Use our standard section 4 SYNOPSIS. Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/sbp_targ.4 stable/7/share/man/man4/targ.4 Modified: stable/7/share/man/man4/sbp_targ.4 ============================================================================== --- stable/7/share/man/man4/sbp_targ.4 Mon Oct 19 08:43:11 2009 (r198227) +++ stable/7/share/man/man4/sbp_targ.4 Mon Oct 19 08:52:57 2009 (r198228) @@ -38,16 +38,24 @@ .Nm sbp_targ .Nd Serial Bus Protocol 2 (SBP-2) Target Mode devices driver .Sh SYNOPSIS -.Cd "kldload firewire" -.Cd "kldload cam" -.Cd "kldload sbp_targ" -.Pp -or -.Pp +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent .Cd "device sbp_targ" .Cd "device firewire" .Cd "device scbus" .Cd "device targ" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following lines in +.Xr loader.conf 5 : +.Bd -literal -offset indent +firewire_load="YES" +cam_load="YES" +sbp_targ_load"YES" +.Ed .Sh DESCRIPTION The .Nm Modified: stable/7/share/man/man4/targ.4 ============================================================================== --- stable/7/share/man/man4/targ.4 Mon Oct 19 08:43:11 2009 (r198227) +++ stable/7/share/man/man4/targ.4 Mon Oct 19 08:52:57 2009 (r198228) @@ -31,7 +31,12 @@ .Nm targ .Nd SCSI target emulator driver .Sh SYNOPSIS -.Cd device targ +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device targ" +.Ed .Sh DESCRIPTION The .Nm From owner-svn-src-stable@FreeBSD.ORG Mon Oct 19 18:31:39 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9600C1065672; Mon, 19 Oct 2009 18:31:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8382B8FC18; Mon, 19 Oct 2009 18:31:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JIVd8T009237; Mon, 19 Oct 2009 18:31:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JIVdQd009235; Mon, 19 Oct 2009 18:31:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200910191831.n9JIVdQd009235@svn.freebsd.org> From: John Baldwin Date: Mon, 19 Oct 2009 18:31:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198241 - in stable/8/sys: . amd64/include/xen boot/i386/zfsboot cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 18:31:39 -0000 Author: jhb Date: Mon Oct 19 18:31:39 2009 New Revision: 198241 URL: http://svn.freebsd.org/changeset/base/198241 Log: MFC 198079: Use zfs_read() instead of xfsread() to read /boot.config. xfsread() fails short read requests, so the result was that a /boot.config smaller than 512 bytes was ignored. boot2 uses fsread() instead of xfsread() to read /boot.config already, so this makes zfsboot more like boot2. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/i386/zfsboot/zfsboot.c stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/8/sys/boot/i386/zfsboot/zfsboot.c Mon Oct 19 18:06:49 2009 (r198240) +++ stable/8/sys/boot/i386/zfsboot/zfsboot.c Mon Oct 19 18:31:39 2009 (r198241) @@ -609,7 +609,7 @@ main(void) if (zfs_lookup(spa, PATH_CONFIG, &dn) == 0) { off = 0; - xfsread(&dn, &off, cmd, sizeof(cmd)); + zfs_read(spa, &dn, &off, cmd, sizeof(cmd)); } if (*cmd) { From owner-svn-src-stable@FreeBSD.ORG Mon Oct 19 18:52:05 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 774BF106566B; Mon, 19 Oct 2009 18:52:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 661C98FC1B; Mon, 19 Oct 2009 18:52:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JIq5BQ009750; Mon, 19 Oct 2009 18:52:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JIq58u009748; Mon, 19 Oct 2009 18:52:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200910191852.n9JIq58u009748@svn.freebsd.org> From: John Baldwin Date: Mon, 19 Oct 2009 18:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198243 - in stable/7/sys: . boot/i386/zfsboot contrib/pf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 18:52:05 -0000 Author: jhb Date: Mon Oct 19 18:52:05 2009 New Revision: 198243 URL: http://svn.freebsd.org/changeset/base/198243 Log: MFC 198079: Use zfs_read() instead of xfsread() to read /boot.config. xfsread() fails short read requests, so the result was that a /boot.config smaller than 512 bytes was ignored. boot2 uses fsread() instead of xfsread() to read /boot.config already, so this makes zfsboot more like boot2. Modified: stable/7/sys/ (props changed) stable/7/sys/boot/i386/zfsboot/zfsboot.c stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/7/sys/boot/i386/zfsboot/zfsboot.c Mon Oct 19 18:46:22 2009 (r198242) +++ stable/7/sys/boot/i386/zfsboot/zfsboot.c Mon Oct 19 18:52:05 2009 (r198243) @@ -609,7 +609,7 @@ main(void) if (zfs_lookup(spa, PATH_CONFIG, &dn) == 0) { off = 0; - xfsread(&dn, &off, cmd, sizeof(cmd)); + zfs_read(spa, &dn, &off, cmd, sizeof(cmd)); } if (*cmd) { From owner-svn-src-stable@FreeBSD.ORG Mon Oct 19 19:11:00 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75F931065672; Mon, 19 Oct 2009 19:11:00 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6363B8FC1D; Mon, 19 Oct 2009 19:11:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JJB0bv010154; Mon, 19 Oct 2009 19:11:00 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JJB0tQ010150; Mon, 19 Oct 2009 19:11:00 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <200910191911.n9JJB0tQ010150@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 19 Oct 2009 19:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198244 - in stable/7/sys: . contrib/pf kern sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 19:11:00 -0000 Author: gallatin Date: Mon Oct 19 19:11:00 2009 New Revision: 198244 URL: http://svn.freebsd.org/changeset/base/198244 Log: MFC of 178042 to allow safe firmware(9) loading from NIC watchdog handlers. Also MFCed are the related changes 178016, 183614 and 184842. 178042: Do firmare image loading in a context known to have a root directory 183614: Dynamically allocate the task struct in firmware mountroot 184842: Avoid scheduling firmware taskqueues when cold 178016: Add a mountroot event handler. Removal of SI_SUB_MOUNT_ROOT was not merged. This fixes a panic in at least mxge(4) if the NIC has a hardware fault when the firmware image is not resident. Reviewed by: jhb Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/subr_firmware.c stable/7/sys/kern/vfs_mount.c stable/7/sys/sys/eventhandler.h Modified: stable/7/sys/kern/subr_firmware.c ============================================================================== --- stable/7/sys/kern/subr_firmware.c Mon Oct 19 18:52:05 2009 (r198243) +++ stable/7/sys/kern/subr_firmware.c Mon Oct 19 19:11:00 2009 (r198244) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005, Sam Leffler + * Copyright (c) 2005-2008, Sam Leffler * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,6 +41,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +#include +#include /* * Loadable firmware support. See sys/sys/firmware.h and firmware(9) @@ -89,7 +93,7 @@ struct priv_fw { /* * 'file' is private info managed by the autoload/unload code. * Set at the end of firmware_get(), cleared only in the - * firmware_task, so the latter can depend on its value even + * firmware_unload_task, so the latter can depend on its value even * while the lock is not held. */ linker_file_t file; /* module file, if autoloaded */ @@ -121,14 +125,16 @@ struct priv_fw { static struct priv_fw firmware_table[FIRMWARE_MAX]; /* - * module release are handled in a separate task as they might sleep. + * Firmware module operations are handled in a separate task as they + * might sleep and they require directory context to do i/o. */ -struct task firmware_task; +static struct taskqueue *firmware_tq; +static struct task firmware_unload_task; /* * This mutex protects accesses to the firmware table. */ -struct mtx firmware_mtx; +static struct mtx firmware_mtx; MTX_SYSINIT(firmware, &firmware_mtx, "firmware table", MTX_DEF); /* @@ -227,7 +233,7 @@ firmware_unregister(const char *imagenam } else if (fp->refcnt != 0) { /* cannot unregister */ err = EBUSY; } else { - linker_file_t x = fp->file; /* save value */ + linker_file_t x = fp->file; /* save value */ if (fp->parent != NULL) /* release parent reference */ fp->parent->refcnt--; @@ -244,6 +250,47 @@ firmware_unregister(const char *imagenam return err; } +static void +loadimage(void *arg, int npending) +{ + struct thread *td = curthread; + char *imagename = arg; + struct priv_fw *fp; + linker_file_t result; + int error; + + /* synchronize with the thread that dispatched us */ + mtx_lock(&firmware_mtx); + mtx_unlock(&firmware_mtx); + + if (td->td_proc->p_fd->fd_rdir == NULL) { + printf("%s: root not mounted yet, no way to load image\n", + imagename); + goto done; + } + error = linker_reference_module(imagename, NULL, &result); + if (error != 0) { + printf("%s: could not load firmware image, error %d\n", + imagename, error); + goto done; + } + + mtx_lock(&firmware_mtx); + fp = lookup(imagename, NULL); + if (fp == NULL || fp->file != NULL) { + mtx_unlock(&firmware_mtx); + if (fp == NULL) + printf("%s: firmware image loaded, " + "but did not register\n", imagename); + (void) linker_release_module(imagename, NULL, NULL); + goto done; + } + fp->file = result; /* record the module identity */ + mtx_unlock(&firmware_mtx); +done: + wakeup_one(imagename); /* we're done */ +} + /* * Lookup and potentially load the specified firmware image. * If the firmware is not found in the registry, try to load a kernel @@ -254,9 +301,9 @@ firmware_unregister(const char *imagenam const struct firmware * firmware_get(const char *imagename) { + struct task fwload_task; struct thread *td; struct priv_fw *fp; - linker_file_t result; mtx_lock(&firmware_mtx); fp = lookup(imagename, NULL); @@ -265,29 +312,34 @@ firmware_get(const char *imagename) /* * Image not present, try to load the module holding it. */ - mtx_unlock(&firmware_mtx); td = curthread; if (priv_check(td, PRIV_FIRMWARE_LOAD) != 0 || securelevel_gt(td->td_ucred, 0) != 0) { + mtx_unlock(&firmware_mtx); printf("%s: insufficient privileges to " "load firmware image %s\n", __func__, imagename); return NULL; } - (void) linker_reference_module(imagename, NULL, &result); + /* + * Defer load to a thread with known context. linker_reference_module + * may do filesystem i/o which requires root & current dirs, etc. + * Also we must not hold any mtx's over this call which is problematic. + */ + if (!cold) { + TASK_INIT(&fwload_task, 0, loadimage, __DECONST(void *, + imagename)); + taskqueue_enqueue(firmware_tq, &fwload_task); + msleep(__DECONST(void *, imagename), &firmware_mtx, 0, + "fwload", 0); + } /* - * After loading the module, see if the image is registered now. + * After attempting to load the module, see if the image is registered. */ - mtx_lock(&firmware_mtx); fp = lookup(imagename, NULL); if (fp == NULL) { mtx_unlock(&firmware_mtx); - printf("%s: failed to load firmware image %s\n", - __func__, imagename); - (void) linker_release_module(imagename, NULL, NULL); return NULL; } - fp->file = result; /* record the module identity */ - found: /* common exit point on success */ fp->refcnt++; mtx_unlock(&firmware_mtx); @@ -300,8 +352,8 @@ found: /* common exit point on succes * to release the resource, but the flag is only advisory. * * If this is the last reference to the firmware image, and this is an - * autoloaded module, wake up the firmware_task to figure out what to do - * with the associated module. + * autoloaded module, wake up the firmware_unload_task to figure out + * what to do with the associated module. */ void firmware_put(const struct firmware *p, int flags) @@ -314,12 +366,53 @@ firmware_put(const struct firmware *p, i if (flags & FIRMWARE_UNLOAD) fp->flags |= FW_UNLOAD; if (fp->file) - taskqueue_enqueue(taskqueue_thread, &firmware_task); + taskqueue_enqueue(firmware_tq, &firmware_unload_task); } mtx_unlock(&firmware_mtx); } /* + * Setup directory state for the firmware_tq thread so we can do i/o. + */ +static void +set_rootvnode(void *arg, int npending) +{ + struct thread *td = curthread; + struct proc *p = td->td_proc; + + FILEDESC_XLOCK(p->p_fd); + if (p->p_fd->fd_cdir == NULL) { + p->p_fd->fd_cdir = rootvnode; + VREF(rootvnode); + } + if (p->p_fd->fd_rdir == NULL) { + p->p_fd->fd_rdir = rootvnode; + VREF(rootvnode); + } + FILEDESC_XUNLOCK(p->p_fd); + + free(arg, M_TEMP); +} + +/* + * Event handler called on mounting of /; bounce a task + * into the task queue thread to setup it's directories. + */ +static void +firmware_mountroot(void *arg) +{ + struct task *setroot_task; + + setroot_task = malloc(sizeof(struct task), M_TEMP, M_NOWAIT); + if (setroot_task != NULL) { + TASK_INIT(setroot_task, 0, set_rootvnode, setroot_task); + taskqueue_enqueue(firmware_tq, setroot_task); + } else + printf("%s: no memory for task!\n", __func__); +} +EVENTHANDLER_DEFINE(mountroot, firmware_mountroot, NULL, 0); + +/* * The body of the task in charge of unloading autoloaded modules * that are not needed anymore. * Images can be cross-linked so we may need to make multiple passes, @@ -383,11 +476,23 @@ static int firmware_modevent(module_t mod, int type, void *unused) { struct priv_fw *fp; - int i, err = EINVAL; + int i, err; switch (type) { case MOD_LOAD: - TASK_INIT(&firmware_task, 0, unloadentry, NULL); + TASK_INIT(&firmware_unload_task, 0, unloadentry, NULL); + firmware_tq = taskqueue_create("taskqueue_firmware", M_WAITOK, + taskqueue_thread_enqueue, &firmware_tq); + /* NB: use our own loop routine that sets up context */ + (void) taskqueue_start_threads(&firmware_tq, 1, PWAIT, + "firmware taskq"); + if (rootvnode != NULL) { + /* + * Root is already mounted so we won't get an event; + * simulate one here. + */ + firmware_mountroot(NULL); + } return 0; case MOD_UNLOAD: @@ -398,8 +503,9 @@ firmware_modevent(module_t mod, int type fp->flags |= FW_UNLOAD;; } mtx_unlock(&firmware_mtx); - taskqueue_enqueue(taskqueue_thread, &firmware_task); - taskqueue_drain(taskqueue_thread, &firmware_task); + taskqueue_enqueue(firmware_tq, &firmware_unload_task); + taskqueue_drain(firmware_tq, &firmware_unload_task); + err = 0; for (i = 0; i < FIRMWARE_MAX; i++) { fp = &firmware_table[i]; if (fp->fw.name != NULL) { @@ -409,6 +515,8 @@ firmware_modevent(module_t mod, int type err = EINVAL; } } + if (err == 0) + taskqueue_free(firmware_tq); return err; } return EINVAL; Modified: stable/7/sys/kern/vfs_mount.c ============================================================================== --- stable/7/sys/kern/vfs_mount.c Mon Oct 19 18:52:05 2009 (r198243) +++ stable/7/sys/kern/vfs_mount.c Mon Oct 19 19:11:00 2009 (r198244) @@ -1485,6 +1485,8 @@ set_rootvnode(struct thread *td) VREF(rootvnode); FILEDESC_XUNLOCK(p->p_fd); + + EVENTHANDLER_INVOKE(mountroot); } /* Modified: stable/7/sys/sys/eventhandler.h ============================================================================== --- stable/7/sys/sys/eventhandler.h Mon Oct 19 18:52:05 2009 (r198243) +++ stable/7/sys/sys/eventhandler.h Mon Oct 19 19:11:00 2009 (r198244) @@ -171,6 +171,10 @@ EVENTHANDLER_DECLARE(vm_lowmem, vm_lowme typedef void (*vfs_lowvnodes_handler_t)(void *, int); EVENTHANDLER_DECLARE(vfs_lowvnodes, vfs_lowvnodes_handler_t); +/* Root mounted event */ +typedef void (*mountroot_handler_t)(void *); +EVENTHANDLER_DECLARE(mountroot, mountroot_handler_t); + /* VLAN state change events */ struct ifnet; typedef void (*vlan_config_fn)(void *, struct ifnet *, uint16_t); From owner-svn-src-stable@FreeBSD.ORG Mon Oct 19 19:14:04 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B69481065676; Mon, 19 Oct 2009 19:14:04 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3F3B8FC12; Mon, 19 Oct 2009 19:14:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JJE4q8010255; Mon, 19 Oct 2009 19:14:04 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JJE4Cj010251; Mon, 19 Oct 2009 19:14:04 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <200910191914.n9JJE4Cj010251@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 19 Oct 2009 19:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198245 - in stable/6/sys: . conf contrib/pf dev/cxgb kern sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 19:14:04 -0000 Author: gallatin Date: Mon Oct 19 19:14:04 2009 New Revision: 198245 URL: http://svn.freebsd.org/changeset/base/198245 Log: MFC of 178042 to allow safe firmware(9) loading from NIC watchdog handlers. Also MFCed are the related changes 178016, 183614 and 184842. 178042: Do firmare image loading in a context known to have a root directory 183614: Dynamically allocate the task struct in firmware mountroot 184842: Avoid scheduling firmware taskqueues when cold 178016: Add a mountroot event handler. Removal of SI_SUB_MOUNT_ROOT was not merged. 178042 is dependant upon this. This fixes a panic in at least mxge(4) if the NIC has a hardware fault when the firmware image is not resident. Reviewed by: jhb Modified: stable/6/sys/ (props changed) stable/6/sys/conf/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) stable/6/sys/kern/subr_firmware.c stable/6/sys/kern/vfs_mount.c stable/6/sys/sys/eventhandler.h Modified: stable/6/sys/kern/subr_firmware.c ============================================================================== --- stable/6/sys/kern/subr_firmware.c Mon Oct 19 19:11:00 2009 (r198244) +++ stable/6/sys/kern/subr_firmware.c Mon Oct 19 19:14:04 2009 (r198245) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005, Sam Leffler + * Copyright (c) 2005-2008, Sam Leffler * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,6 +40,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +#include +#include /* * Loadable firmware support. See sys/sys/firmware.h and firmware(9) @@ -88,7 +92,7 @@ struct priv_fw { /* * 'file' is private info managed by the autoload/unload code. * Set at the end of firmware_get(), cleared only in the - * firmware_task, so the latter can depend on its value even + * firmware_unload_task, so the latter can depend on its value even * while the lock is not held. */ linker_file_t file; /* module file, if autoloaded */ @@ -120,14 +124,16 @@ struct priv_fw { static struct priv_fw firmware_table[FIRMWARE_MAX]; /* - * module release are handled in a separate task as they might sleep. + * Firmware module operations are handled in a separate task as they + * might sleep and they require directory context to do i/o. */ -struct task firmware_task; +static struct taskqueue *firmware_tq; +static struct task firmware_unload_task; /* * This mutex protects accesses to the firmware table. */ -struct mtx firmware_mtx; +static struct mtx firmware_mtx; MTX_SYSINIT(firmware, &firmware_mtx, "firmware table", MTX_DEF); /* @@ -226,7 +232,7 @@ firmware_unregister(const char *imagenam } else if (fp->refcnt != 0) { /* cannot unregister */ err = EBUSY; } else { - linker_file_t x = fp->file; /* save value */ + linker_file_t x = fp->file; /* save value */ if (fp->parent != NULL) /* release parent reference */ fp->parent->refcnt--; @@ -243,6 +249,47 @@ firmware_unregister(const char *imagenam return err; } +static void +loadimage(void *arg, int npending) +{ + struct thread *td = curthread; + char *imagename = arg; + struct priv_fw *fp; + linker_file_t result; + int error; + + /* synchronize with the thread that dispatched us */ + mtx_lock(&firmware_mtx); + mtx_unlock(&firmware_mtx); + + if (td->td_proc->p_fd->fd_rdir == NULL) { + printf("%s: root not mounted yet, no way to load image\n", + imagename); + goto done; + } + error = linker_reference_module(imagename, NULL, &result); + if (error != 0) { + printf("%s: could not load firmware image, error %d\n", + imagename, error); + goto done; + } + + mtx_lock(&firmware_mtx); + fp = lookup(imagename, NULL); + if (fp == NULL || fp->file != NULL) { + mtx_unlock(&firmware_mtx); + if (fp == NULL) + printf("%s: firmware image loaded, " + "but did not register\n", imagename); + (void) linker_release_module(imagename, NULL, NULL); + goto done; + } + fp->file = result; /* record the module identity */ + mtx_unlock(&firmware_mtx); +done: + wakeup_one(imagename); /* we're done */ +} + /* * Lookup and potentially load the specified firmware image. * If the firmware is not found in the registry, try to load a kernel @@ -253,9 +300,9 @@ firmware_unregister(const char *imagenam const struct firmware * firmware_get(const char *imagename) { + struct task fwload_task; struct thread *td; struct priv_fw *fp; - linker_file_t result; mtx_lock(&firmware_mtx); fp = lookup(imagename, NULL); @@ -264,29 +311,34 @@ firmware_get(const char *imagename) /* * Image not present, try to load the module holding it. */ - mtx_unlock(&firmware_mtx); td = curthread; if (suser(td) != 0 || securelevel_gt(td->td_ucred, 0) != 0) { + mtx_unlock(&firmware_mtx); printf("%s: insufficient privileges to " "load firmware image %s\n", __func__, imagename); return NULL; } - (void) linker_reference_module(imagename, NULL, &result); + /* + * Defer load to a thread with known context. linker_reference_module + * may do filesystem i/o which requires root & current dirs, etc. + * Also we must not hold any mtx's over this call which is problematic. + */ + if (!cold) { + TASK_INIT(&fwload_task, 0, loadimage, __DECONST(void *, + imagename)); + taskqueue_enqueue(firmware_tq, &fwload_task); + msleep(__DECONST(void *, imagename), &firmware_mtx, 0, + "fwload", 0); + } /* - * After loading the module, see if the image is registered now. + * After attempting to load the module, see if the image is registered. */ - mtx_lock(&firmware_mtx); fp = lookup(imagename, NULL); if (fp == NULL) { mtx_unlock(&firmware_mtx); - printf("%s: failed to load firmware image %s\n", - __func__, imagename); - (void) linker_release_module(imagename, NULL, NULL); return NULL; } - fp->file = result; /* record the module identity */ - found: /* common exit point on success */ fp->refcnt++; mtx_unlock(&firmware_mtx); @@ -299,8 +351,8 @@ found: /* common exit point on succes * to release the resource, but the flag is only advisory. * * If this is the last reference to the firmware image, and this is an - * autoloaded module, wake up the firmware_task to figure out what to do - * with the associated module. + * autoloaded module, wake up the firmware_unload_task to figure out + * what to do with the associated module. */ void firmware_put(const struct firmware *p, int flags) @@ -313,12 +365,62 @@ firmware_put(const struct firmware *p, i if (flags & FIRMWARE_UNLOAD) fp->flags |= FW_UNLOAD; if (fp->file) - taskqueue_enqueue(taskqueue_thread, &firmware_task); + taskqueue_enqueue(firmware_tq, &firmware_unload_task); } mtx_unlock(&firmware_mtx); } /* + * Setup directory state for the firmware_tq thread so we can do i/o. + */ +static void +set_rootvnode(void *arg, int npending) +{ + struct thread *td = curthread; + struct proc *p = td->td_proc; + + FILEDESC_LOCK(p->p_fd); + if (p->p_fd->fd_cdir == NULL) { + p->p_fd->fd_cdir = rootvnode; + VREF(rootvnode); + } + if (p->p_fd->fd_rdir == NULL) { + p->p_fd->fd_rdir = rootvnode; + VREF(rootvnode); + } + FILEDESC_UNLOCK(p->p_fd); + + free(arg, M_TEMP); +} + +/* + * Event handler called on mounting of /; bounce a task + * into the task queue thread to setup it's directories. + */ +static void +firmware_mountroot(void *arg) +{ + struct task *setroot_task; + + setroot_task = malloc(sizeof(struct task), M_TEMP, M_NOWAIT); + if (setroot_task != NULL) { + TASK_INIT(setroot_task, 0, set_rootvnode, setroot_task); + taskqueue_enqueue(firmware_tq, setroot_task); + } else + printf("%s: no memory for task!\n", __func__); +} + +static eventhandler_tag mountroot_tag; +static void +mountroot_evh_init(void *ctx) +{ + mountroot_tag = EVENTHANDLER_REGISTER(mountroot, + firmware_mountroot, ctx, 0); +} +SYSINIT(mountroot_evh_init, SI_SUB_CONFIGURE, SI_ORDER_ANY, + mountroot_evh_init, NULL); + +/* * The body of the task in charge of unloading autoloaded modules * that are not needed anymore. * Images can be cross-linked so we may need to make multiple passes, @@ -382,11 +484,23 @@ static int firmware_modevent(module_t mod, int type, void *unused) { struct priv_fw *fp; - int i, err = EINVAL; + int i, err; switch (type) { case MOD_LOAD: - TASK_INIT(&firmware_task, 0, unloadentry, NULL); + TASK_INIT(&firmware_unload_task, 0, unloadentry, NULL); + firmware_tq = taskqueue_create("taskqueue_firmware", M_WAITOK, + taskqueue_thread_enqueue, &firmware_tq, NULL); + /* NB: use our own loop routine that sets up context */ + (void) taskqueue_start_threads(&firmware_tq, 1, PWAIT, + "firmware taskq"); + if (rootvnode != NULL) { + /* + * Root is already mounted so we won't get an event; + * simulate one here. + */ + firmware_mountroot(NULL); + } return 0; case MOD_UNLOAD: @@ -397,8 +511,9 @@ firmware_modevent(module_t mod, int type fp->flags |= FW_UNLOAD;; } mtx_unlock(&firmware_mtx); - taskqueue_enqueue(taskqueue_thread, &firmware_task); - taskqueue_drain(taskqueue_thread, &firmware_task); + taskqueue_enqueue(firmware_tq, &firmware_unload_task); + taskqueue_drain(firmware_tq, &firmware_unload_task); + err = 0; for (i = 0; i < FIRMWARE_MAX; i++) { fp = &firmware_table[i]; if (fp->fw.name != NULL) { @@ -408,6 +523,8 @@ firmware_modevent(module_t mod, int type err = EINVAL; } } + if (err == 0) + taskqueue_free(firmware_tq); return err; } return EINVAL; Modified: stable/6/sys/kern/vfs_mount.c ============================================================================== --- stable/6/sys/kern/vfs_mount.c Mon Oct 19 19:11:00 2009 (r198244) +++ stable/6/sys/kern/vfs_mount.c Mon Oct 19 19:14:04 2009 (r198245) @@ -1360,6 +1360,8 @@ set_rootvnode(struct thread *td) FILEDESC_UNLOCK(p->p_fd); VOP_UNLOCK(rootvnode, 0, td); + + EVENTHANDLER_INVOKE(mountroot); } /* Modified: stable/6/sys/sys/eventhandler.h ============================================================================== --- stable/6/sys/sys/eventhandler.h Mon Oct 19 19:11:00 2009 (r198244) +++ stable/6/sys/sys/eventhandler.h Mon Oct 19 19:14:04 2009 (r198245) @@ -156,6 +156,10 @@ typedef void (*vm_lowmem_handler_t)(void #define LOWMEM_PRI_DEFAULT EVENTHANDLER_PRI_FIRST EVENTHANDLER_DECLARE(vm_lowmem, vm_lowmem_handler_t); +/* Root mounted event */ +typedef void (*mountroot_handler_t)(void *); +EVENTHANDLER_DECLARE(mountroot, mountroot_handler_t); + /* * Process events * process_fork and exit handlers are called without Giant. From owner-svn-src-stable@FreeBSD.ORG Mon Oct 19 19:40:05 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98DB1106566C; Mon, 19 Oct 2009 19:40:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86CB38FC13; Mon, 19 Oct 2009 19:40:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JJe5TH010740; Mon, 19 Oct 2009 19:40:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JJe58R010738; Mon, 19 Oct 2009 19:40:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200910191940.n9JJe58R010738@svn.freebsd.org> From: John Baldwin Date: Mon, 19 Oct 2009 19:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198246 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 19:40:05 -0000 Author: jhb Date: Mon Oct 19 19:40:05 2009 New Revision: 198246 URL: http://svn.freebsd.org/changeset/base/198246 Log: MFC 198126: Fix a sign bug in the handling of nice priorities when computing the interactive score for a thread. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/kern/sched_ule.c Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Mon Oct 19 19:14:04 2009 (r198245) +++ stable/8/sys/kern/sched_ule.c Mon Oct 19 19:40:05 2009 (r198246) @@ -1406,7 +1406,7 @@ sched_priority(struct thread *td) * score. Negative nice values make it easier for a thread to be * considered interactive. */ - score = imax(0, sched_interact_score(td) - td->td_proc->p_nice); + score = imax(0, sched_interact_score(td) + td->td_proc->p_nice); if (score < sched_interact) { pri = PRI_MIN_REALTIME; pri += ((PRI_MAX_REALTIME - PRI_MIN_REALTIME) / sched_interact) From owner-svn-src-stable@FreeBSD.ORG Mon Oct 19 19:45:58 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 417FE106566B; Mon, 19 Oct 2009 19:45:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30EBA8FC20; Mon, 19 Oct 2009 19:45:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JJjwn9010907; Mon, 19 Oct 2009 19:45:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JJjw0X010905; Mon, 19 Oct 2009 19:45:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200910191945.n9JJjw0X010905@svn.freebsd.org> From: John Baldwin Date: Mon, 19 Oct 2009 19:45:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198247 - in stable/7/sys: . contrib/pf kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 19:45:58 -0000 Author: jhb Date: Mon Oct 19 19:45:57 2009 New Revision: 198247 URL: http://svn.freebsd.org/changeset/base/198247 Log: MFC 198126: Fix a sign bug in the handling of nice priorities when computing the interactive score for a thread. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/sched_ule.c Modified: stable/7/sys/kern/sched_ule.c ============================================================================== --- stable/7/sys/kern/sched_ule.c Mon Oct 19 19:40:05 2009 (r198246) +++ stable/7/sys/kern/sched_ule.c Mon Oct 19 19:45:57 2009 (r198247) @@ -1474,7 +1474,7 @@ sched_priority(struct thread *td) * score. Negative nice values make it easier for a thread to be * considered interactive. */ - score = imax(0, sched_interact_score(td) - td->td_proc->p_nice); + score = imax(0, sched_interact_score(td) + td->td_proc->p_nice); if (score < sched_interact) { pri = PRI_MIN_REALTIME; pri += ((PRI_MAX_REALTIME - PRI_MIN_REALTIME) / sched_interact) From owner-svn-src-stable@FreeBSD.ORG Tue Oct 20 11:52:39 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B985D1065696; Tue, 20 Oct 2009 11:52:39 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A82958FC1D; Tue, 20 Oct 2009 11:52:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KBqdXZ066115; Tue, 20 Oct 2009 11:52:39 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KBqd7T066113; Tue, 20 Oct 2009 11:52:39 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200910201152.n9KBqd7T066113@svn.freebsd.org> From: Hajimu UMEMOTO Date: Tue, 20 Oct 2009 11:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198276 - stable/8/bin/csh X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 11:52:39 -0000 Author: ume Date: Tue Oct 20 11:52:39 2009 New Revision: 198276 URL: http://svn.freebsd.org/changeset/base/198276 Log: MFC r198189: Check error of dlfunc(3). Approved by: re (kib) Modified: stable/8/bin/csh/ (props changed) stable/8/bin/csh/iconv_stub.c Modified: stable/8/bin/csh/iconv_stub.c ============================================================================== --- stable/8/bin/csh/iconv_stub.c Tue Oct 20 10:40:01 2009 (r198275) +++ stable/8/bin/csh/iconv_stub.c Tue Oct 20 11:52:39 2009 (r198276) @@ -61,9 +61,20 @@ dl_iconv_open(const char *tocode, const if (iconvlib == NULL) return (iconv_t)-1; iconv_open = (iconv_open_t *)dlfunc(iconvlib, ICONV_OPEN); + if (iconv_open == NULL) + goto dlfunc_err; dl_iconv = (dl_iconv_t *)dlfunc(iconvlib, ICONV_ENGINE); + if (dl_iconv == NULL) + goto dlfunc_err; dl_iconv_close = (dl_iconv_close_t *)dlfunc(iconvlib, ICONV_CLOSE); + if (dl_iconv_close == NULL) + goto dlfunc_err; } return iconv_open(tocode, fromcode); + +dlfunc_err: + dlclose(iconvlib); + iconvlib = NULL; + return (iconv_t)-1; } From owner-svn-src-stable@FreeBSD.ORG Tue Oct 20 13:26:58 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72615106566C; Tue, 20 Oct 2009 13:26:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4713A8FC0C; Tue, 20 Oct 2009 13:26:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KDQwPa068015; Tue, 20 Oct 2009 13:26:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KDQwCe068013; Tue, 20 Oct 2009 13:26:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910201326.n9KDQwCe068013@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 20 Oct 2009 13:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198280 - stable/8/libexec/rtld-elf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 13:26:58 -0000 Author: kib Date: Tue Oct 20 13:26:58 2009 New Revision: 198280 URL: http://svn.freebsd.org/changeset/base/198280 Log: MFC r197931: Apply relocations for PIE binary ELF data structures pointers in rtld. Approved by: re (kensmith) Modified: stable/8/libexec/rtld-elf/ (props changed) stable/8/libexec/rtld-elf/rtld.c Modified: stable/8/libexec/rtld-elf/rtld.c ============================================================================== --- stable/8/libexec/rtld-elf/rtld.c Tue Oct 20 13:22:54 2009 (r198279) +++ stable/8/libexec/rtld-elf/rtld.c Tue Oct 20 13:26:58 2009 (r198280) @@ -474,6 +474,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ /* Initialize a fake symbol for resolving undefined weak references. */ sym_zero.st_info = ELF_ST_INFO(STB_GLOBAL, STT_NOTYPE); sym_zero.st_shndx = SHN_UNDEF; + sym_zero.st_value = -(uintptr_t)obj_main->relocbase; if (!libmap_disable) libmap_disable = (bool)lm_init(libmap_override); @@ -991,26 +992,26 @@ digest_phdr(const Elf_Phdr *phdr, int ph obj = obj_new(); for (ph = phdr; ph < phlimit; ph++) { - switch (ph->p_type) { + if (ph->p_type != PT_PHDR) + continue; - case PT_PHDR: - if ((const Elf_Phdr *)ph->p_vaddr != phdr) { - _rtld_error("%s: invalid PT_PHDR", path); - return NULL; - } - obj->phdr = (const Elf_Phdr *) ph->p_vaddr; - obj->phsize = ph->p_memsz; - break; + obj->phdr = phdr; + obj->phsize = ph->p_memsz; + obj->relocbase = (caddr_t)phdr - ph->p_vaddr; + break; + } + + for (ph = phdr; ph < phlimit; ph++) { + switch (ph->p_type) { case PT_INTERP: - obj->interp = (const char *) ph->p_vaddr; + obj->interp = (const char *)(ph->p_vaddr + obj->relocbase); break; case PT_LOAD: if (nsegs == 0) { /* First load segment */ obj->vaddrbase = trunc_page(ph->p_vaddr); - obj->mapbase = (caddr_t) obj->vaddrbase; - obj->relocbase = obj->mapbase - obj->vaddrbase; + obj->mapbase = obj->vaddrbase + obj->relocbase; obj->textsize = round_page(ph->p_vaddr + ph->p_memsz) - obj->vaddrbase; } else { /* Last load segment */ @@ -1021,7 +1022,7 @@ digest_phdr(const Elf_Phdr *phdr, int ph break; case PT_DYNAMIC: - obj->dynamic = (const Elf_Dyn *) ph->p_vaddr; + obj->dynamic = (const Elf_Dyn *)(ph->p_vaddr + obj->relocbase); break; case PT_TLS: @@ -1029,7 +1030,7 @@ digest_phdr(const Elf_Phdr *phdr, int ph obj->tlssize = ph->p_memsz; obj->tlsalign = ph->p_align; obj->tlsinitsize = ph->p_filesz; - obj->tlsinit = (void*) ph->p_vaddr; + obj->tlsinit = (void*)(ph->p_vaddr + obj->relocbase); break; } } From owner-svn-src-stable@FreeBSD.ORG Tue Oct 20 13:30:07 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3007F106566B; Tue, 20 Oct 2009 13:30:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D4FF8FC1B; Tue, 20 Oct 2009 13:30:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KDU7Wg068117; Tue, 20 Oct 2009 13:30:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KDU6VD068115; Tue, 20 Oct 2009 13:30:06 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910201330.n9KDU6VD068115@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 20 Oct 2009 13:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198281 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 13:30:07 -0000 Author: kib Date: Tue Oct 20 13:30:06 2009 New Revision: 198281 URL: http://svn.freebsd.org/changeset/base/198281 Log: MFC r197932: Do not map elf segments of zero length. Approved by: re (kensmith) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/kern/imgact_elf.c Modified: stable/8/sys/kern/imgact_elf.c ============================================================================== --- stable/8/sys/kern/imgact_elf.c Tue Oct 20 13:26:58 2009 (r198280) +++ stable/8/sys/kern/imgact_elf.c Tue Oct 20 13:30:06 2009 (r198281) @@ -632,7 +632,8 @@ __elfN(load_file)(struct proc *p, const } for (i = 0, numsegs = 0; i < hdr->e_phnum; i++) { - if (phdr[i].p_type == PT_LOAD) { /* Loadable segment */ + if (phdr[i].p_type == PT_LOAD && phdr[i].p_memsz != 0) { + /* Loadable segment */ prot = 0; if (phdr[i].p_flags & PF_X) prot |= VM_PROT_EXECUTE; @@ -761,6 +762,8 @@ __CONCAT(exec_, __elfN(imgact))(struct i for (i = 0; i < hdr->e_phnum; i++) { switch (phdr[i].p_type) { case PT_LOAD: /* Loadable segment */ + if (phdr[i].p_memsz == 0) + break; prot = 0; if (phdr[i].p_flags & PF_X) prot |= VM_PROT_EXECUTE; From owner-svn-src-stable@FreeBSD.ORG Tue Oct 20 13:32:18 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAC041065676; Tue, 20 Oct 2009 13:32:18 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 988358FC17; Tue, 20 Oct 2009 13:32:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KDWIGQ068202; Tue, 20 Oct 2009 13:32:18 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KDWIa3068200; Tue, 20 Oct 2009 13:32:18 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200910201332.n9KDWIa3068200@svn.freebsd.org> From: Ken Smith Date: Tue, 20 Oct 2009 13:32:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198282 - in stable/8/release: . doc doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 13:32:18 -0000 Author: kensmith Date: Tue Oct 20 13:32:18 2009 New Revision: 198282 URL: http://svn.freebsd.org/changeset/base/198282 Log: MFC r197313: Build a separate livefs CD for sparc64. Approved by: re (kib) Modified: stable/8/release/ (props changed) stable/8/release/Makefile stable/8/release/doc/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: stable/8/release/Makefile ============================================================================== --- stable/8/release/Makefile Tue Oct 20 13:30:06 2009 (r198281) +++ stable/8/release/Makefile Tue Oct 20 13:32:18 2009 (r198282) @@ -242,6 +242,7 @@ MFSSIZE= 4096 MFSINODE= 8192 MFSLABEL= auto MINIROOT= +SEPARATE_LIVEFS= .elif ${TARGET_ARCH} == "ia64" DISKLABEL= "" MAKE_DVD= From owner-svn-src-stable@FreeBSD.ORG Tue Oct 20 13:32:29 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27CA61065694; Tue, 20 Oct 2009 13:32:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89D0A8FC20; Tue, 20 Oct 2009 13:32:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KDWS9a068246; Tue, 20 Oct 2009 13:32:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KDWS4l068237; Tue, 20 Oct 2009 13:32:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910201332.n9KDWS4l068237@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 20 Oct 2009 13:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198283 - in stable/8/sys: . amd64/include amd64/include/xen arm/include cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci i386/include ia64/include mips/include pow... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 13:32:29 -0000 Author: kib Date: Tue Oct 20 13:32:28 2009 New Revision: 198283 URL: http://svn.freebsd.org/changeset/base/198283 Log: MFC r197933: Define architectural load bases for PIE binaries. MFC r198203 (by marius): Change load base for sparc to match default gcc memory layout model. Approved by: re (kensmith) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/elf.h stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/arm/include/elf.h stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/i386/include/elf.h stable/8/sys/ia64/include/elf.h stable/8/sys/mips/include/elf.h stable/8/sys/powerpc/include/elf.h stable/8/sys/sparc64/include/elf.h stable/8/sys/sun4v/include/elf.h Modified: stable/8/sys/amd64/include/elf.h ============================================================================== --- stable/8/sys/amd64/include/elf.h Tue Oct 20 13:32:18 2009 (r198282) +++ stable/8/sys/amd64/include/elf.h Tue Oct 20 13:32:28 2009 (r198283) @@ -106,4 +106,10 @@ __ElfType(Auxinfo); #define ELF_TARG_MACH EM_X86_64 #define ELF_TARG_VER 1 +#if __ELF_WORD_SIZE == 32 +#define ET_DYN_LOAD_ADDR 0x01001000 +#else +#define ET_DYN_LOAD_ADDR 0x01021000 +#endif + #endif /* !_MACHINE_ELF_H_ */ Modified: stable/8/sys/arm/include/elf.h ============================================================================== --- stable/8/sys/arm/include/elf.h Tue Oct 20 13:32:18 2009 (r198282) +++ stable/8/sys/arm/include/elf.h Tue Oct 20 13:32:28 2009 (r198283) @@ -97,4 +97,7 @@ __ElfType(Auxinfo); * value. */ #define MAGIC_TRAMP_NUMBER 0x5c000003 + +#define ET_DYN_LOAD_ADDR 0x12000 + #endif /* !_MACHINE_ELF_H_ */ Modified: stable/8/sys/i386/include/elf.h ============================================================================== --- stable/8/sys/i386/include/elf.h Tue Oct 20 13:32:18 2009 (r198282) +++ stable/8/sys/i386/include/elf.h Tue Oct 20 13:32:28 2009 (r198283) @@ -105,4 +105,6 @@ __ElfType(Auxinfo); #define ELF_TARG_MACH EM_386 #define ELF_TARG_VER 1 +#define ET_DYN_LOAD_ADDR 0x01001000 + #endif /* !_MACHINE_ELF_H_ */ Modified: stable/8/sys/ia64/include/elf.h ============================================================================== --- stable/8/sys/ia64/include/elf.h Tue Oct 20 13:32:18 2009 (r198282) +++ stable/8/sys/ia64/include/elf.h Tue Oct 20 13:32:28 2009 (r198283) @@ -141,4 +141,6 @@ __ElfType(Auxinfo); #define DT_IA_64_PLT_RESERVE 0x70000000 +#define ET_DYN_LOAD_ADDR 0x2500000000000000 + #endif /* !_MACHINE_ELF_H_ */ Modified: stable/8/sys/mips/include/elf.h ============================================================================== --- stable/8/sys/mips/include/elf.h Tue Oct 20 13:32:18 2009 (r198282) +++ stable/8/sys/mips/include/elf.h Tue Oct 20 13:32:28 2009 (r198283) @@ -250,4 +250,6 @@ __ElfType(Auxinfo); #define AT_COUNT 16 /* Count of defined aux entry types. */ +#define ET_DYN_LOAD_ADDR 0x0120000 + #endif /* !_MACHINE_ELF_H_ */ Modified: stable/8/sys/powerpc/include/elf.h ============================================================================== --- stable/8/sys/powerpc/include/elf.h Tue Oct 20 13:32:18 2009 (r198282) +++ stable/8/sys/powerpc/include/elf.h Tue Oct 20 13:32:28 2009 (r198283) @@ -96,4 +96,6 @@ __ElfType(Auxinfo); #define ELF_TARG_MACH EM_PPC #define ELF_TARG_VER 1 +#define ET_DYN_LOAD_ADDR 0x01010000 + #endif /* !_MACHINE_ELF_H_ */ Modified: stable/8/sys/sparc64/include/elf.h ============================================================================== --- stable/8/sys/sparc64/include/elf.h Tue Oct 20 13:32:18 2009 (r198282) +++ stable/8/sys/sparc64/include/elf.h Tue Oct 20 13:32:28 2009 (r198283) @@ -97,4 +97,6 @@ __ElfType(Auxinfo); #define ELF_TARG_MACH ELF_ARCH #define ELF_TARG_VER 1 +#define ET_DYN_LOAD_ADDR 0x100000 + #endif /* !_MACHINE_ELF_H_ */ Modified: stable/8/sys/sun4v/include/elf.h ============================================================================== --- stable/8/sys/sun4v/include/elf.h Tue Oct 20 13:32:18 2009 (r198282) +++ stable/8/sys/sun4v/include/elf.h Tue Oct 20 13:32:28 2009 (r198283) @@ -97,4 +97,6 @@ __ElfType(Auxinfo); #define ELF_TARG_MACH ELF_ARCH #define ELF_TARG_VER 1 +#define ET_DYN_LOAD_ADDR 0x100000 + #endif /* !_MACHINE_ELF_H_ */ From owner-svn-src-stable@FreeBSD.ORG Tue Oct 20 13:34:42 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E7901065679; Tue, 20 Oct 2009 13:34:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B31F8FC36; Tue, 20 Oct 2009 13:34:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KDYgOq068348; Tue, 20 Oct 2009 13:34:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KDYgBB068346; Tue, 20 Oct 2009 13:34:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910201334.n9KDYgBB068346@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 20 Oct 2009 13:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198284 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 13:34:42 -0000 Author: kib Date: Tue Oct 20 13:34:41 2009 New Revision: 198284 URL: http://svn.freebsd.org/changeset/base/198284 Log: MFC r197934: Map PIE binaries at non-zero base address. MFC r198202: Honour non-zero mapbase for PIE binaries. Inform interpreter-less PIE binary about its relocbase. Approved by: re (kensmith) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/kern/imgact_elf.c Modified: stable/8/sys/kern/imgact_elf.c ============================================================================== --- stable/8/sys/kern/imgact_elf.c Tue Oct 20 13:32:28 2009 (r198283) +++ stable/8/sys/kern/imgact_elf.c Tue Oct 20 13:34:41 2009 (r198284) @@ -685,9 +685,9 @@ __CONCAT(exec_, __elfN(imgact))(struct i u_long text_size = 0, data_size = 0, total_size = 0; u_long text_addr = 0, data_addr = 0; u_long seg_size, seg_addr; - u_long addr, entry = 0, proghdr = 0; + u_long addr, baddr, et_dyn_addr, entry = 0, proghdr = 0; int32_t osrel = 0; - int error = 0, i; + int error = 0, i, n; const char *interp = NULL, *newinterp = NULL; Elf_Brandinfo *brand_info; char *path; @@ -716,14 +716,22 @@ __CONCAT(exec_, __elfN(imgact))(struct i phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff); if (!aligned(phdr, Elf_Addr)) return (ENOEXEC); + n = 0; + baddr = 0; for (i = 0; i < hdr->e_phnum; i++) { + if (phdr[i].p_type == PT_LOAD) { + if (n == 0) + baddr = phdr[i].p_vaddr; + n++; + continue; + } if (phdr[i].p_type == PT_INTERP) { /* Path to interpreter */ if (phdr[i].p_filesz > MAXPATHLEN || phdr[i].p_offset + phdr[i].p_filesz > PAGE_SIZE) return (ENOEXEC); interp = imgp->image_header + phdr[i].p_offset; - break; + continue; } } @@ -733,9 +741,19 @@ __CONCAT(exec_, __elfN(imgact))(struct i hdr->e_ident[EI_OSABI]); return (ENOEXEC); } - if (hdr->e_type == ET_DYN && - (brand_info->flags & BI_CAN_EXEC_DYN) == 0) - return (ENOEXEC); + if (hdr->e_type == ET_DYN) { + if ((brand_info->flags & BI_CAN_EXEC_DYN) == 0) + return (ENOEXEC); + /* + * Honour the base load address from the dso if it is + * non-zero for some reason. + */ + if (baddr == 0) + et_dyn_addr = ET_DYN_LOAD_ADDR; + else + et_dyn_addr = 0; + } else + et_dyn_addr = 0; sv = brand_info->sysvec; if (interp != NULL && brand_info->interp_newpath != NULL) newinterp = brand_info->interp_newpath; @@ -783,7 +801,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i if ((error = __elfN(load_section)(vmspace, imgp->object, phdr[i].p_offset, - (caddr_t)(uintptr_t)phdr[i].p_vaddr, + (caddr_t)(uintptr_t)phdr[i].p_vaddr + et_dyn_addr, phdr[i].p_memsz, phdr[i].p_filesz, prot, sv->sv_pagesize)) != 0) return (error); @@ -797,11 +815,12 @@ __CONCAT(exec_, __elfN(imgact))(struct i if (phdr[i].p_offset == 0 && hdr->e_phoff + hdr->e_phnum * hdr->e_phentsize <= phdr[i].p_filesz) - proghdr = phdr[i].p_vaddr + hdr->e_phoff; + proghdr = phdr[i].p_vaddr + hdr->e_phoff + + et_dyn_addr; - seg_addr = trunc_page(phdr[i].p_vaddr); + seg_addr = trunc_page(phdr[i].p_vaddr + et_dyn_addr); seg_size = round_page(phdr[i].p_memsz + - phdr[i].p_vaddr - seg_addr); + phdr[i].p_vaddr + et_dyn_addr - seg_addr); /* * Is this .text or .data? We can't use @@ -823,7 +842,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i phdr[i].p_memsz)) { text_size = seg_size; text_addr = seg_addr; - entry = (u_long)hdr->e_entry; + entry = (u_long)hdr->e_entry + et_dyn_addr; } else { data_size = seg_size; data_addr = seg_addr; @@ -831,7 +850,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i total_size += seg_size; break; case PT_PHDR: /* Program header table info */ - proghdr = phdr[i].p_vaddr; + proghdr = phdr[i].p_vaddr + et_dyn_addr; break; default: break; @@ -903,7 +922,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i return (error); } } else - addr = 0; + addr = et_dyn_addr; /* * Construct auxargs table (used by the fixup routine) From owner-svn-src-stable@FreeBSD.ORG Tue Oct 20 13:47:05 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD101106566C; Tue, 20 Oct 2009 13:47:05 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBA838FC24; Tue, 20 Oct 2009 13:47:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KDl53J068656; Tue, 20 Oct 2009 13:47:05 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KDl5eN068654; Tue, 20 Oct 2009 13:47:05 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200910201347.n9KDl5eN068654@svn.freebsd.org> From: Hajimu UMEMOTO Date: Tue, 20 Oct 2009 13:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198285 - stable/7/bin/csh X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 13:47:06 -0000 Author: ume Date: Tue Oct 20 13:47:05 2009 New Revision: 198285 URL: http://svn.freebsd.org/changeset/base/198285 Log: MFC r198189: Check error of dlfunc(3). Modified: stable/7/bin/csh/ (props changed) stable/7/bin/csh/iconv_stub.c Modified: stable/7/bin/csh/iconv_stub.c ============================================================================== --- stable/7/bin/csh/iconv_stub.c Tue Oct 20 13:34:41 2009 (r198284) +++ stable/7/bin/csh/iconv_stub.c Tue Oct 20 13:47:05 2009 (r198285) @@ -61,9 +61,20 @@ dl_iconv_open(const char *tocode, const if (iconvlib == NULL) return (iconv_t)-1; iconv_open = (iconv_open_t *)dlfunc(iconvlib, ICONV_OPEN); + if (iconv_open == NULL) + goto dlfunc_err; dl_iconv = (dl_iconv_t *)dlfunc(iconvlib, ICONV_ENGINE); + if (dl_iconv == NULL) + goto dlfunc_err; dl_iconv_close = (dl_iconv_close_t *)dlfunc(iconvlib, ICONV_CLOSE); + if (dl_iconv_close == NULL) + goto dlfunc_err; } return iconv_open(tocode, fromcode); + +dlfunc_err: + dlclose(iconvlib); + iconvlib = NULL; + return (iconv_t)-1; } From owner-svn-src-stable@FreeBSD.ORG Tue Oct 20 13:49:34 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63C5D1065670; Tue, 20 Oct 2009 13:49:34 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 525908FC1A; Tue, 20 Oct 2009 13:49:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KDnY1v068760; Tue, 20 Oct 2009 13:49:34 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KDnYvC068758; Tue, 20 Oct 2009 13:49:34 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200910201349.n9KDnYvC068758@svn.freebsd.org> From: Hajimu UMEMOTO Date: Tue, 20 Oct 2009 13:49:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198286 - stable/6/bin/csh X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 13:49:34 -0000 Author: ume Date: Tue Oct 20 13:49:34 2009 New Revision: 198286 URL: http://svn.freebsd.org/changeset/base/198286 Log: MFC r198189: Check error of dlfunc(3). Modified: stable/6/bin/csh/ (props changed) stable/6/bin/csh/iconv_stub.c Modified: stable/6/bin/csh/iconv_stub.c ============================================================================== --- stable/6/bin/csh/iconv_stub.c Tue Oct 20 13:47:05 2009 (r198285) +++ stable/6/bin/csh/iconv_stub.c Tue Oct 20 13:49:34 2009 (r198286) @@ -61,9 +61,20 @@ dl_iconv_open(const char *tocode, const if (iconvlib == NULL) return (iconv_t)-1; iconv_open = (iconv_open_t *)dlfunc(iconvlib, ICONV_OPEN); + if (iconv_open == NULL) + goto dlfunc_err; dl_iconv = (dl_iconv_t *)dlfunc(iconvlib, ICONV_ENGINE); + if (dl_iconv == NULL) + goto dlfunc_err; dl_iconv_close = (dl_iconv_close_t *)dlfunc(iconvlib, ICONV_CLOSE); + if (dl_iconv_close == NULL) + goto dlfunc_err; } return iconv_open(tocode, fromcode); + +dlfunc_err: + dlclose(iconvlib); + iconvlib = NULL; + return (iconv_t)-1; } From owner-svn-src-stable@FreeBSD.ORG Tue Oct 20 16:22:31 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FBFB106566B; Tue, 20 Oct 2009 16:22:31 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C81D8FC17; Tue, 20 Oct 2009 16:22:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KGMVlQ071823; Tue, 20 Oct 2009 16:22:31 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KGMVHK071821; Tue, 20 Oct 2009 16:22:31 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910201622.n9KGMVHK071821@svn.freebsd.org> From: Robert Watson Date: Tue, 20 Oct 2009 16:22:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198293 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 16:22:31 -0000 Author: rwatson Date: Tue Oct 20 16:22:31 2009 New Revision: 198293 URL: http://svn.freebsd.org/changeset/base/198293 Log: Merge r198196 from head to stable/8: Rewrap ip_input() comment so that it prints more nicely. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ip_input.c Modified: stable/8/sys/netinet/ip_input.c ============================================================================== --- stable/8/sys/netinet/ip_input.c Tue Oct 20 15:49:32 2009 (r198292) +++ stable/8/sys/netinet/ip_input.c Tue Oct 20 16:22:31 2009 (r198293) @@ -530,9 +530,9 @@ tooshort: } if ((dchg = (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL)) != 0) { /* - * Directly ship on the packet. This allows to forward packets - * that were destined for us to some other directly connected - * host. + * Directly ship on the packet. This allows to forward + * packets that were destined for us to some other directly + * connected host. */ ip_forward(m, dchg); return; From owner-svn-src-stable@FreeBSD.ORG Tue Oct 20 16:41:24 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 573C51065672; Tue, 20 Oct 2009 16:41:24 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 45AB18FC1E; Tue, 20 Oct 2009 16:41:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KGfNGV072250; Tue, 20 Oct 2009 16:41:23 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KGfN7Z072248; Tue, 20 Oct 2009 16:41:23 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200910201641.n9KGfN7Z072248@svn.freebsd.org> From: Stanislav Sedov Date: Tue, 20 Oct 2009 16:41:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198296 - stable/8/sys/dev/bge X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 16:41:24 -0000 Author: stas Date: Tue Oct 20 16:41:23 2009 New Revision: 198296 URL: http://svn.freebsd.org/changeset/base/198296 Log: - Disable ASF by default in STABLE_8. This causes a lot of problems on non-DELL branded machines with IPMI support. The proposed fix was committed to HEAD but has not received much test coverage yet. Discussed with: bz Approved by: re (kensmith) Modified: stable/8/sys/dev/bge/if_bge.c Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Tue Oct 20 16:36:51 2009 (r198295) +++ stable/8/sys/dev/bge/if_bge.c Tue Oct 20 16:41:23 2009 (r198296) @@ -446,7 +446,7 @@ static devclass_t bge_devclass; DRIVER_MODULE(bge, pci, bge_driver, bge_devclass, 0, 0); DRIVER_MODULE(miibus, bge, miibus_driver, miibus_devclass, 0, 0); -static int bge_allow_asf = 1; +static int bge_allow_asf = 0; TUNABLE_INT("hw.bge.allow_asf", &bge_allow_asf); From owner-svn-src-stable@FreeBSD.ORG Tue Oct 20 17:44:51 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 575821065672; Tue, 20 Oct 2009 17:44:51 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43F138FC17; Tue, 20 Oct 2009 17:44:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KHipMv073640; Tue, 20 Oct 2009 17:44:51 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KHipOo073637; Tue, 20 Oct 2009 17:44:51 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200910201744.n9KHipOo073637@svn.freebsd.org> From: Qing Li Date: Tue, 20 Oct 2009 17:44:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198298 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 17:44:51 -0000 Author: qingli Date: Tue Oct 20 17:44:50 2009 New Revision: 198298 URL: http://svn.freebsd.org/changeset/base/198298 Log: MFC r198111 This patch fixes the following issues in the ARP operation: 1. There is a regression issue in the ARP code. The incomplete ARP entry was timing out too quickly (1 second timeout), as such, a new entry is created each time arpresolve() is called. Therefore the maximum attempts made is always 1. Consequently the error code returned to the application is always 0. 2. Set the expiration of each incomplete entry to a 20-second lifetime. 3. Return "incomplete" entries to the application. 4. The return error code was incorrect. Reviewed by: kmacy Approved by: re Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/if_ether.c stable/8/sys/netinet/in.c Modified: stable/8/sys/netinet/if_ether.c ============================================================================== --- stable/8/sys/netinet/if_ether.c Tue Oct 20 16:46:39 2009 (r198297) +++ stable/8/sys/netinet/if_ether.c Tue Oct 20 17:44:50 2009 (r198298) @@ -87,10 +87,13 @@ VNET_DEFINE(int, useloopback) = 1; /* us /* timer values */ static VNET_DEFINE(int, arpt_keep) = (20*60); /* once resolved, good for 20 * minutes */ +static VNET_DEFINE(int, arpt_down) = 20; /* keep incomplete entries for + * 20 seconds */ static VNET_DEFINE(int, arp_maxtries) = 5; static VNET_DEFINE(int, arp_proxyall); #define V_arpt_keep VNET(arpt_keep) +#define V_arpt_down VNET(arpt_down) #define V_arp_maxtries VNET(arp_maxtries) #define V_arp_proxyall VNET(arp_proxyall) @@ -299,7 +302,7 @@ retry: } if ((la->la_flags & LLE_VALID) && - ((la->la_flags & LLE_STATIC) || la->la_expire > time_uptime)) { + ((la->la_flags & LLE_STATIC) || la->la_expire > time_second)) { bcopy(&la->ll_addr, desten, ifp->if_addrlen); /* * If entry has an expiry time and it is approaching, @@ -307,7 +310,7 @@ retry: * arpt_down interval. */ if (!(la->la_flags & LLE_STATIC) && - time_uptime + la->la_preempt > la->la_expire) { + time_second + la->la_preempt > la->la_expire) { arprequest(ifp, NULL, &SIN(dst)->sin_addr, IF_LLADDR(ifp)); @@ -327,7 +330,7 @@ retry: goto done; } - renew = (la->la_asked == 0 || la->la_expire != time_uptime); + renew = (la->la_asked == 0 || la->la_expire != time_second); if ((renew || m != NULL) && (flags & LLE_EXCLUSIVE) == 0) { flags |= LLE_EXCLUSIVE; LLE_RUNLOCK(la); @@ -358,12 +361,12 @@ retry: error = EWOULDBLOCK; /* First request. */ else error = - (rt0->rt_flags & RTF_GATEWAY) ? EHOSTDOWN : EHOSTUNREACH; + (rt0->rt_flags & RTF_GATEWAY) ? EHOSTUNREACH : EHOSTDOWN; if (renew) { LLE_ADDREF(la); - la->la_expire = time_uptime; - callout_reset(&la->la_timer, hz, arptimer, la); + la->la_expire = time_second; + callout_reset(&la->la_timer, hz * V_arpt_down, arptimer, la); la->la_asked++; LLE_WUNLOCK(la); arprequest(ifp, NULL, &SIN(dst)->sin_addr, @@ -668,7 +671,7 @@ match: la->la_flags |= LLE_VALID; if (!(la->la_flags & LLE_STATIC)) { - la->la_expire = time_uptime + V_arpt_keep; + la->la_expire = time_second + V_arpt_keep; callout_reset(&la->la_timer, hz * V_arpt_keep, arptimer, la); } Modified: stable/8/sys/netinet/in.c ============================================================================== --- stable/8/sys/netinet/in.c Tue Oct 20 16:46:39 2009 (r198297) +++ stable/8/sys/netinet/in.c Tue Oct 20 17:44:50 2009 (r198298) @@ -1439,7 +1439,7 @@ in_lltable_dump(struct lltable *llt, str struct sockaddr_dl *sdl; /* skip deleted entries */ - if ((lle->la_flags & (LLE_DELETED|LLE_VALID)) != LLE_VALID) + if ((lle->la_flags & LLE_DELETED) == LLE_DELETED) continue; /* Skip if jailed and not a valid IP of the prison. */ if (prison_if(wr->td->td_ucred, L3_ADDR(lle)) != 0) @@ -1471,10 +1471,15 @@ in_lltable_dump(struct lltable *llt, str sdl = &arpc.sdl; sdl->sdl_family = AF_LINK; sdl->sdl_len = sizeof(*sdl); - sdl->sdl_alen = ifp->if_addrlen; sdl->sdl_index = ifp->if_index; sdl->sdl_type = ifp->if_type; - bcopy(&lle->ll_addr, LLADDR(sdl), ifp->if_addrlen); + if ((lle->la_flags & LLE_VALID) == LLE_VALID) { + sdl->sdl_alen = ifp->if_addrlen; + bcopy(&lle->ll_addr, LLADDR(sdl), ifp->if_addrlen); + } else { + sdl->sdl_alen = 0; + bzero(LLADDR(sdl), ifp->if_addrlen); + } arpc.rtm.rtm_rmx.rmx_expire = lle->la_flags & LLE_STATIC ? 0 : lle->la_expire; From owner-svn-src-stable@FreeBSD.ORG Tue Oct 20 17:50:37 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65E3B1065703; Tue, 20 Oct 2009 17:50:37 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 524248FC14; Tue, 20 Oct 2009 17:50:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KHobM0073824; Tue, 20 Oct 2009 17:50:37 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KHobem073817; Tue, 20 Oct 2009 17:50:37 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200910201750.n9KHobem073817@svn.freebsd.org> From: Weongyo Jeong Date: Tue, 20 Oct 2009 17:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198300 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/usb/wlan dev/xen/xenpci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 17:50:37 -0000 Author: weongyo Date: Tue Oct 20 17:50:36 2009 New Revision: 198300 URL: http://svn.freebsd.org/changeset/base/198300 Log: MFC r198098: fixes a TX hang bug that it could happen when if_start callback didn't be restarted by full of the output queue. Tested by: bsduser MFC r198099: fixes a TX hang that could be possible to happen when the trasfers are in the high speed that some drivers don't call if_start callback after marking ~IFF_DRV_OACTIVE. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/usb/wlan/if_rum.c stable/8/sys/dev/usb/wlan/if_uath.c stable/8/sys/dev/usb/wlan/if_upgt.c stable/8/sys/dev/usb/wlan/if_ural.c stable/8/sys/dev/usb/wlan/if_urtw.c stable/8/sys/dev/usb/wlan/if_zyd.c stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/wlan/if_rum.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_rum.c Tue Oct 20 17:50:27 2009 (r198299) +++ stable/8/sys/dev/usb/wlan/if_rum.c Tue Oct 20 17:50:36 2009 (r198300) @@ -826,6 +826,9 @@ tr_setup: usbd_transfer_submit(xfer); } + RUM_UNLOCK(sc); + rum_start(ifp); + RUM_LOCK(sc); break; default: /* Error */ @@ -930,8 +933,8 @@ tr_setup: * the private mutex of a device! That is why we do the * "ieee80211_input" here, and not some lines up! */ + RUM_UNLOCK(sc); if (m) { - RUM_UNLOCK(sc); ni = ieee80211_find_rxnode(ic, mtod(m, struct ieee80211_frame_min *)); if (ni != NULL) { @@ -941,8 +944,11 @@ tr_setup: } else (void) ieee80211_input_all(ic, m, rssi, RT2573_NOISE_FLOOR); - RUM_LOCK(sc); } + if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0 && + !IFQ_IS_EMPTY(&ifp->if_snd)) + rum_start(ifp); + RUM_LOCK(sc); return; default: /* Error */ Modified: stable/8/sys/dev/usb/wlan/if_uath.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_uath.c Tue Oct 20 17:50:27 2009 (r198299) +++ stable/8/sys/dev/usb/wlan/if_uath.c Tue Oct 20 17:50:36 2009 (r198300) @@ -2762,6 +2762,9 @@ setup: m = NULL; desc = NULL; } + if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0 && + !IFQ_IS_EMPTY(&ifp->if_snd)) + uath_start(ifp); UATH_LOCK(sc); break; default: Modified: stable/8/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_upgt.c Tue Oct 20 17:50:27 2009 (r198299) +++ stable/8/sys/dev/usb/wlan/if_upgt.c Tue Oct 20 17:50:36 2009 (r198300) @@ -2293,6 +2293,9 @@ setup: (void) ieee80211_input_all(ic, m, rssi, nf); m = NULL; } + if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0 && + !IFQ_IS_EMPTY(&ifp->if_snd)) + upgt_start(ifp); UPGT_LOCK(sc); break; default: Modified: stable/8/sys/dev/usb/wlan/if_ural.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_ural.c Tue Oct 20 17:50:27 2009 (r198299) +++ stable/8/sys/dev/usb/wlan/if_ural.c Tue Oct 20 17:50:36 2009 (r198300) @@ -837,6 +837,9 @@ tr_setup: usbd_transfer_submit(xfer); } + RAL_UNLOCK(sc); + ural_start(ifp); + RAL_LOCK(sc); break; default: /* Error */ @@ -945,8 +948,8 @@ tr_setup: * the private mutex of a device! That is why we do the * "ieee80211_input" here, and not some lines up! */ + RAL_UNLOCK(sc); if (m) { - RAL_UNLOCK(sc); ni = ieee80211_find_rxnode(ic, mtod(m, struct ieee80211_frame_min *)); if (ni != NULL) { @@ -954,8 +957,11 @@ tr_setup: ieee80211_free_node(ni); } else (void) ieee80211_input_all(ic, m, rssi, nf); - RAL_LOCK(sc); } + if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0 && + !IFQ_IS_EMPTY(&ifp->if_snd)) + ural_start(ifp); + RAL_LOCK(sc); return; default: /* Error */ Modified: stable/8/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_urtw.c Tue Oct 20 17:50:27 2009 (r198299) +++ stable/8/sys/dev/usb/wlan/if_urtw.c Tue Oct 20 17:50:36 2009 (r198300) @@ -4071,6 +4071,9 @@ setup: (void) ieee80211_input_all(ic, m, rssi, nf); m = NULL; } + if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0 && + !IFQ_IS_EMPTY(&ifp->if_snd)) + urtw_start(ifp); URTW_LOCK(sc); break; default: Modified: stable/8/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_zyd.c Tue Oct 20 17:50:27 2009 (r198299) +++ stable/8/sys/dev/usb/wlan/if_zyd.c Tue Oct 20 17:50:36 2009 (r198300) @@ -2322,6 +2322,9 @@ tr_setup: } else (void)ieee80211_input_all(ic, m, rssi, nf); } + if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0 && + !IFQ_IS_EMPTY(&ifp->if_snd)) + zyd_start(ifp); ZYD_LOCK(sc); break; @@ -2431,6 +2434,9 @@ tr_setup: usbd_xfer_set_priv(xfer, data); usbd_transfer_submit(xfer); } + ZYD_UNLOCK(sc); + zyd_start(ifp); + ZYD_LOCK(sc); break; default: /* Error */ From owner-svn-src-stable@FreeBSD.ORG Tue Oct 20 18:54:51 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87E37106566C; Tue, 20 Oct 2009 18:54:51 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74BA18FC1F; Tue, 20 Oct 2009 18:54:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KIspKK075343; Tue, 20 Oct 2009 18:54:51 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KIspKv075341; Tue, 20 Oct 2009 18:54:51 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910201854.n9KIspKv075341@svn.freebsd.org> From: Robert Watson Date: Tue, 20 Oct 2009 18:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198302 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 18:54:51 -0000 Author: rwatson Date: Tue Oct 20 18:54:51 2009 New Revision: 198302 URL: http://svn.freebsd.org/changeset/base/198302 Log: Merge r198218 from head to stable/8: Sort function prototypes in pfil.h, clean up white space, and better align fields for printing. Approved by: re (kensmith) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/pfil.h Modified: stable/8/sys/net/pfil.h ============================================================================== --- stable/8/sys/net/pfil.h Tue Oct 20 17:55:42 2009 (r198301) +++ stable/8/sys/net/pfil.h Tue Oct 20 18:54:51 2009 (r198302) @@ -50,7 +50,7 @@ struct inpcb; struct packet_filter_hook { TAILQ_ENTRY(packet_filter_hook) pfil_link; int (*pfil_func)(void *, struct mbuf **, struct ifnet *, int, - struct inpcb *); + struct inpcb *); void *pfil_arg; int pfil_flags; }; @@ -80,14 +80,13 @@ struct pfil_head { LIST_ENTRY(pfil_head) ph_list; }; +int pfil_add_hook(int (*func)(void *, struct mbuf **, struct ifnet *, + int, struct inpcb *), void *, int, struct pfil_head *); +int pfil_remove_hook(int (*func)(void *, struct mbuf **, struct ifnet *, + int, struct inpcb *), void *, int, struct pfil_head *); int pfil_run_hooks(struct pfil_head *, struct mbuf **, struct ifnet *, int, struct inpcb *inp); -int pfil_add_hook(int (*func)(void *, struct mbuf **, - struct ifnet *, int, struct inpcb *), void *, int, struct pfil_head *); -int pfil_remove_hook(int (*func)(void *, struct mbuf **, - struct ifnet *, int, struct inpcb *), void *, int, struct pfil_head *); - int pfil_head_register(struct pfil_head *); int pfil_head_unregister(struct pfil_head *); @@ -107,6 +106,7 @@ struct pfil_head *pfil_head_get(int, u_l static __inline struct packet_filter_hook * pfil_hook_get(int dir, struct pfil_head *ph) { + if (dir == PFIL_IN) return (TAILQ_FIRST(&ph->ph_in)); else if (dir == PFIL_OUT) From owner-svn-src-stable@FreeBSD.ORG Tue Oct 20 19:05:43 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74190106566C; Tue, 20 Oct 2009 19:05:43 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 622B18FC1F; Tue, 20 Oct 2009 19:05:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KJ5hPe075886; Tue, 20 Oct 2009 19:05:43 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KJ5hPe075884; Tue, 20 Oct 2009 19:05:43 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200910201905.n9KJ5hPe075884@svn.freebsd.org> From: Alexander Kabaev Date: Tue, 20 Oct 2009 19:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198304 - in stable/8/lib/libc: . gen stdio stdtime string sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 19:05:43 -0000 Author: kan Date: Tue Oct 20 19:05:43 2009 New Revision: 198304 URL: http://svn.freebsd.org/changeset/base/198304 Log: MFC Revision 197277: Make libc.a provide __stack_chk_fail_local weak alias. This is needed to satisfy static libraries that are compiled with -fpic and linked into static binary afterwards. Several libraries in gcc are examples of such static libs. Approved by: re (kib) Modified: stable/8/lib/libc/ (props changed) stable/8/lib/libc/gen/ (props changed) stable/8/lib/libc/stdio/asprintf.c (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/string/ffsll.c (props changed) stable/8/lib/libc/string/flsll.c (props changed) stable/8/lib/libc/string/wcpcpy.c (props changed) stable/8/lib/libc/string/wcpncpy.c (props changed) stable/8/lib/libc/sys/stack_protector.c Modified: stable/8/lib/libc/sys/stack_protector.c ============================================================================== --- stable/8/lib/libc/sys/stack_protector.c Tue Oct 20 18:58:28 2009 (r198303) +++ stable/8/lib/libc/sys/stack_protector.c Tue Oct 20 19:05:43 2009 (r198304) @@ -108,4 +108,8 @@ __chk_fail(void) __fail("buffer overflow detected; terminated"); } +#ifdef PIC __sym_compat(__stack_chk_fail_local, __stack_chk_fail, FBSD_1.0); +#else +__weak_reference(__stack_chk_fail, __stack_chk_fail_local); +#endif From owner-svn-src-stable@FreeBSD.ORG Tue Oct 20 19:13:24 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E65C0106568D; Tue, 20 Oct 2009 19:13:24 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 761E98FC27; Tue, 20 Oct 2009 19:13:24 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id n9KIpjkp097160; Tue, 20 Oct 2009 20:51:45 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.3/8.14.3/Submit) id n9KIpjfp097159; Tue, 20 Oct 2009 20:51:45 +0200 (CEST) (envelope-from marius) Date: Tue, 20 Oct 2009 20:51:45 +0200 From: Marius Strobl To: Stanislav Sedov Message-ID: <20091020185145.GA94979@alchemy.franken.de> References: <200910201641.n9KGfN7Z072248@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200910201641.n9KGfN7Z072248@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r198296 - stable/8/sys/dev/bge X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 19:13:25 -0000 On Tue, Oct 20, 2009 at 04:41:23PM +0000, Stanislav Sedov wrote: > Author: stas > Date: Tue Oct 20 16:41:23 2009 > New Revision: 198296 > URL: http://svn.freebsd.org/changeset/base/198296 > > Log: > - Disable ASF by default in STABLE_8. This causes a lot > of problems on non-DELL branded machines with IPMI > support. The proposed fix was committed to HEAD but has > not received much test coverage yet. You probably want to adjust bge.4 to indicate that the default has changed as well. Marius From owner-svn-src-stable@FreeBSD.ORG Tue Oct 20 20:18:32 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DE25106566B; Tue, 20 Oct 2009 20:18:32 +0000 (UTC) (envelope-from stas@deglitch.com) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id A9E9C8FC08; Tue, 20 Oct 2009 20:18:31 +0000 (UTC) Received: from stasss.yandex.ru (dhcp170-227-red.yandex.net [95.108.170.227]) by mx0.deglitch.com (Postfix) with ESMTPSA id 71A3D8FC45; Wed, 21 Oct 2009 00:18:30 +0400 (MSD) Date: Wed, 21 Oct 2009 00:18:30 +0400 From: Stanislav Sedov To: Marius Strobl Message-Id: <20091021001830.e2a1b9f7.stas@deglitch.com> In-Reply-To: <20091020185145.GA94979@alchemy.franken.de> References: <200910201641.n9KGfN7Z072248@svn.freebsd.org> <20091020185145.GA94979@alchemy.franken.de> Organization: Deglitch Networks X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Wed__21_Oct_2009_00_18_30_+0400_x+BpW6GVvohP8G=_" Cc: Stanislav Sedov , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r198296 - stable/8/sys/dev/bge X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 20:18:32 -0000 --Signature=_Wed__21_Oct_2009_00_18_30_+0400_x+BpW6GVvohP8G=_ Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, 20 Oct 2009 20:51:45 +0200 Marius Strobl mentioned: > On Tue, Oct 20, 2009 at 04:41:23PM +0000, Stanislav Sedov wrote: > > Author: stas > > Date: Tue Oct 20 16:41:23 2009 > > New Revision: 198296 > > URL: http://svn.freebsd.org/changeset/base/198296 > >=20 > > Log: > > - Disable ASF by default in STABLE_8. This causes a lot > > of problems on non-DELL branded machines with IPMI > > support. The proposed fix was committed to HEAD but has > > not received much test coverage yet. >=20 > You probably want to adjust bge.4 to indicate that the default > has changed as well. >=20 Sure, thanks! --=20 Stanislav Sedov ST4096-RIPE --Signature=_Wed__21_Oct_2009_00_18_30_+0400_x+BpW6GVvohP8G=_ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJK3hsWAAoJEKN82nOYvCd0k2cP/2ziONo3YatvdpLA86wAcCkJ M+qnjWAMXbNGp2Ox1whRAMzawwzctKBSavuTmAL0b6u3L+S8zGWwzEE2aF78TKJz gWXLHjHzwAuTcmcbwcNtELW796uP5or6ICLHAhEi44PGXctCyRUKEEB+48NjZ3PL CcfFI3trRbZamAexlbYF2yhIzC5XO2nK7cWyRLwLA8/HVS7ktQnaptmYDF+bd88o wrPLd+/D4UGyBThdrOLjJKZfZl0zvXGy+gBKkikG0vlB442qaPeqxvuJVmYn7Gvf 6j3wFnLFXyw9iEahNqBqMfmdhfc730OcMWCpJM7VOP8EY7HF+tmRNkyTmFiZugNN 9xn6Xqh4cOe2YQKEtzKU+e5cY52IpWm6w2ybHmXWVqdM9uEGBQrhuMNHvqh5I9vp GdR1tux8R/zMBoYmsZqsPAFb+eFrGfJDNB2elOAc4gi2Puk9ZzwXqgJLhxRqp9hG pxe0op04ESTR/435BFbDlg0M1NvN4rVRGUnT81ka+OZQP1G3UPKgVrHYZEcG8eJp PRJ4z98rtkQSoE3bIEv31wslNsBvq2LTpkGauWRMK20N9h7HpnhlROzJlR9o1L4E 9uR3ES4PKrbBeGoENpomwsccO7iyPwYnD5H7hOTRG8mqK5iDFv48tkCFKjb1dh6A 57HTc0Qr/n0epWJXUUhG =WSHc -----END PGP SIGNATURE----- --Signature=_Wed__21_Oct_2009_00_18_30_+0400_x+BpW6GVvohP8G=_-- From owner-svn-src-stable@FreeBSD.ORG Tue Oct 20 21:36:57 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CD7A1065695; Tue, 20 Oct 2009 21:36:57 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70A958FC0C; Tue, 20 Oct 2009 21:36:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KLavpX079251; Tue, 20 Oct 2009 21:36:57 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KLavvx079249; Tue, 20 Oct 2009 21:36:57 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200910202136.n9KLavvx079249@svn.freebsd.org> From: Qing Li Date: Tue, 20 Oct 2009 21:36:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198308 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 21:36:57 -0000 Author: qingli Date: Tue Oct 20 21:36:56 2009 New Revision: 198308 URL: http://svn.freebsd.org/changeset/base/198308 Log: MFC 198301 In the ARP callout timer expiration function, the current time_second is compared against the entry expiration time value (that was set based on time_second) to check if the current time is larger than the set expiration time. Due to the +/- timer granularity value, the comparison returns false, causing the alternative code to be executed. The alternative code path freed the memory without removing that entry from the table list, causing a use-after-free bug. Reviewed by: discussed with kmacy Approved by: re Verified by: rnoland, yongari Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/if_ether.c Modified: stable/8/sys/netinet/if_ether.c ============================================================================== --- stable/8/sys/netinet/if_ether.c Tue Oct 20 21:29:46 2009 (r198307) +++ stable/8/sys/netinet/if_ether.c Tue Oct 20 21:36:56 2009 (r198308) @@ -168,17 +168,17 @@ arptimer(void *arg) ifp = lle->lle_tbl->llt_ifp; IF_AFDATA_LOCK(ifp); LLE_WLOCK(lle); - if (((lle->la_flags & LLE_DELETED) - || (time_second >= lle->la_expire)) - && (!callout_pending(&lle->la_timer) && - callout_active(&lle->la_timer))) + if ((!callout_pending(&lle->la_timer) && + callout_active(&lle->la_timer))) { (void) llentry_free(lle); + } +#ifdef DIAGNOSTICS else { - /* - * Still valid, just drop our reference - */ - LLE_FREE_LOCKED(lle); + struct sockaddr *l3addr = L3_ADDR(lle); + log(LOG_INFO, "arptimer issue: %p, IPv4 address: \"%s\"\n", lle, + inet_ntoa(((const struct sockaddr_in *)l3addr)->sin_addr)); } +#endif IF_AFDATA_UNLOCK(ifp); } @@ -365,7 +365,7 @@ retry: if (renew) { LLE_ADDREF(la); - la->la_expire = time_second; + la->la_expire = time_second + V_arpt_down; callout_reset(&la->la_timer, hz * V_arpt_down, arptimer, la); la->la_asked++; LLE_WUNLOCK(la); From owner-svn-src-stable@FreeBSD.ORG Tue Oct 20 22:11:18 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00D701065676; Tue, 20 Oct 2009 22:11:18 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E39538FC14; Tue, 20 Oct 2009 22:11:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KMBHI2079931; Tue, 20 Oct 2009 22:11:17 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KMBH0a079929; Tue, 20 Oct 2009 22:11:17 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200910202211.n9KMBH0a079929@svn.freebsd.org> From: Stanislav Sedov Date: Tue, 20 Oct 2009 22:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198309 - stable/8/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 22:11:18 -0000 Author: stas Date: Tue Oct 20 22:11:17 2009 New Revision: 198309 URL: http://svn.freebsd.org/changeset/base/198309 Log: - Note that ASF is now disabled by default in 8.0. Approved by: re (kib) Modified: stable/8/share/man/man4/bge.4 Modified: stable/8/share/man/man4/bge.4 ============================================================================== --- stable/8/share/man/man4/bge.4 Tue Oct 20 21:36:56 2009 (r198308) +++ stable/8/share/man/man4/bge.4 Tue Oct 20 22:11:17 2009 (r198309) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 19, 2009 +.Dd Oct 21, 2009 .Dt BGE 4 .Os .Sh NAME @@ -217,7 +217,7 @@ prompt before booting the kernel, or sto .It Va hw.bge.allow_asf Allow the ASF feature for cooperating with IPMI. Can cause system lockup problems on a small number of systems. -Enabled by default. +Disabled by default. .El .Sh DIAGNOSTICS .Bl -diag From owner-svn-src-stable@FreeBSD.ORG Wed Oct 21 09:53:56 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F1C210656EE; Wed, 21 Oct 2009 09:53:56 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BF768FC0A; Wed, 21 Oct 2009 09:53:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9L9rtEY093987; Wed, 21 Oct 2009 09:53:55 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9L9rt06093985; Wed, 21 Oct 2009 09:53:55 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910210953.n9L9rt06093985@svn.freebsd.org> From: Robert Watson Date: Wed, 21 Oct 2009 09:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198315 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 09:53:56 -0000 Author: rwatson Date: Wed Oct 21 09:53:55 2009 New Revision: 198315 URL: http://svn.freebsd.org/changeset/base/198315 Log: Merge r198219 from head to stable/8: Remove unused pfil_flags field in packet_filter_hook. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/pfil.h Modified: stable/8/sys/net/pfil.h ============================================================================== --- stable/8/sys/net/pfil.h Wed Oct 21 09:43:22 2009 (r198314) +++ stable/8/sys/net/pfil.h Wed Oct 21 09:53:55 2009 (r198315) @@ -52,7 +52,6 @@ struct packet_filter_hook { int (*pfil_func)(void *, struct mbuf **, struct ifnet *, int, struct inpcb *); void *pfil_arg; - int pfil_flags; }; #define PFIL_IN 0x00000001 From owner-svn-src-stable@FreeBSD.ORG Wed Oct 21 13:11:38 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72D56106566B; Wed, 21 Oct 2009 13:11:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F0B28FC20; Wed, 21 Oct 2009 13:11:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LDBcP3000211; Wed, 21 Oct 2009 13:11:38 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LDBcrZ000209; Wed, 21 Oct 2009 13:11:38 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910211311.n9LDBcrZ000209@svn.freebsd.org> From: Robert Watson Date: Wed, 21 Oct 2009 13:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198324 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 13:11:38 -0000 Author: rwatson Date: Wed Oct 21 13:11:38 2009 New Revision: 198324 URL: http://svn.freebsd.org/changeset/base/198324 Log: Merge r198198 from head to stable/8: Line-wrap pfil.c so that it prints more nicely. Approved by: re (kensmith) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/pfil.c Modified: stable/8/sys/net/pfil.c ============================================================================== --- stable/8/sys/net/pfil.c Wed Oct 21 13:10:02 2009 (r198323) +++ stable/8/sys/net/pfil.c Wed Oct 21 13:11:38 2009 (r198324) @@ -49,12 +49,14 @@ static struct mtx pfil_global_lock; -MTX_SYSINIT(pfil_heads_lock, &pfil_global_lock, "pfil_head_list lock", MTX_DEF); +MTX_SYSINIT(pfil_heads_lock, &pfil_global_lock, "pfil_head_list lock", + MTX_DEF); static int pfil_list_add(pfil_list_t *, struct packet_filter_hook *, int); static int pfil_list_remove(pfil_list_t *, - int (*)(void *, struct mbuf **, struct ifnet *, int, struct inpcb *), void *); + int (*)(void *, struct mbuf **, struct ifnet *, int, struct inpcb *), + void *); LIST_HEAD(, pfil_head) pfil_head_list = LIST_HEAD_INITIALIZER(&pfil_head_list); @@ -76,7 +78,8 @@ pfil_run_hooks(struct pfil_head *ph, str for (pfh = pfil_hook_get(dir, ph); pfh != NULL; pfh = TAILQ_NEXT(pfh, pfil_link)) { if (pfh->pfil_func != NULL) { - rv = (*pfh->pfil_func)(pfh->pfil_arg, &m, ifp, dir, inp); + rv = (*pfh->pfil_func)(pfh->pfil_arg, &m, ifp, dir, + inp); if (rv != 0 || m == NULL) break; } @@ -220,8 +223,8 @@ error: * hook list. */ int -pfil_remove_hook(int (*func)(void *, struct mbuf **, struct ifnet *, int, struct inpcb *), - void *arg, int flags, struct pfil_head *ph) +pfil_remove_hook(int (*func)(void *, struct mbuf **, struct ifnet *, int, + struct inpcb *), void *arg, int flags, struct pfil_head *ph) { int err = 0; @@ -272,7 +275,8 @@ pfil_list_add(pfil_list_t *list, struct */ static int pfil_list_remove(pfil_list_t *list, - int (*func)(void *, struct mbuf **, struct ifnet *, int, struct inpcb *), void *arg) + int (*func)(void *, struct mbuf **, struct ifnet *, int, struct inpcb *), + void *arg) { struct packet_filter_hook *pfh; From owner-svn-src-stable@FreeBSD.ORG Wed Oct 21 14:05:52 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3876C106566C; Wed, 21 Oct 2009 14:05:52 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 247388FC2A; Wed, 21 Oct 2009 14:05:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LE5qdM001381; Wed, 21 Oct 2009 14:05:52 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LE5q6I001379; Wed, 21 Oct 2009 14:05:52 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910211405.n9LE5q6I001379@svn.freebsd.org> From: Robert Watson Date: Wed, 21 Oct 2009 14:05:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198326 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 14:05:52 -0000 Author: rwatson Date: Wed Oct 21 14:05:51 2009 New Revision: 198326 URL: http://svn.freebsd.org/changeset/base/198326 Log: Merge r198233 from head to stable/8: Clean up comments, white space, and style in pfil.c (VNET changes not MFC'd) Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/pfil.c Modified: stable/8/sys/net/pfil.c ============================================================================== --- stable/8/sys/net/pfil.c Wed Oct 21 13:13:24 2009 (r198325) +++ stable/8/sys/net/pfil.c Wed Oct 21 14:05:51 2009 (r198326) @@ -85,14 +85,13 @@ pfil_run_hooks(struct pfil_head *ph, str } } PFIL_RUNLOCK(ph, &rmpt); - *mp = m; return (rv); } /* - * pfil_head_register() registers a pfil_head with the packet filter - * hook mechanism. + * pfil_head_register() registers a pfil_head with the packet filter hook + * mechanism. */ int pfil_head_register(struct pfil_head *ph) @@ -104,7 +103,7 @@ pfil_head_register(struct pfil_head *ph) if (ph->ph_type == lph->ph_type && ph->ph_un.phu_val == lph->ph_un.phu_val) { PFIL_LIST_UNLOCK(); - return EEXIST; + return (EEXIST); } } PFIL_LOCK_INIT(ph); @@ -150,7 +149,6 @@ pfil_head_get(int type, u_long val) if (ph->ph_type == type && ph->ph_un.phu_val == val) break; PFIL_LIST_UNLOCK(); - return (ph); } @@ -207,7 +205,7 @@ pfil_add_hook(int (*func)(void *, struct ph->ph_nhooks++; } PFIL_WUNLOCK(ph); - return 0; + return (0); locked_error: PFIL_WUNLOCK(ph); error: @@ -215,12 +213,12 @@ error: free(pfh1, M_IFADDR); if (pfh2 != NULL) free(pfh2, M_IFADDR); - return err; + return (err); } /* - * pfil_remove_hook removes a specific function from the packet filter - * hook list. + * pfil_remove_hook removes a specific function from the packet filter hook + * list. */ int pfil_remove_hook(int (*func)(void *, struct mbuf **, struct ifnet *, int, @@ -229,7 +227,6 @@ pfil_remove_hook(int (*func)(void *, str int err = 0; PFIL_WLOCK(ph); - if (flags & PFIL_IN) { err = pfil_list_remove(&ph->ph_in, func, arg); if (err == 0) @@ -241,8 +238,7 @@ pfil_remove_hook(int (*func)(void *, str ph->ph_nhooks--; } PFIL_WUNLOCK(ph); - - return err; + return (err); } static int @@ -256,17 +252,17 @@ pfil_list_add(pfil_list_t *list, struct TAILQ_FOREACH(pfh, list, pfil_link) if (pfh->pfil_func == pfh1->pfil_func && pfh->pfil_arg == pfh1->pfil_arg) - return EEXIST; + return (EEXIST); + /* - * insert the input list in reverse order of the output list - * so that the same path is followed in or out of the kernel. + * Insert the input list in reverse order of the output list so that + * the same path is followed in or out of the kernel. */ if (flags & PFIL_IN) TAILQ_INSERT_HEAD(list, pfh1, pfil_link); else TAILQ_INSERT_TAIL(list, pfh1, pfil_link); - - return 0; + return (0); } /* @@ -284,7 +280,7 @@ pfil_list_remove(pfil_list_t *list, if (pfh->pfil_func == func && pfh->pfil_arg == arg) { TAILQ_REMOVE(list, pfh, pfil_link); free(pfh, M_IFADDR); - return 0; + return (0); } - return ENOENT; + return (ENOENT); } From owner-svn-src-stable@FreeBSD.ORG Wed Oct 21 15:07:34 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B7AC106566B; Wed, 21 Oct 2009 15:07:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E9A28FC2A; Wed, 21 Oct 2009 15:07:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LF7YS5002707; Wed, 21 Oct 2009 15:07:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LF7YS5002705; Wed, 21 Oct 2009 15:07:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910211507.n9LF7YS5002705@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 21 Oct 2009 15:07:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198330 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci vm X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 15:07:34 -0000 Author: kib Date: Wed Oct 21 15:07:34 2009 New Revision: 198330 URL: http://svn.freebsd.org/changeset/base/198330 Log: MFC r198201: Remove spurious call to priv_check(PRIV_VM_SWAP_NOQUOTA). Call priv_check(PRIV_VM_SWAP_NORLIMIT) only when per-uid limit is actually exceed. Approved by: re (kensmith) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/vm/swap_pager.c Modified: stable/8/sys/vm/swap_pager.c ============================================================================== --- stable/8/sys/vm/swap_pager.c Wed Oct 21 15:04:50 2009 (r198329) +++ stable/8/sys/vm/swap_pager.c Wed Oct 21 15:07:34 2009 (r198330) @@ -176,7 +176,7 @@ swap_reserve(vm_ooffset_t incr) int swap_reserve_by_uid(vm_ooffset_t incr, struct uidinfo *uip) { - vm_ooffset_t r, s, max; + vm_ooffset_t r, s; int res, error; static int curfail; static struct timeval lastfail; @@ -185,7 +185,6 @@ swap_reserve_by_uid(vm_ooffset_t incr, s panic("swap_reserve: & PAGE_MASK"); res = 0; - error = priv_check(curthread, PRIV_VM_SWAP_NOQUOTA); mtx_lock(&sw_dev_mtx); r = swap_reserved + incr; if (overcommit & SWAP_RESERVE_ALLOW_NONWIRED) { @@ -204,10 +203,9 @@ swap_reserve_by_uid(vm_ooffset_t incr, s if (res) { PROC_LOCK(curproc); UIDINFO_VMSIZE_LOCK(uip); - error = priv_check(curthread, PRIV_VM_SWAP_NORLIMIT); - max = (error != 0) ? lim_cur(curproc, RLIMIT_SWAP) : 0; - if (max != 0 && uip->ui_vmsize + incr > max && - (overcommit & SWAP_RESERVE_RLIMIT_ON) != 0) + if ((overcommit & SWAP_RESERVE_RLIMIT_ON) != 0 && + uip->ui_vmsize + incr > lim_cur(curproc, RLIMIT_SWAP) && + priv_check(curthread, PRIV_VM_SWAP_NORLIMIT)) res = 0; else uip->ui_vmsize += incr; From owner-svn-src-stable@FreeBSD.ORG Wed Oct 21 16:12:10 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A7EF106566C; Wed, 21 Oct 2009 16:12:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5838B8FC0C; Wed, 21 Oct 2009 16:12:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LGCAw4004115; Wed, 21 Oct 2009 16:12:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LGC9Av004111; Wed, 21 Oct 2009 16:12:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200910211612.n9LGC9Av004111@svn.freebsd.org> From: Alexander Motin Date: Wed, 21 Oct 2009 16:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198334 - in stable/7/sys: . contrib/pf dev/ata X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 16:12:10 -0000 Author: mav Date: Wed Oct 21 16:12:09 2009 New Revision: 198334 URL: http://svn.freebsd.org/changeset/base/198334 Log: MFC rev. 178375: Add HW level support for the Adaptec 1420SA controller. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ata/ata-chipset.c stable/7/sys/dev/ata/ata-pci.c stable/7/sys/dev/ata/ata-pci.h Modified: stable/7/sys/dev/ata/ata-chipset.c ============================================================================== --- stable/7/sys/dev/ata/ata-chipset.c Wed Oct 21 15:57:16 2009 (r198333) +++ stable/7/sys/dev/ata/ata-chipset.c Wed Oct 21 16:12:09 2009 (r198334) @@ -1358,6 +1358,27 @@ ata_amd_chipinit(device_t dev) /* + * Adaptec chipset support functions + */ +int +ata_adaptec_ident(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(dev); + static struct ata_chip_id ids[] = + {{ ATA_ADAPTEC_1420, 0, 4, MV60XX, ATA_SA300, "1420SA" }, + { 0, 0, 0, 0, 0, 0}}; + + if (!(ctlr->chip = ata_match_chip(dev, ids))) + return ENXIO; + + ata_set_desc(dev); + ctlr->chipinit = ata_marvell_edma_chipinit; + + return 0; +} + + +/* * ATI chipset support functions */ int Modified: stable/7/sys/dev/ata/ata-pci.c ============================================================================== --- stable/7/sys/dev/ata/ata-pci.c Wed Oct 21 15:57:16 2009 (r198333) +++ stable/7/sys/dev/ata/ata-pci.c Wed Oct 21 16:12:09 2009 (r198334) @@ -90,6 +90,10 @@ ata_pci_probe(device_t dev) if (!ata_amd_ident(dev)) return ATA_PROBE_OK; break; + case ATA_ADAPTEC_ID: + if (!ata_adaptec_ident(dev)) + return ATA_PROBE_OK; + break; case ATA_ATI_ID: if (!ata_ati_ident(dev)) return ATA_PROBE_OK; @@ -517,6 +521,7 @@ ata_pcivendor2str(device_t dev) case ATA_ACARD_ID: return "Acard"; case ATA_ACER_LABS_ID: return "AcerLabs"; case ATA_AMD_ID: return "AMD"; + case ATA_ADAPTEC_ID: return "Adaptec"; case ATA_ATI_ID: return "ATI"; case ATA_CYRIX_ID: return "Cyrix"; case ATA_CYPRESS_ID: return "Cypress"; Modified: stable/7/sys/dev/ata/ata-pci.h ============================================================================== --- stable/7/sys/dev/ata/ata-pci.h Wed Oct 21 15:57:16 2009 (r198333) +++ stable/7/sys/dev/ata/ata-pci.h Wed Oct 21 16:12:09 2009 (r198334) @@ -81,6 +81,14 @@ struct ata_connect_task { #define ATA_ATP865A 0x00081191 #define ATA_ATP865R 0x00091191 +#define ATA_ACER_LABS_ID 0x10b9 +#define ATA_ALI_1533 0x153310b9 +#define ATA_ALI_5229 0x522910b9 +#define ATA_ALI_5281 0x528110b9 +#define ATA_ALI_5287 0x528710b9 +#define ATA_ALI_5288 0x528810b9 +#define ATA_ALI_5289 0x528910b9 + #define ATA_AMD_ID 0x1022 #define ATA_AMD755 0x74011022 #define ATA_AMD756 0x74091022 @@ -89,13 +97,8 @@ struct ata_connect_task { #define ATA_AMD8111 0x74691022 #define ATA_AMD5536 0x209a1022 -#define ATA_ACER_LABS_ID 0x10b9 -#define ATA_ALI_1533 0x153310b9 -#define ATA_ALI_5229 0x522910b9 -#define ATA_ALI_5281 0x528110b9 -#define ATA_ALI_5287 0x528710b9 -#define ATA_ALI_5288 0x528810b9 -#define ATA_ALI_5289 0x528910b9 +#define ATA_ADAPTEC_ID 0x9005 +#define ATA_ADAPTEC_1420 0x02419005 #define ATA_ATI_ID 0x1002 #define ATA_ATI_IXP200 0x43491002 @@ -511,6 +514,7 @@ int ata_ahci_ident(device_t); int ata_acard_ident(device_t); int ata_ali_ident(device_t); int ata_amd_ident(device_t); +int ata_adaptec_ident(device_t); int ata_ati_ident(device_t); int ata_cyrix_ident(device_t); int ata_cypress_ident(device_t); From owner-svn-src-stable@FreeBSD.ORG Wed Oct 21 16:23:35 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 897721065676; Wed, 21 Oct 2009 16:23:35 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id 0CA418FC0A; Wed, 21 Oct 2009 16:23:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.3/8.14.3) with ESMTP id n9LGNXuG038916; Wed, 21 Oct 2009 20:23:33 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Wed, 21 Oct 2009 20:23:33 +0400 (MSD) From: Dmitry Morozovsky To: Alexander Motin In-Reply-To: <200910211612.n9LGC9Av004111@svn.freebsd.org> Message-ID: References: <200910211612.n9LGC9Av004111@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (woozle.rinet.ru [0.0.0.0]); Wed, 21 Oct 2009 20:23:33 +0400 (MSD) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r198334 - in stable/7/sys: . contrib/pf dev/ata X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 16:23:35 -0000 On Wed, 21 Oct 2009, Alexander Motin wrote: AM> Author: mav AM> Date: Wed Oct 21 16:12:09 2009 AM> New Revision: 198334 AM> URL: http://svn.freebsd.org/changeset/base/198334 AM> AM> Log: AM> MFC rev. 178375: AM> Add HW level support for the Adaptec 1420SA controller. Thank you! -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-stable@FreeBSD.ORG Wed Oct 21 17:18:49 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BB3B1065672; Wed, 21 Oct 2009 17:18:49 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E35F98FC13; Wed, 21 Oct 2009 17:18:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LHImG6005544; Wed, 21 Oct 2009 17:18:48 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LHImA8005542; Wed, 21 Oct 2009 17:18:48 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200910211718.n9LHImA8005542@svn.freebsd.org> From: Ken Smith Date: Wed, 21 Oct 2009 17:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198337 - in stable/8/release: . doc doc/en_US.ISO8859-1/hardware scripts X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 17:18:49 -0000 Author: kensmith Date: Wed Oct 21 17:18:48 2009 New Revision: 198337 URL: http://svn.freebsd.org/changeset/base/198337 Log: MFC r198287: Update package list for 8.0-REL. Reviewed by: re@, portmgr@ Approved by: re (implicit) Modified: stable/8/release/ (props changed) stable/8/release/doc/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/scripts/package-split.py Modified: stable/8/release/scripts/package-split.py ============================================================================== --- stable/8/release/scripts/package-split.py Wed Oct 21 17:08:35 2009 (r198336) +++ stable/8/release/scripts/package-split.py Wed Oct 21 17:18:48 2009 (r198337) @@ -51,50 +51,53 @@ def disc1_packages(): 'misc/freebsd-doc-zh_tw'] if doing_dvd: - pkgs.extend(['lang/perl5.8', - 'x11/xorg', - 'devel/imake', - 'emulators/linux_base-fc4', - 'x11/gnome2', - 'x11/kde4', - 'x11-wm/afterstep', - 'x11-wm/windowmaker', - 'x11-wm/fvwm2', - 'archivers/unzip', + pkgs.extend(['archivers/unzip', 'astro/xearth', 'devel/gmake', + 'devel/imake', 'editors/emacs', 'editors/vim-lite', + 'emulators/linux_base-f10', 'emulators/mtools', 'graphics/png', 'graphics/xv', 'irc/xchat', + 'lang/perl5.8', + 'mail/alpine', 'mail/exim', 'mail/fetchmail', 'mail/mutt', - 'mail/alpine', 'mail/popd', - 'mail/xfmail', 'mail/postfix', + 'mail/xfmail', 'net/cvsup-without-gui', 'net/rsync', 'net/samba3', 'news/slrn', 'news/tin', + 'ports-mgmt/p5-FreeBSD-Portindex', + 'ports-mgmt/portaudit', + 'ports-mgmt/portmaster', 'ports-mgmt/portupgrade', 'print/a2ps-letter', 'print/apsfilter', 'print/ghostscript7-nox11', - 'print/gv', 'print/psutils-letter', + 'print/gv', 'shells/bash', 'shells/pdksh', 'shells/zsh', 'security/sudo', + 'sysutils/screen', 'www/links', 'www/lynx', + 'x11/gnome2', + 'x11/kde4', 'x11/rxvt', - 'ports-mgmt/portaudit']) + 'x11/xorg', + 'x11-wm/afterstep', + 'x11-wm/fvwm2', + 'x11-wm/windowmaker']) return pkgs # The list of desired packages From owner-svn-src-stable@FreeBSD.ORG Wed Oct 21 19:48:28 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2B6910656BB; Wed, 21 Oct 2009 19:48:27 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C62FF8FC14; Wed, 21 Oct 2009 19:48:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LJmRWT008975; Wed, 21 Oct 2009 19:48:27 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LJmR0O008973; Wed, 21 Oct 2009 19:48:27 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200910211948.n9LJmR0O008973@svn.freebsd.org> From: Andrew Thompson Date: Wed, 21 Oct 2009 19:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198348 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/usb/storage dev/xen/xenpci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 19:48:28 -0000 Author: thompsa Date: Wed Oct 21 19:48:27 2009 New Revision: 198348 URL: http://svn.freebsd.org/changeset/base/198348 Log: MFC r198307 Change from CAM_TID_INVALID to CAM_SEL_TIMEOUT error code when the usb device has been yanked, this works around a cam recounting bug when CAM_DEV_UNCONFIGURED is set late in the detach. In certain conditions the reference to the XPT device would not be released which would cause the usb explore thread to sleep forever on "simfree", preventing any new usb devices to be found/ejected on the bus. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/usb/storage/umass.c stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/storage/umass.c ============================================================================== --- stable/8/sys/dev/usb/storage/umass.c Wed Oct 21 19:39:34 2009 (r198347) +++ stable/8/sys/dev/usb/storage/umass.c Wed Oct 21 19:48:27 2009 (r198348) @@ -2843,8 +2843,9 @@ umass_cam_action(struct cam_sim *sim, un { struct umass_softc *sc = (struct umass_softc *)sim->softc; - if (sc == UMASS_GONE) { - ccb->ccb_h.status = CAM_TID_INVALID; + if (sc == UMASS_GONE || + (sc != NULL && !usbd_device_attached(sc->sc_udev))) { + ccb->ccb_h.status = CAM_SEL_TIMEOUT; xpt_done(ccb); return; } From owner-svn-src-stable@FreeBSD.ORG Thu Oct 22 08:34:20 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 941B91065676; Thu, 22 Oct 2009 08:34:20 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D02F8FC08; Thu, 22 Oct 2009 08:34:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9M8YKnA023466; Thu, 22 Oct 2009 08:34:20 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9M8YKLX023464; Thu, 22 Oct 2009 08:34:20 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200910220834.n9M8YKLX023464@svn.freebsd.org> From: Christian Brueffer Date: Thu, 22 Oct 2009 08:34:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198359 - stable/8/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 08:34:20 -0000 Author: brueffer Date: Thu Oct 22 08:34:20 2009 New Revision: 198359 URL: http://svn.freebsd.org/changeset/base/198359 Log: MFC: r198232 Powercrypt and NetSec seem to be defunct (webpages point to link farms and a google search yields no alternative). Remove the links but keep the entries around for reference. Approved by: re (kib) Modified: stable/8/share/man/man4/ (props changed) stable/8/share/man/man4/hifn.4 Modified: stable/8/share/man/man4/hifn.4 ============================================================================== --- stable/8/share/man/man4/hifn.4 Thu Oct 22 06:51:29 2009 (r198358) +++ stable/8/share/man/man4/hifn.4 Thu Oct 22 08:34:20 2009 (r198359) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 1, 2006 +.Dd October 19, 2009 .Dt HIFN 4 .Os .Sh NAME @@ -85,17 +85,11 @@ Came as 128KB SRAM model, or 2MB DRAM mo .It Hifn 7751 Reference board with 512KB SRAM. .It PowerCrypt -See -.Pa http://www.powercrypt.com/ . Comes with 512KB SRAM. .It XL-Crypt -See -.Pa http://www.powercrypt.com/ . Only board based on 7811 (which is faster than 7751 and has a random number generator). .It NetSec 7751 -See -.Pa http://www.netsec.net/ . Supports the most IPsec sessions, with 1MB SRAM. .It Soekris Engineering vpn1201 and vpn1211 See From owner-svn-src-stable@FreeBSD.ORG Thu Oct 22 08:36:08 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9FC11065672; Thu, 22 Oct 2009 08:36:08 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C830F8FC14; Thu, 22 Oct 2009 08:36:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9M8a8jF023546; Thu, 22 Oct 2009 08:36:08 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9M8a8jD023544; Thu, 22 Oct 2009 08:36:08 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200910220836.n9M8a8jD023544@svn.freebsd.org> From: Christian Brueffer Date: Thu, 22 Oct 2009 08:36:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198360 - stable/7/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 08:36:09 -0000 Author: brueffer Date: Thu Oct 22 08:36:08 2009 New Revision: 198360 URL: http://svn.freebsd.org/changeset/base/198360 Log: MFC: r198232 Powercrypt and NetSec seem to be defunct (webpages point to link farms and a google search yields no alternative). Remove the links but keep the entries around for reference. Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/hifn.4 Modified: stable/7/share/man/man4/hifn.4 ============================================================================== --- stable/7/share/man/man4/hifn.4 Thu Oct 22 08:34:20 2009 (r198359) +++ stable/7/share/man/man4/hifn.4 Thu Oct 22 08:36:08 2009 (r198360) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 1, 2006 +.Dd October 19, 2009 .Dt HIFN 4 .Os .Sh NAME @@ -85,17 +85,11 @@ Came as 128KB SRAM model, or 2MB DRAM mo .It Hifn 7751 Reference board with 512KB SRAM. .It PowerCrypt -See -.Pa http://www.powercrypt.com/ . Comes with 512KB SRAM. .It XL-Crypt -See -.Pa http://www.powercrypt.com/ . Only board based on 7811 (which is faster than 7751 and has a random number generator). .It NetSec 7751 -See -.Pa http://www.netsec.net/ . Supports the most IPsec sessions, with 1MB SRAM. .It Soekris Engineering vpn1201 and vpn1211 See From owner-svn-src-stable@FreeBSD.ORG Thu Oct 22 09:39:32 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AD44106566C; Thu, 22 Oct 2009 09:39:32 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78D518FC18; Thu, 22 Oct 2009 09:39:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9M9dWUM024773; Thu, 22 Oct 2009 09:39:32 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9M9dW1Z024771; Thu, 22 Oct 2009 09:39:32 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200910220939.n9M9dW1Z024771@svn.freebsd.org> From: Christian Brueffer Date: Thu, 22 Oct 2009 09:39:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198362 - stable/6/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 09:39:32 -0000 Author: brueffer Date: Thu Oct 22 09:39:32 2009 New Revision: 198362 URL: http://svn.freebsd.org/changeset/base/198362 Log: MFC: r198232 Powercrypt and NetSec seem to be defunct (webpages point to link farms and a google search yields no alternative). Remove the links but keep the entries around for reference. Modified: stable/6/share/man/man4/ (props changed) stable/6/share/man/man4/hifn.4 Modified: stable/6/share/man/man4/hifn.4 ============================================================================== --- stable/6/share/man/man4/hifn.4 Thu Oct 22 08:38:27 2009 (r198361) +++ stable/6/share/man/man4/hifn.4 Thu Oct 22 09:39:32 2009 (r198362) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 1, 2006 +.Dd October 19, 2009 .Dt HIFN 4 .Os .Sh NAME @@ -87,17 +87,11 @@ Came as 128KB SRAM model, or 2MB DRAM mo .It Hifn 7751 Reference board with 512KB SRAM. .It PowerCrypt -See -.Pa http://www.powercrypt.com/ . Comes with 512KB SRAM. .It XL-Crypt -See -.Pa http://www.powercrypt.com/ . Only board based on 7811 (which is faster than 7751 and has a random number generator). .It NetSec 7751 -See -.Pa http://www.netsec.net/ . Supports the most IPsec sessions, with 1MB SRAM. .It Soekris Engineering vpn1201 and vpn1211 See From owner-svn-src-stable@FreeBSD.ORG Thu Oct 22 16:26:38 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E2DD10656A4; Thu, 22 Oct 2009 16:26:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6091B8FC16; Thu, 22 Oct 2009 16:26:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9MGQcNr034585; Thu, 22 Oct 2009 16:26:38 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9MGQcZV034583; Thu, 22 Oct 2009 16:26:38 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200910221626.n9MGQcZV034583@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 22 Oct 2009 16:26:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198368 - in stable/8: . cddl/compat/opensolaris contrib/pf sys sys/amd64/include/xen sys/cddl/contrib/opensolaris sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/contrib/dev/acpica ... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 16:26:38 -0000 Author: trasz Date: Thu Oct 22 16:26:38 2009 New Revision: 198368 URL: http://svn.freebsd.org/changeset/base/198368 Log: MFC r196863: Improve wording. MFC r196941: Prevent the line from wrapping. Approved by: re (kib) Modified: stable/8/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Oct 22 14:53:44 2009 (r198367) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Oct 22 16:26:38 2009 (r198368) @@ -3557,15 +3557,19 @@ arc_init(void) #ifdef __i386__ if (prefetch_tunable_set == 0) { - printf("ZFS NOTICE: prefetch is disabled by default on i386" - " - add enable to tunable to change.\n" ); + printf("ZFS NOTICE: Prefetch is disabled by default on i386 " + "-- to enable,\n"); + printf(" add \"vfs.zfs.prefetch_disable=0\" " + "to /boot/loader.conf.\n"); zfs_prefetch_disable=1; } #else if ((((uint64_t)physmem * PAGESIZE) < (1ULL << 32)) && prefetch_tunable_set == 0) { - printf("ZFS NOTICE: system has less than 4GB and prefetch enable is not set" - "... disabling.\n"); + printf("ZFS NOTICE: Prefetch is disabled by default if less " + "than 4GB of RAM is present;\n" + " to enable, add \"vfs.zfs.prefetch_disable=0\" " + "to /boot/loader.conf.\n"); zfs_prefetch_disable=1; } #endif From owner-svn-src-stable@FreeBSD.ORG Thu Oct 22 18:48:26 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D9FA106566C; Thu, 22 Oct 2009 18:48:26 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B56D8FC14; Thu, 22 Oct 2009 18:48:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9MImQnl037424; Thu, 22 Oct 2009 18:48:26 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9MImQMC037422; Thu, 22 Oct 2009 18:48:26 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200910221848.n9MImQMC037422@svn.freebsd.org> From: Qing Li Date: Thu, 22 Oct 2009 18:48:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198371 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 18:48:26 -0000 Author: qingli Date: Thu Oct 22 18:48:25 2009 New Revision: 198371 URL: http://svn.freebsd.org/changeset/base/198371 Log: MFC 198306 The flow-table function flowtable_route_flush() may be called during system initialization time. Since the flow-table is designed to maintain per CPU flow cache, the existing code did not check whether "smp_started" is true before calling sched_bind() and sched_unbind(), which triggers a page fault. Reviewed by: jeff Approved by: re Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/flowtable.c Modified: stable/8/sys/net/flowtable.c ============================================================================== --- stable/8/sys/net/flowtable.c Thu Oct 22 17:36:41 2009 (r198370) +++ stable/8/sys/net/flowtable.c Thu Oct 22 18:48:25 2009 (r198371) @@ -930,16 +930,20 @@ flowtable_route_flush(struct flowtable * for (i = 0; i <= mp_maxid; i++) { if (CPU_ABSENT(i)) continue; - - thread_lock(curthread); - sched_bind(curthread, i); - thread_unlock(curthread); + + if (smp_started == 1) { + thread_lock(curthread); + sched_bind(curthread, i); + thread_unlock(curthread); + } flowtable_free_stale(ft, rt); - thread_lock(curthread); - sched_unbind(curthread); - thread_unlock(curthread); + if (smp_started == 1) { + thread_lock(curthread); + sched_unbind(curthread); + thread_unlock(curthread); + } } } else { flowtable_free_stale(ft, rt); From owner-svn-src-stable@FreeBSD.ORG Fri Oct 23 12:02:01 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CEF91065692; Fri, 23 Oct 2009 12:02:01 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AF4C8FC1A; Fri, 23 Oct 2009 12:02:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NC21E8059954; Fri, 23 Oct 2009 12:02:01 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NC21ce059952; Fri, 23 Oct 2009 12:02:01 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200910231202.n9NC21ce059952@svn.freebsd.org> From: Andrew Thompson Date: Fri, 23 Oct 2009 12:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198386 - stable/8/lib/libusb X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 12:02:01 -0000 Author: thompsa Date: Fri Oct 23 12:02:01 2009 New Revision: 198386 URL: http://svn.freebsd.org/changeset/base/198386 Log: MFC r198376 Prevent wraparound of the timeout variable. Submitted by: HPS Approved by: re (kib) Modified: stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/libusb20_ugen20.c stable/8/lib/libusb/usb.h (props changed) Modified: stable/8/lib/libusb/libusb20_ugen20.c ============================================================================== --- stable/8/lib/libusb/libusb20_ugen20.c Fri Oct 23 11:26:58 2009 (r198385) +++ stable/8/lib/libusb/libusb20_ugen20.c Fri Oct 23 12:02:01 2009 (r198386) @@ -800,7 +800,11 @@ ugen20_tr_submit(struct libusb20_transfe if (xfer->flags & LIBUSB20_TRANSFER_DO_CLEAR_STALL) { fsep->flags |= USB_FS_FLAG_CLEAR_STALL; } - fsep->timeout = xfer->timeout; + /* NOTE: The "fsep->timeout" variable is 16-bit. */ + if (xfer->timeout > 65535) + fsep->timeout = 65535; + else + fsep->timeout = xfer->timeout; temp.ep_index = xfer->trIndex; From owner-svn-src-stable@FreeBSD.ORG Fri Oct 23 14:43:17 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 891FC106566B; Fri, 23 Oct 2009 14:43:17 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 768A68FC15; Fri, 23 Oct 2009 14:43:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NEhHh9064002; Fri, 23 Oct 2009 14:43:17 GMT (envelope-from philip@svn.freebsd.org) Received: (from philip@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NEhHw6063998; Fri, 23 Oct 2009 14:43:17 GMT (envelope-from philip@svn.freebsd.org) Message-Id: <200910231443.n9NEhHw6063998@svn.freebsd.org> From: Philip Paeps Date: Fri, 23 Oct 2009 14:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198405 - stable/8/sbin/dhclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 14:43:17 -0000 Author: philip Date: Fri Oct 23 14:43:17 2009 New Revision: 198405 URL: http://svn.freebsd.org/changeset/base/198405 Log: MFC r198352 Make dhclient use bootpc (68) as the source port for unicast DHCPREQUEST packets instead of allowing the protocol stack to pick a random source port. This fixes the behaviour where dhclient would never transition from RENEWING to BOUND without going through REBINDING in networks which are paranoid about DHCP spoofing, such as most mainstream cable-broadband ISP networks. Obtained from: OpenBSD Reviewed by: brooks Approved by: re (kib) Modified: stable/8/sbin/dhclient/ (props changed) stable/8/sbin/dhclient/bpf.c stable/8/sbin/dhclient/dhcpd.h stable/8/sbin/dhclient/packet.c Modified: stable/8/sbin/dhclient/bpf.c ============================================================================== --- stable/8/sbin/dhclient/bpf.c Fri Oct 23 14:40:38 2009 (r198404) +++ stable/8/sbin/dhclient/bpf.c Fri Oct 23 14:43:17 2009 (r198405) @@ -90,11 +90,23 @@ if_register_bpf(struct interface_info *i void if_register_send(struct interface_info *info) { + int sock, on = 1; + /* * If we're using the bpf API for sending and receiving, we * don't need to register this interface twice. */ info->wfdesc = info->rfdesc; + + /* + * Use raw socket for unicast send. + */ + if ((sock = socket(AF_INET, SOCK_RAW, IPPROTO_UDP)) == -1) + error("socket(SOCK_RAW): %m"); + if (setsockopt(sock, IPPROTO_IP, IP_HDRINCL, &on, + sizeof(on)) == -1) + error("setsockopt(IP_HDRINCL): %m"); + info->ufdesc = sock; } /* @@ -244,35 +256,32 @@ send_packet(struct interface_info *inter { unsigned char buf[256]; struct iovec iov[2]; + struct msghdr msg; int result, bufp = 0; - int sock; - - if (to->sin_addr.s_addr != INADDR_BROADCAST) { - note("SENDING DIRECT"); - /* We know who the server is, send the packet via - normal socket interface */ - - if ((sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) >= 0) { - result = sendto (sock, (char *)raw, len, 0, - (struct sockaddr *)to, sizeof *to); - close(sock); - if (result > 0) - return result; - } - } /* Assemble the headers... */ - assemble_hw_header(interface, buf, &bufp, hto); + if (to->sin_addr.s_addr == INADDR_BROADCAST) + assemble_hw_header(interface, buf, &bufp, hto); assemble_udp_ip_header(buf, &bufp, from.s_addr, to->sin_addr.s_addr, to->sin_port, (unsigned char *)raw, len); - /* Fire it off */ iov[0].iov_base = (char *)buf; iov[0].iov_len = bufp; iov[1].iov_base = (char *)raw; iov[1].iov_len = len; - result = writev(interface->wfdesc, iov, 2); + /* Fire it off */ + if (to->sin_addr.s_addr == INADDR_BROADCAST) + result = writev(interface->wfdesc, iov, 2); + else { + memset(&msg, 0, sizeof(msg)); + msg.msg_name = (struct sockaddr *)to; + msg.msg_namelen = sizeof(*to); + msg.msg_iov = iov; + msg.msg_iovlen = 2; + result = sendmsg(interface->ufdesc, &msg, 0); + } + if (result < 0) warning("send_packet: %m"); return (result); Modified: stable/8/sbin/dhclient/dhcpd.h ============================================================================== --- stable/8/sbin/dhclient/dhcpd.h Fri Oct 23 14:40:38 2009 (r198404) +++ stable/8/sbin/dhclient/dhcpd.h Fri Oct 23 14:43:17 2009 (r198405) @@ -37,6 +37,8 @@ * Enterprises. To learn more about the Internet Software Consortium, * see ``http://www.vix.com/isc''. To learn more about Vixie * Enterprises, see ``http://www.vix.com''. + * + * $FreeBSD$ */ #include @@ -194,6 +196,7 @@ struct interface_info { char name[IFNAMSIZ]; int rfdesc; int wfdesc; + int ufdesc; unsigned char *rbuf; size_t rbuf_max; size_t rbuf_offset; Modified: stable/8/sbin/dhclient/packet.c ============================================================================== --- stable/8/sbin/dhclient/packet.c Fri Oct 23 14:40:38 2009 (r198404) +++ stable/8/sbin/dhclient/packet.c Fri Oct 23 14:43:17 2009 (r198405) @@ -135,6 +135,17 @@ assemble_udp_ip_header(unsigned char *bu ip.ip_dst.s_addr = to; ip.ip_sum = wrapsum(checksum((unsigned char *)&ip, sizeof(ip), 0)); + + /* + * While the BPF -- used for broadcasts -- expects a "true" IP header + * with all the bytes in network byte order, the raw socket interface + * which is used for unicasts expects the ip_len field to be in host + * byte order. In both cases, the checksum has to be correct, so this + * is as good a place as any to turn the bytes around again. + */ + if (to != INADDR_BROADCAST) + ip.ip_len = ntohs(ip.ip_len); + memcpy(&buf[*bufix], &ip, sizeof(ip)); *bufix += sizeof(ip); From owner-svn-src-stable@FreeBSD.ORG Fri Oct 23 15:12:05 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 969CD1065676; Fri, 23 Oct 2009 15:12:05 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A3798FC14; Fri, 23 Oct 2009 15:12:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NFC5aA064789; Fri, 23 Oct 2009 15:12:05 GMT (envelope-from philip@svn.freebsd.org) Received: (from philip@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NFC5Ee064785; Fri, 23 Oct 2009 15:12:05 GMT (envelope-from philip@svn.freebsd.org) Message-Id: <200910231512.n9NFC5Ee064785@svn.freebsd.org> From: Philip Paeps Date: Fri, 23 Oct 2009 15:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198410 - stable/7/sbin/dhclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 15:12:05 -0000 Author: philip Date: Fri Oct 23 15:12:05 2009 New Revision: 198410 URL: http://svn.freebsd.org/changeset/base/198410 Log: MFC r198352 Make dhclient use bootpc (68) as the source port for unicast DHCPREQUEST packets instead of allowing the protocol stack to pick a random source port. This fixes the behaviour where dhclient would never transition from RENEWING to BOUND without going through REBINDING in networks which are paranoid about DHCP spoofing, such as most mainstream cable-broadband ISP networks. Obtained from: OpenBSD Reviewed by: brooks Modified: stable/7/sbin/dhclient/ (props changed) stable/7/sbin/dhclient/bpf.c stable/7/sbin/dhclient/dhcpd.h stable/7/sbin/dhclient/packet.c Modified: stable/7/sbin/dhclient/bpf.c ============================================================================== --- stable/7/sbin/dhclient/bpf.c Fri Oct 23 15:10:41 2009 (r198409) +++ stable/7/sbin/dhclient/bpf.c Fri Oct 23 15:12:05 2009 (r198410) @@ -90,11 +90,23 @@ if_register_bpf(struct interface_info *i void if_register_send(struct interface_info *info) { + int sock, on = 1; + /* * If we're using the bpf API for sending and receiving, we * don't need to register this interface twice. */ info->wfdesc = info->rfdesc; + + /* + * Use raw socket for unicast send. + */ + if ((sock = socket(AF_INET, SOCK_RAW, IPPROTO_UDP)) == -1) + error("socket(SOCK_RAW): %m"); + if (setsockopt(sock, IPPROTO_IP, IP_HDRINCL, &on, + sizeof(on)) == -1) + error("setsockopt(IP_HDRINCL): %m"); + info->ufdesc = sock; } /* @@ -244,35 +256,32 @@ send_packet(struct interface_info *inter { unsigned char buf[256]; struct iovec iov[2]; + struct msghdr msg; int result, bufp = 0; - int sock; - - if (to->sin_addr.s_addr != INADDR_BROADCAST) { - note("SENDING DIRECT"); - /* We know who the server is, send the packet via - normal socket interface */ - - if ((sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) >= 0) { - result = sendto (sock, (char *)raw, len, 0, - (struct sockaddr *)to, sizeof *to); - close(sock); - if (result > 0) - return result; - } - } /* Assemble the headers... */ - assemble_hw_header(interface, buf, &bufp, hto); + if (to->sin_addr.s_addr == INADDR_BROADCAST) + assemble_hw_header(interface, buf, &bufp, hto); assemble_udp_ip_header(buf, &bufp, from.s_addr, to->sin_addr.s_addr, to->sin_port, (unsigned char *)raw, len); - /* Fire it off */ iov[0].iov_base = (char *)buf; iov[0].iov_len = bufp; iov[1].iov_base = (char *)raw; iov[1].iov_len = len; - result = writev(interface->wfdesc, iov, 2); + /* Fire it off */ + if (to->sin_addr.s_addr == INADDR_BROADCAST) + result = writev(interface->wfdesc, iov, 2); + else { + memset(&msg, 0, sizeof(msg)); + msg.msg_name = (struct sockaddr *)to; + msg.msg_namelen = sizeof(*to); + msg.msg_iov = iov; + msg.msg_iovlen = 2; + result = sendmsg(interface->ufdesc, &msg, 0); + } + if (result < 0) warning("send_packet: %m"); return (result); Modified: stable/7/sbin/dhclient/dhcpd.h ============================================================================== --- stable/7/sbin/dhclient/dhcpd.h Fri Oct 23 15:10:41 2009 (r198409) +++ stable/7/sbin/dhclient/dhcpd.h Fri Oct 23 15:12:05 2009 (r198410) @@ -37,6 +37,8 @@ * Enterprises. To learn more about the Internet Software Consortium, * see ``http://www.vix.com/isc''. To learn more about Vixie * Enterprises, see ``http://www.vix.com''. + * + * $FreeBSD$ */ #include @@ -194,6 +196,7 @@ struct interface_info { char name[IFNAMSIZ]; int rfdesc; int wfdesc; + int ufdesc; unsigned char *rbuf; size_t rbuf_max; size_t rbuf_offset; Modified: stable/7/sbin/dhclient/packet.c ============================================================================== --- stable/7/sbin/dhclient/packet.c Fri Oct 23 15:10:41 2009 (r198409) +++ stable/7/sbin/dhclient/packet.c Fri Oct 23 15:12:05 2009 (r198410) @@ -135,6 +135,17 @@ assemble_udp_ip_header(unsigned char *bu ip.ip_dst.s_addr = to; ip.ip_sum = wrapsum(checksum((unsigned char *)&ip, sizeof(ip), 0)); + + /* + * While the BPF -- used for broadcasts -- expects a "true" IP header + * with all the bytes in network byte order, the raw socket interface + * which is used for unicasts expects the ip_len field to be in host + * byte order. In both cases, the checksum has to be correct, so this + * is as good a place as any to turn the bytes around again. + */ + if (to != INADDR_BROADCAST) + ip.ip_len = ntohs(ip.ip_len); + memcpy(&buf[*bufix], &ip, sizeof(ip)); *bufix += sizeof(ip); From owner-svn-src-stable@FreeBSD.ORG Fri Oct 23 15:42:23 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9762C1065692; Fri, 23 Oct 2009 15:42:23 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 847178FC23; Fri, 23 Oct 2009 15:42:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NFgN0G065459; Fri, 23 Oct 2009 15:42:23 GMT (envelope-from philip@svn.freebsd.org) Received: (from philip@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NFgNkK065455; Fri, 23 Oct 2009 15:42:23 GMT (envelope-from philip@svn.freebsd.org) Message-Id: <200910231542.n9NFgNkK065455@svn.freebsd.org> From: Philip Paeps Date: Fri, 23 Oct 2009 15:42:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198412 - stable/6/sbin/dhclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 15:42:23 -0000 Author: philip Date: Fri Oct 23 15:42:23 2009 New Revision: 198412 URL: http://svn.freebsd.org/changeset/base/198412 Log: MFC r198352 Make dhclient use bootpc (68) as the source port for unicast DHCPREQUEST packets instead of allowing the protocol stack to pick a random source port. This fixes the behaviour where dhclient would never transition from RENEWING to BOUND without going through REBINDING in networks which are paranoid about DHCP spoofing, such as most mainstream cable-broadband ISP networks. Obtained from: OpenBSD Reviewed by: brooks Approved by: re (kib) Modified: stable/6/sbin/dhclient/ (props changed) stable/6/sbin/dhclient/bpf.c stable/6/sbin/dhclient/dhcpd.h stable/6/sbin/dhclient/packet.c Modified: stable/6/sbin/dhclient/bpf.c ============================================================================== --- stable/6/sbin/dhclient/bpf.c Fri Oct 23 15:14:54 2009 (r198411) +++ stable/6/sbin/dhclient/bpf.c Fri Oct 23 15:42:23 2009 (r198412) @@ -90,11 +90,23 @@ if_register_bpf(struct interface_info *i void if_register_send(struct interface_info *info) { + int sock, on = 1; + /* * If we're using the bpf API for sending and receiving, we * don't need to register this interface twice. */ info->wfdesc = info->rfdesc; + + /* + * Use raw socket for unicast send. + */ + if ((sock = socket(AF_INET, SOCK_RAW, IPPROTO_UDP)) == -1) + error("socket(SOCK_RAW): %m"); + if (setsockopt(sock, IPPROTO_IP, IP_HDRINCL, &on, + sizeof(on)) == -1) + error("setsockopt(IP_HDRINCL): %m"); + info->ufdesc = sock; } /* @@ -244,35 +256,32 @@ send_packet(struct interface_info *inter { unsigned char buf[256]; struct iovec iov[2]; + struct msghdr msg; int result, bufp = 0; - int sock; - - if (to->sin_addr.s_addr != INADDR_BROADCAST) { - note("SENDING DIRECT"); - /* We know who the server is, send the packet via - normal socket interface */ - - if ((sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) >= 0) { - result = sendto (sock, (char *)raw, len, 0, - (struct sockaddr *)to, sizeof *to); - close(sock); - if (result > 0) - return result; - } - } /* Assemble the headers... */ - assemble_hw_header(interface, buf, &bufp, hto); + if (to->sin_addr.s_addr == INADDR_BROADCAST) + assemble_hw_header(interface, buf, &bufp, hto); assemble_udp_ip_header(buf, &bufp, from.s_addr, to->sin_addr.s_addr, to->sin_port, (unsigned char *)raw, len); - /* Fire it off */ iov[0].iov_base = (char *)buf; iov[0].iov_len = bufp; iov[1].iov_base = (char *)raw; iov[1].iov_len = len; - result = writev(interface->wfdesc, iov, 2); + /* Fire it off */ + if (to->sin_addr.s_addr == INADDR_BROADCAST) + result = writev(interface->wfdesc, iov, 2); + else { + memset(&msg, 0, sizeof(msg)); + msg.msg_name = (struct sockaddr *)to; + msg.msg_namelen = sizeof(*to); + msg.msg_iov = iov; + msg.msg_iovlen = 2; + result = sendmsg(interface->ufdesc, &msg, 0); + } + if (result < 0) warning("send_packet: %m"); return (result); Modified: stable/6/sbin/dhclient/dhcpd.h ============================================================================== --- stable/6/sbin/dhclient/dhcpd.h Fri Oct 23 15:14:54 2009 (r198411) +++ stable/6/sbin/dhclient/dhcpd.h Fri Oct 23 15:42:23 2009 (r198412) @@ -37,6 +37,8 @@ * Enterprises. To learn more about the Internet Software Consortium, * see ``http://www.vix.com/isc''. To learn more about Vixie * Enterprises, see ``http://www.vix.com''. + * + * $FreeBSD$ */ #include @@ -194,6 +196,7 @@ struct interface_info { char name[IFNAMSIZ]; int rfdesc; int wfdesc; + int ufdesc; unsigned char *rbuf; size_t rbuf_max; size_t rbuf_offset; Modified: stable/6/sbin/dhclient/packet.c ============================================================================== --- stable/6/sbin/dhclient/packet.c Fri Oct 23 15:14:54 2009 (r198411) +++ stable/6/sbin/dhclient/packet.c Fri Oct 23 15:42:23 2009 (r198412) @@ -135,6 +135,17 @@ assemble_udp_ip_header(unsigned char *bu ip.ip_dst.s_addr = to; ip.ip_sum = wrapsum(checksum((unsigned char *)&ip, sizeof(ip), 0)); + + /* + * While the BPF -- used for broadcasts -- expects a "true" IP header + * with all the bytes in network byte order, the raw socket interface + * which is used for unicasts expects the ip_len field to be in host + * byte order. In both cases, the checksum has to be correct, so this + * is as good a place as any to turn the bytes around again. + */ + if (to != INADDR_BROADCAST) + ip.ip_len = ntohs(ip.ip_len); + memcpy(&buf[*bufix], &ip, sizeof(ip)); *bufix += sizeof(ip); From owner-svn-src-stable@FreeBSD.ORG Fri Oct 23 19:52:29 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5FFA106566B; Fri, 23 Oct 2009 19:52:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D30EF8FC1B; Fri, 23 Oct 2009 19:52:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NJqTJH070630; Fri, 23 Oct 2009 19:52:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NJqTtS070628; Fri, 23 Oct 2009 19:52:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200910231952.n9NJqTtS070628@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Oct 2009 19:52:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198424 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci nfsclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 19:52:30 -0000 Author: jhb Date: Fri Oct 23 19:52:29 2009 New Revision: 198424 URL: http://svn.freebsd.org/changeset/base/198424 Log: MFC 198174: Close a race with caching of -ve name lookups in the NFS client. Specifically, clients only trust -ve cache entries while the directory remains unchanged and discard any -ve cache entries for a directory when they notice that the modification time of a directory entry changes. The race involves two concurrent lookups as follows: - Thread A does a lookup for file 'foo' which sends a lookup RPC to the server. The lookup fails and the server replies. - The 'foo' file is created (either by the same client or a different client) updating the modification time on the parent directory of 'foo'. - Thread B does a lookup for a different file 'bar' which updates the cached attributes of the parent directory of 'foo' to reflect the new modification time after 'foo' was created. - Thread A finally resumes execution to parse the reply from the NFS server. It adds a -ve cache entry and sets the cached value of the directory's modification time that is used for invalidating -ve cached lookups to the new modification time set by thread B. At this point, future lookups of 'foo' will honor the -ve cached entry until the cached entry is pushed out of the name cache's LRU or the modification time of the parent directory is changed again by some other change. The fix is to read the directory's modification time before sending the lookup RPC and use that cached modification time when setting the directory's cached modification time. Also, we do not add a -ve cache entry if another thread has added -ve cache entry that set the directory's cached modification time to a newer value than the value we read before sending the lookup RPC. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/nfsclient/nfs_vnops.c Modified: stable/8/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/8/sys/nfsclient/nfs_vnops.c Fri Oct 23 19:02:53 2009 (r198423) +++ stable/8/sys/nfsclient/nfs_vnops.c Fri Oct 23 19:52:29 2009 (r198424) @@ -924,6 +924,7 @@ nfs_lookup(struct vop_lookup_args *ap) struct vnode **vpp = ap->a_vpp; struct mount *mp = dvp->v_mount; struct vattr vattr; + time_t dmtime; int flags = cnp->cn_flags; struct vnode *newvp; struct nfsmount *nmp; @@ -935,7 +936,7 @@ nfs_lookup(struct vop_lookup_args *ap) int error = 0, attrflag, fhsize, ltype; int v3 = NFS_ISV3(dvp); struct thread *td = cnp->cn_thread; - + *vpp = NULLVP; if ((flags & ISLASTCN) && (mp->mnt_flag & MNT_RDONLY) && (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) @@ -992,6 +993,19 @@ nfs_lookup(struct vop_lookup_args *ap) np->n_dmtime = 0; mtx_unlock(&np->n_mtx); } + + /* + * Cache the modification time of the parent directory in case + * the lookup fails and results in adding the first negative + * name cache entry for the directory. Since this is reading + * a single time_t, don't bother with locking. The + * modification time may be a bit stale, but it must be read + * before performing the lookup RPC to prevent a race where + * another lookup updates the timestamp on the directory after + * the lookup RPC has been performed on the server but before + * n_dmtime is set at the end of this function. + */ + dmtime = np->n_vattr.va_mtime.tv_sec; error = 0; newvp = NULLVP; nfsstats.lookupcache_misses++; @@ -1130,13 +1144,25 @@ nfsmout: * Maintain n_dmtime as the modification time * of the parent directory when the oldest -ve * name cache entry for this directory was - * added. + * added. If a -ve cache entry has already + * been added with a newer modification time + * by a concurrent lookup, then don't bother + * adding a cache entry. The modification + * time of the directory might have changed + * due to the file this lookup failed to find + * being created. In that case a subsequent + * lookup would incorrectly use the entry + * added here instead of doing an extra + * lookup. */ mtx_lock(&np->n_mtx); - if (np->n_dmtime == 0) - np->n_dmtime = np->n_vattr.va_mtime.tv_sec; - mtx_unlock(&np->n_mtx); - cache_enter(dvp, NULL, cnp); + if (np->n_dmtime <= dmtime) { + if (np->n_dmtime == 0) + np->n_dmtime = dmtime; + mtx_unlock(&np->n_mtx); + cache_enter(dvp, NULL, cnp); + } else + mtx_unlock(&np->n_mtx); } return (ENOENT); } From owner-svn-src-stable@FreeBSD.ORG Fri Oct 23 19:53:05 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12C6B1065670; Fri, 23 Oct 2009 19:53:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 008F78FC18; Fri, 23 Oct 2009 19:53:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NJr4pA070676; Fri, 23 Oct 2009 19:53:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NJr4gW070674; Fri, 23 Oct 2009 19:53:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200910231953.n9NJr4gW070674@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Oct 2009 19:53:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198425 - in stable/7/sys: . contrib/pf nfsclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 19:53:05 -0000 Author: jhb Date: Fri Oct 23 19:53:04 2009 New Revision: 198425 URL: http://svn.freebsd.org/changeset/base/198425 Log: MFC 198174: Close a race with caching of -ve name lookups in the NFS client. Specifically, clients only trust -ve cache entries while the directory remains unchanged and discard any -ve cache entries for a directory when they notice that the modification time of a directory entry changes. The race involves two concurrent lookups as follows: - Thread A does a lookup for file 'foo' which sends a lookup RPC to the server. The lookup fails and the server replies. - The 'foo' file is created (either by the same client or a different client) updating the modification time on the parent directory of 'foo'. - Thread B does a lookup for a different file 'bar' which updates the cached attributes of the parent directory of 'foo' to reflect the new modification time after 'foo' was created. - Thread A finally resumes execution to parse the reply from the NFS server. It adds a -ve cache entry and sets the cached value of the directory's modification time that is used for invalidating -ve cached lookups to the new modification time set by thread B. At this point, future lookups of 'foo' will honor the -ve cached entry until the cached entry is pushed out of the name cache's LRU or the modification time of the parent directory is changed again by some other change. The fix is to read the directory's modification time before sending the lookup RPC and use that cached modification time when setting the directory's cached modification time. Also, we do not add a -ve cache entry if another thread has added -ve cache entry that set the directory's cached modification time to a newer value than the value we read before sending the lookup RPC. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/nfsclient/nfs_vnops.c Modified: stable/7/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/7/sys/nfsclient/nfs_vnops.c Fri Oct 23 19:52:29 2009 (r198424) +++ stable/7/sys/nfsclient/nfs_vnops.c Fri Oct 23 19:53:04 2009 (r198425) @@ -863,6 +863,7 @@ nfs_lookup(struct vop_lookup_args *ap) struct vnode *dvp = ap->a_dvp; struct vnode **vpp = ap->a_vpp; struct vattr vattr; + time_t dmtime; int flags = cnp->cn_flags; struct vnode *newvp; struct nfsmount *nmp; @@ -874,7 +875,7 @@ nfs_lookup(struct vop_lookup_args *ap) int error = 0, attrflag, fhsize; int v3 = NFS_ISV3(dvp); struct thread *td = cnp->cn_thread; - + *vpp = NULLVP; if ((flags & ISLASTCN) && (dvp->v_mount->mnt_flag & MNT_RDONLY) && (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) @@ -929,6 +930,19 @@ nfs_lookup(struct vop_lookup_args *ap) np->n_dmtime = 0; mtx_unlock(&np->n_mtx); } + + /* + * Cache the modification time of the parent directory in case + * the lookup fails and results in adding the first negative + * name cache entry for the directory. Since this is reading + * a single time_t, don't bother with locking. The + * modification time may be a bit stale, but it must be read + * before performing the lookup RPC to prevent a race where + * another lookup updates the timestamp on the directory after + * the lookup RPC has been performed on the server but before + * n_dmtime is set at the end of this function. + */ + dmtime = np->n_vattr.va_mtime.tv_sec; error = 0; newvp = NULLVP; nfsstats.lookupcache_misses++; @@ -1036,13 +1050,25 @@ nfsmout: * Maintain n_dmtime as the modification time * of the parent directory when the oldest -ve * name cache entry for this directory was - * added. + * added. If a -ve cache entry has already + * been added with a newer modification time + * by a concurrent lookup, then don't bother + * adding a cache entry. The modification + * time of the directory might have changed + * due to the file this lookup failed to find + * being created. In that case a subsequent + * lookup would incorrectly use the entry + * added here instead of doing an extra + * lookup. */ mtx_lock(&np->n_mtx); - if (np->n_dmtime == 0) - np->n_dmtime = np->n_vattr.va_mtime.tv_sec; - mtx_unlock(&np->n_mtx); - cache_enter(dvp, NULL, cnp); + if (np->n_dmtime <= dmtime) { + if (np->n_dmtime == 0) + np->n_dmtime = dmtime; + mtx_unlock(&np->n_mtx); + cache_enter(dvp, NULL, cnp); + } else + mtx_unlock(&np->n_mtx); } return (ENOENT); } From owner-svn-src-stable@FreeBSD.ORG Sat Oct 24 04:55:15 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 886FF1065676; Sat, 24 Oct 2009 04:55:15 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7577B8FC15; Sat, 24 Oct 2009 04:55:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9O4tFe2081659; Sat, 24 Oct 2009 04:55:15 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9O4tFI3081655; Sat, 24 Oct 2009 04:55:15 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200910240455.n9O4tFI3081655@svn.freebsd.org> From: Ruslan Ermilov Date: Sat, 24 Oct 2009 04:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198434 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci kern sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2009 04:55:15 -0000 Author: ru Date: Sat Oct 24 04:55:14 2009 New Revision: 198434 URL: http://svn.freebsd.org/changeset/base/198434 Log: MFC r198295: Random number generator initialization cleanup: - Introduce new SI_SUB_RANDOM point in boot sequence to make it clear from where one may start using random(9). It should be as early as possible, so place it just after SI_SUB_CPU where we have some randomness on most platforms via get_cyclecount(). - Move stack protector initialization to be after SI_SUB_RANDOM as before this point we have no randomness at all. This fixes stack protector to actually protect stack with some random guard value instead of a well-known one. Note that this patch doesn't try to address arc4random(9) issues. With current code, it will be implicitly seeded by stack protector and hence will get the same entropy as random(9). It will be securely reseeded once /dev/random is feeded by some entropy from userland. Submitted by: Maxim Dounin Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/kern/init_main.c stable/8/sys/kern/stack_protector.c stable/8/sys/sys/kernel.h Modified: stable/8/sys/kern/init_main.c ============================================================================== --- stable/8/sys/kern/init_main.c Sat Oct 24 04:11:40 2009 (r198433) +++ stable/8/sys/kern/init_main.c Sat Oct 24 04:55:14 2009 (r198434) @@ -557,6 +557,19 @@ proc0_post(void *dummy __unused) } SYSINIT(p0post, SI_SUB_INTRINSIC_POST, SI_ORDER_FIRST, proc0_post, NULL); +static void +random_init(void *dummy __unused) +{ + + /* + * After CPU has been started we have some randomness on most + * platforms via get_cyclecount(). For platforms that don't + * we will reseed random(9) in proc0_post() as well. + */ + srandom(get_cyclecount()); +} +SYSINIT(random, SI_SUB_RANDOM, SI_ORDER_FIRST, random_init, NULL); + /* *************************************************************************** **** Modified: stable/8/sys/kern/stack_protector.c ============================================================================== --- stable/8/sys/kern/stack_protector.c Sat Oct 24 04:11:40 2009 (r198433) +++ stable/8/sys/kern/stack_protector.c Sat Oct 24 04:55:14 2009 (r198434) @@ -28,5 +28,4 @@ __stack_chk_init(void *dummy __unused) for (i = 0; i < __arraycount(guard); i++) __stack_chk_guard[i] = guard[i]; } -/* SI_SUB_EVENTHANDLER is right after SI_SUB_LOCK used by arc4rand() init. */ -SYSINIT(stack_chk, SI_SUB_EVENTHANDLER, SI_ORDER_ANY, __stack_chk_init, NULL); +SYSINIT(stack_chk, SI_SUB_RANDOM, SI_ORDER_ANY, __stack_chk_init, NULL); Modified: stable/8/sys/sys/kernel.h ============================================================================== --- stable/8/sys/sys/kernel.h Sat Oct 24 04:11:40 2009 (r198433) +++ stable/8/sys/sys/kernel.h Sat Oct 24 04:55:14 2009 (r198434) @@ -109,6 +109,7 @@ enum sysinit_sub_id { SI_SUB_VNET_PRELINK = 0x1E00000, /* vnet init before modules */ SI_SUB_KLD = 0x2000000, /* KLD and module setup */ SI_SUB_CPU = 0x2100000, /* CPU resource(s)*/ + SI_SUB_RANDOM = 0x2120000, /* random number generator */ SI_SUB_KDTRACE = 0x2140000, /* Kernel dtrace hooks */ SI_SUB_MAC = 0x2180000, /* TrustedBSD MAC subsystem */ SI_SUB_MAC_POLICY = 0x21C0000, /* TrustedBSD MAC policies */ From owner-svn-src-stable@FreeBSD.ORG Sat Oct 24 18:15:50 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FC7A106568B; Sat, 24 Oct 2009 18:15:50 +0000 (UTC) (envelope-from Andre.Albsmeier@siemens.com) Received: from goliath.siemens.de (goliath.siemens.de [192.35.17.28]) by mx1.freebsd.org (Postfix) with ESMTP id 95B278FC15; Sat, 24 Oct 2009 18:15:49 +0000 (UTC) Received: from mail3.siemens.de (localhost [127.0.0.1]) by goliath.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id n9OHlOou007524; Sat, 24 Oct 2009 19:47:24 +0200 Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.40.130]) by mail3.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id n9OHlOQS017594; Sat, 24 Oct 2009 19:47:24 +0200 Received: (from localhost) by curry.mchp.siemens.de (8.14.3/8.14.3) id n9OHlOnD051564; Date: Sat, 24 Oct 2009 19:47:24 +0200 From: Andre Albsmeier To: Andrew Gallatin Message-ID: <20091024174724.GA57864@curry.mchp.siemens.de> References: <200910191911.n9JJB0tQ010150@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200910191911.n9JJB0tQ010150@svn.freebsd.org> X-Echelon: X-Advice: Drop that crappy M$-Outlook, I'm tired of your viruses! User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r198244 - in stable/7/sys: . contrib/pf kern sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2009 18:15:50 -0000 On Mon, 19-Oct-2009 at 19:11:00 +0000, Andrew Gallatin wrote: > Author: gallatin > Date: Mon Oct 19 19:11:00 2009 > New Revision: 198244 > URL: http://svn.freebsd.org/changeset/base/198244 > > Log: > MFC of 178042 to allow safe firmware(9) loading from NIC watchdog handlers. > Also MFCed are the related changes 178016, 183614 and 184842. > > ... > > Modified: stable/7/sys/kern/subr_firmware.c > ============================================================================== > --- stable/7/sys/kern/subr_firmware.c Mon Oct 19 18:52:05 2009 (r198243) > +++ stable/7/sys/kern/subr_firmware.c Mon Oct 19 19:11:00 2009 (r198244) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2005, Sam Leffler > + * Copyright (c) 2005-2008, Sam Leffler > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -41,6 +41,10 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > + > +#include > +#include This broke "make world" on 7-STABLE when MODULES_WITH_WORLD is defined. The fix is: --- sys/modules/firmware/Makefile.ORI 2007-10-24 19:13:38.000000000 +0200 +++ sys/modules/firmware/Makefile 2009-10-24 19:38:10.000000000 +0200 @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../kern KMOD= firmware -SRCS= subr_firmware.c +SRCS= subr_firmware.c vnode_if.h .include -Andre From owner-svn-src-stable@FreeBSD.ORG Sat Oct 24 18:38:14 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66B9D106566B; Sat, 24 Oct 2009 18:38:14 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 551EA8FC13; Sat, 24 Oct 2009 18:38:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9OIcEoF004571; Sat, 24 Oct 2009 18:38:14 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9OIcEKY004569; Sat, 24 Oct 2009 18:38:14 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <200910241838.n9OIcEKY004569@svn.freebsd.org> From: Andrew Gallatin Date: Sat, 24 Oct 2009 18:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198446 - stable/7/sys/modules/firmware X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2009 18:38:14 -0000 Author: gallatin Date: Sat Oct 24 18:38:13 2009 New Revision: 198446 URL: http://svn.freebsd.org/changeset/base/198446 Log: Fix firmware module build when it is not built with the kernel (eg, make world when MODULES_WITH_WORLD is defined) Submitted by: Andre Albsmeier at siemens dot com Pointy hat to: gallatin Modified: stable/7/sys/modules/firmware/Makefile Modified: stable/7/sys/modules/firmware/Makefile ============================================================================== --- stable/7/sys/modules/firmware/Makefile Sat Oct 24 18:33:01 2009 (r198445) +++ stable/7/sys/modules/firmware/Makefile Sat Oct 24 18:38:13 2009 (r198446) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../kern KMOD= firmware -SRCS= subr_firmware.c +SRCS= subr_firmware.c vnode_if.h .include From owner-svn-src-stable@FreeBSD.ORG Sat Oct 24 18:38:25 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05A0610656B8; Sat, 24 Oct 2009 18:38:25 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E85D28FC15; Sat, 24 Oct 2009 18:38:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9OIcOpJ004610; Sat, 24 Oct 2009 18:38:24 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9OIcO6X004608; Sat, 24 Oct 2009 18:38:24 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <200910241838.n9OIcO6X004608@svn.freebsd.org> From: Andrew Gallatin Date: Sat, 24 Oct 2009 18:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198447 - stable/6/sys/modules/firmware X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2009 18:38:25 -0000 Author: gallatin Date: Sat Oct 24 18:38:24 2009 New Revision: 198447 URL: http://svn.freebsd.org/changeset/base/198447 Log: Fix firmware module build when it is not built with the kernel (eg, make world when MODULES_WITH_WORLD is defined) Submitted by: Andre Albsmeier at siemens dot com Pointy hat to: gallatin Modified: stable/6/sys/modules/firmware/Makefile Modified: stable/6/sys/modules/firmware/Makefile ============================================================================== --- stable/6/sys/modules/firmware/Makefile Sat Oct 24 18:38:13 2009 (r198446) +++ stable/6/sys/modules/firmware/Makefile Sat Oct 24 18:38:24 2009 (r198447) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../kern KMOD= firmware -SRCS= subr_firmware.c +SRCS= subr_firmware.c vnode_if.h .include From owner-svn-src-stable@FreeBSD.ORG Sat Oct 24 18:40:36 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04C541065676; Sat, 24 Oct 2009 18:40:36 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.freebsd.org (Postfix) with ESMTP id AC5658FC13; Sat, 24 Oct 2009 18:40:35 +0000 (UTC) Received: from [172.31.193.10] (cpe-069-134-110-200.nc.res.rr.com [69.134.110.200]) (authenticated bits=0) by duke.cs.duke.edu (8.14.2/8.14.2) with ESMTP id n9OIeYRe008919 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 24 Oct 2009 14:40:34 -0400 (EDT) X-DKIM: Sendmail DKIM Filter v2.8.3 duke.cs.duke.edu n9OIeYRe008919 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail; t=1256409634; bh=dijK5w/gD7gdZKss0sMq7+NHiWY5Bc0fDztGh4eJYhI=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=hdvKcCuFy7OvRxfMxdoKjBb7i8CsDhoXJJ4IOh/q2fDK/Xd6IAEGDvIITJZE2uQ1o sj6sh8JAOGJ+sGN9lDZv8Ln9bqV/nu6j/n1zqn6ANpqmzpbXCdWO/WlFOP7WoZ6aPf 45uVBZRrl4gtpdZXKlPv7s6ThMfUZ5K+1KaNLCc8= Message-ID: <4AE34A1C.3070509@cs.duke.edu> Date: Sat, 24 Oct 2009 14:40:28 -0400 From: Andrew Gallatin User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Andre Albsmeier References: <200910191911.n9JJB0tQ010150@svn.freebsd.org> <20091024174724.GA57864@curry.mchp.siemens.de> In-Reply-To: <20091024174724.GA57864@curry.mchp.siemens.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r198244 - in stable/7/sys: . contrib/pf kern sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2009 18:40:36 -0000 Andre Albsmeier wrote: > This broke "make world" on 7-STABLE when MODULES_WITH_WORLD > is defined. The fix is: And 6-stable was broken as well. I just committed your fix. Sorry for the breakage! Drew