From owner-svn-src-stable-9@freebsd.org Sun Dec 18 14:31:12 2016 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBF9EC871A1; Sun, 18 Dec 2016 14:31:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B6AE1927; Sun, 18 Dec 2016 14:31:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBIEVBqi007829; Sun, 18 Dec 2016 14:31:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBIEVBgn007828; Sun, 18 Dec 2016 14:31:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612181431.uBIEVBgn007828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 18 Dec 2016 14:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r310228 - in stable: 10/sys/dev/xen/blkfront 11/sys/dev/xen/blkfront 9/sys/dev/xen/blkfront X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Dec 2016 14:31:12 -0000 Author: dim Date: Sun Dec 18 14:31:11 2016 New Revision: 310228 URL: https://svnweb.freebsd.org/changeset/base/310228 Log: MFC r310013 (by cperciva): Check that blkfront devices have a non-zero number of sectors and a non-zero sector size. Such a device would be a virtual disk of zero bytes; clearly not useful, and not something we should try to attach. As a fortuitous side effect, checking that these values are non-zero here results in them not *becoming* zero later on the function. This odd behaviour began with r309124 (clang 3.9.0) but is challenging to debug; making any changes to this function whatsoever seems to affect the llvm optimizer behaviour enough to make the unexpected zeroing of the sector_size variable cease. PR: 215209 Security: The potential for variables to unexpectedly become zero has worrying consequences for security in general, but not so much in this particular context. MFC r310086: In xbd_connect(), use correct scanf conversion specifiers for the feature_barrier and feature_flush variables. Otherwise, adjacent variables on the stack, such as sector_size, may be overwritten, with disastrous results. Note that I did not see a good reason to revert the addition of zero checks introduced in r310013. Better safe than sorry. PR: 215209 Tested by: royger Modified: stable/9/sys/dev/xen/blkfront/blkfront.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/xen/blkfront/blkfront.c stable/11/sys/dev/xen/blkfront/blkfront.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/9/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- stable/9/sys/dev/xen/blkfront/blkfront.c Sun Dec 18 14:10:24 2016 (r310227) +++ stable/9/sys/dev/xen/blkfront/blkfront.c Sun Dec 18 14:31:11 2016 (r310228) @@ -933,8 +933,16 @@ blkfront_connect(struct xb_softc *sc) xenbus_get_otherend_path(dev)); return; } + if ((sectors == 0) || (sector_size == 0)) { + xenbus_dev_fatal(dev, 0, + "invalid parameters from %s:" + " sectors = %lu, sector_size = %lu", + xenbus_get_otherend_path(dev), + sectors, sector_size); + return; + } err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev), - "feature-barrier", "%lu", &feature_barrier, + "feature-barrier", "%d", &feature_barrier, NULL); if (!err || feature_barrier) sc->xb_flags |= XB_BARRIER; From owner-svn-src-stable-9@freebsd.org Mon Dec 19 09:55:01 2016 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2642CC8738F; Mon, 19 Dec 2016 09:55:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00D2B146B; Mon, 19 Dec 2016 09:55:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBJ9t0Z5091319; Mon, 19 Dec 2016 09:55:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBJ9t0l8091318; Mon, 19 Dec 2016 09:55:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612190955.uBJ9t0l8091318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 19 Dec 2016 09:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r310255 - stable/9/sys/dev/acpica X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 09:55:01 -0000 Author: hselasky Date: Mon Dec 19 09:54:59 2016 New Revision: 310255 URL: https://svnweb.freebsd.org/changeset/base/310255 Log: MFC r309400: Fix for endless recursion in the ACPI GPE handler during boot. When handling a GPE ACPI interrupt object the EcSpaceHandler() function can be called which checks the EC_EVENT_SCI bit and then recurse on the EcGpeQueryHandler() function. If there are multiple GPE events pending the EC_EVENT_SCI bit will be set at the next call to EcSpaceHandler() causing it to recurse again via the EcGpeQueryHandler() function. This leads to a slow never ending recursion during boot which prevents proper system startup, because the EC_EVENT_SCI bit never gets cleared in this scenario. The behaviour is reproducible with the ALASKA AMI in combination with a newer Skylake based mainboard in the following way: Enter BIOS and adjust the clock one hour forward. Save and exit the BIOS. System fails to boot due to the above mentioned bug in EcGpeQueryHandler() which was observed recursing multiple times. This patch adds a simple recursion guard to the EcGpeQueryHandler() function and also also adds logic to detect if new GPE events occurred during the execution of EcGpeQueryHandler() and then loop on this function instead of recursing. Reviewed by: jhb Modified: stable/9/sys/dev/acpica/acpi_ec.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/acpica/acpi_ec.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_ec.c Mon Dec 19 09:52:32 2016 (r310254) +++ stable/9/sys/dev/acpica/acpi_ec.c Mon Dec 19 09:54:59 2016 (r310255) @@ -618,16 +618,14 @@ EcCheckStatus(struct acpi_ec_softc *sc, } static void -EcGpeQueryHandler(void *Context) +EcGpeQueryHandlerSub(struct acpi_ec_softc *sc) { - struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; UINT8 Data; ACPI_STATUS Status; int retry; char qxx[5]; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - KASSERT(Context != NULL, ("EcGpeQueryHandler called with NULL")); /* Serialize user access with EcSpaceHandler(). */ Status = EcLock(sc); @@ -654,7 +652,6 @@ EcGpeQueryHandler(void *Context) else break; } - sc->ec_sci_pend = FALSE; if (ACPI_FAILURE(Status)) { EcUnlock(sc); device_printf(sc->ec_dev, "GPE query failed: %s\n", @@ -685,6 +682,29 @@ EcGpeQueryHandler(void *Context) } } +static void +EcGpeQueryHandler(void *Context) +{ + struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; + int pending; + + KASSERT(Context != NULL, ("EcGpeQueryHandler called with NULL")); + + do { + /* Read the current pending count */ + pending = atomic_load_acq_int(&sc->ec_sci_pend); + + /* Call GPE handler function */ + EcGpeQueryHandlerSub(sc); + + /* + * Try to reset the pending count to zero. If this fails we + * know another GPE event has occurred while handling the + * current GPE event and need to loop. + */ + } while (!atomic_cmpset_int(&sc->ec_sci_pend, pending, 0)); +} + /* * The GPE handler is called when IBE/OBF or SCI events occur. We are * called from an unknown lock context. @@ -713,13 +733,14 @@ EcGpeHandler(ACPI_HANDLE GpeDevice, UINT * It will run the query and _Qxx method later, under the lock. */ EcStatus = EC_GET_CSR(sc); - if ((EcStatus & EC_EVENT_SCI) && !sc->ec_sci_pend) { + if ((EcStatus & EC_EVENT_SCI) && + atomic_fetchadd_int(&sc->ec_sci_pend, 1) == 0) { CTR0(KTR_ACPI, "ec gpe queueing query handler"); Status = AcpiOsExecute(OSL_GPE_HANDLER, EcGpeQueryHandler, Context); - if (ACPI_SUCCESS(Status)) - sc->ec_sci_pend = TRUE; - else + if (ACPI_FAILURE(Status)) { printf("EcGpeHandler: queuing GPE query handler failed\n"); + atomic_store_rel_int(&sc->ec_sci_pend, 0); + } } return (ACPI_REENABLE_GPE); } @@ -766,7 +787,8 @@ EcSpaceHandler(UINT32 Function, ACPI_PHY * we call it directly here since our thread taskq is not active yet. */ if (cold || rebooting || sc->ec_suspending) { - if ((EC_GET_CSR(sc) & EC_EVENT_SCI)) { + if ((EC_GET_CSR(sc) & EC_EVENT_SCI) && + atomic_fetchadd_int(&sc->ec_sci_pend, 1) == 0) { CTR0(KTR_ACPI, "ec running gpe handler directly"); EcGpeQueryHandler(sc); } From owner-svn-src-stable-9@freebsd.org Mon Dec 19 18:31:24 2016 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 288C9C88212; Mon, 19 Dec 2016 18:31:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE8A519F0; Mon, 19 Dec 2016 18:31:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBJIVNBJ008522; Mon, 19 Dec 2016 18:31:23 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBJIVN9b008521; Mon, 19 Dec 2016 18:31:23 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201612191831.uBJIVN9b008521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 19 Dec 2016 18:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r310282 - stable/9/lib/libusb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 18:31:24 -0000 Author: trasz Date: Mon Dec 19 18:31:22 2016 New Revision: 310282 URL: https://svnweb.freebsd.org/changeset/base/310282 Log: MFC r307774: Fix libusb20_dev_get_desc(3) to use the "vendor product" order, not "product vendor". This is consistent with how it's generally done. The ordering is visible eg in usbconfig(8) output. Modified: stable/9/lib/libusb/libusb20_ugen20.c Directory Properties: stable/9/lib/libusb/ (props changed) Modified: stable/9/lib/libusb/libusb20_ugen20.c ============================================================================== --- stable/9/lib/libusb/libusb20_ugen20.c Mon Dec 19 18:27:22 2016 (r310281) +++ stable/9/lib/libusb/libusb20_ugen20.c Mon Dec 19 18:31:22 2016 (r310282) @@ -206,8 +206,8 @@ ugen20_enumerate(struct libusb20_device snprintf(pdev->usb_desc, sizeof(pdev->usb_desc), USB_GENERIC_NAME "%u.%u: <%s %s> at usbus%u", pdev->bus_number, - pdev->device_address, devinfo.udi_product, - devinfo.udi_vendor, pdev->bus_number); + pdev->device_address, devinfo.udi_vendor, + devinfo.udi_product, pdev->bus_number); error = 0; done: From owner-svn-src-stable-9@freebsd.org Mon Dec 19 18:32:27 2016 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9BE8C8827D; Mon, 19 Dec 2016 18:32:27 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1E571D2A; Mon, 19 Dec 2016 18:32:27 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBJIWQ6L011535; Mon, 19 Dec 2016 18:32:26 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBJIWQIR011534; Mon, 19 Dec 2016 18:32:26 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201612191832.uBJIWQIR011534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 19 Dec 2016 18:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r310283 - stable/9/sys/dev/usb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 18:32:28 -0000 Author: trasz Date: Mon Dec 19 18:32:26 2016 New Revision: 310283 URL: https://svnweb.freebsd.org/changeset/base/310283 Log: MFC r307902: Make the USB attach strings in dmesg include product name. Modified: stable/9/sys/dev/usb/usb_device.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/usb/usb_device.c ============================================================================== --- stable/9/sys/dev/usb/usb_device.c Mon Dec 19 18:31:22 2016 (r310282) +++ stable/9/sys/dev/usb/usb_device.c Mon Dec 19 18:32:26 2016 (r310283) @@ -1904,8 +1904,8 @@ config_done: udev->ugen_symlink = usb_alloc_symlink(udev->ugen_name); /* Announce device */ - printf("%s: <%s> at %s\n", udev->ugen_name, - usb_get_manufacturer(udev), + printf("%s: <%s %s> at %s\n", udev->ugen_name, + usb_get_manufacturer(udev), usb_get_product(udev), device_get_nameunit(udev->bus->bdev)); #endif @@ -2111,8 +2111,9 @@ usb_free_device(struct usb_device *udev, #if USB_HAVE_UGEN if (!rebooting) { - printf("%s: <%s> at %s (disconnected)\n", udev->ugen_name, - usb_get_manufacturer(udev), device_get_nameunit(bus->bdev)); + printf("%s: <%s %s> at %s (disconnected)\n", udev->ugen_name, + usb_get_manufacturer(udev), usb_get_product(udev), + device_get_nameunit(bus->bdev)); } /* Destroy UGEN symlink, if any */ From owner-svn-src-stable-9@freebsd.org Tue Dec 20 08:01:18 2016 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BD55C89FE9; Tue, 20 Dec 2016 08:01:18 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B18A1C0F; Tue, 20 Dec 2016 08:01:18 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBK81H4s046850; Tue, 20 Dec 2016 08:01:17 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBK81HV3046847; Tue, 20 Dec 2016 08:01:17 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201612200801.uBK81HV3046847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 20 Dec 2016 08:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r310321 - stable/9/lib/libc/gen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2016 08:01:18 -0000 Author: ed Date: Tue Dec 20 08:01:17 2016 New Revision: 310321 URL: https://svnweb.freebsd.org/changeset/base/310321 Log: MFC r309650: Properly sign extend the result of jrand48() and mrand48(). These functions are supposed to return a value between [-2^31, 2^31). This doesn't seem to work on 64-bit systems, where we return a value between [0, 3^32). Patch up the function to use proper casts to int32_t. While there, fix some other style bugs. Modified: stable/9/lib/libc/gen/jrand48.c stable/9/lib/libc/gen/mrand48.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/jrand48.c ============================================================================== --- stable/9/lib/libc/gen/jrand48.c Tue Dec 20 07:50:49 2016 (r310320) +++ stable/9/lib/libc/gen/jrand48.c Tue Dec 20 08:01:17 2016 (r310321) @@ -14,11 +14,14 @@ #include __FBSDID("$FreeBSD$"); +#include + #include "rand48.h" long jrand48(unsigned short xseed[3]) { + _dorand48(xseed); - return ((long) xseed[2] << 16) + (long) xseed[1]; + return ((int32_t)(((uint32_t)xseed[2] << 16) | (uint32_t)xseed[1])); } Modified: stable/9/lib/libc/gen/mrand48.c ============================================================================== --- stable/9/lib/libc/gen/mrand48.c Tue Dec 20 07:50:49 2016 (r310320) +++ stable/9/lib/libc/gen/mrand48.c Tue Dec 20 08:01:17 2016 (r310321) @@ -14,6 +14,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include "rand48.h" extern unsigned short _rand48_seed[3]; @@ -21,6 +23,8 @@ extern unsigned short _rand48_seed[3]; long mrand48(void) { + _dorand48(_rand48_seed); - return ((long) _rand48_seed[2] << 16) + (long) _rand48_seed[1]; + return ((int32_t)(((uint32_t)_rand48_seed[2] << 16) | + (uint32_t)_rand48_seed[1])); } From owner-svn-src-stable-9@freebsd.org Wed Dec 21 15:40:17 2016 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E609C8A47A; Wed, 21 Dec 2016 15:40:17 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DA7F169C; Wed, 21 Dec 2016 15:40:17 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBLFeG4J020785; Wed, 21 Dec 2016 15:40:16 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBLFeGCV020784; Wed, 21 Dec 2016 15:40:16 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612211540.uBLFeGCV020784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 21 Dec 2016 15:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r310370 - stable/9/contrib/binutils/bfd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2016 15:40:17 -0000 Author: pfg Date: Wed Dec 21 15:40:16 2016 New Revision: 310370 URL: https://svnweb.freebsd.org/changeset/base/310370 Log: MFC r310132: libbfd: make sure variables are initialized before using them. Initialize l_sec_contents to make sure that free(l_sec_contents) is called on valid pointers. Obtained from: OpenBSD (partial CVS rev 1.18) Modified: stable/9/contrib/binutils/bfd/elflink.c Directory Properties: stable/9/contrib/binutils/ (props changed) Modified: stable/9/contrib/binutils/bfd/elflink.c ============================================================================== --- stable/9/contrib/binutils/bfd/elflink.c Wed Dec 21 15:39:16 2016 (r310369) +++ stable/9/contrib/binutils/bfd/elflink.c Wed Dec 21 15:40:16 2016 (r310370) @@ -11487,7 +11487,7 @@ _bfd_elf_section_already_linked (bfd *ab abfd, sec); else if (sec->size != 0) { - bfd_byte *sec_contents, *l_sec_contents; + bfd_byte *sec_contents, *l_sec_contents = NULL; if (!bfd_malloc_and_get_section (abfd, sec, &sec_contents)) (*_bfd_error_handler)