Date: Fri, 13 May 2016 05:57:22 +0000 (UTC) From: Scott Long <scottl@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299590 - head/sys/dev/bxe Message-ID: <201605130557.u4D5vMBZ015636@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: scottl Date: Fri May 13 05:57:21 2016 New Revision: 299590 URL: https://svnweb.freebsd.org/changeset/base/299590 Log: Don't jam the softc in the device_probe routine. The softc isn't owned by the driver here, so it shouldn't be accessed, let alone written to. Remove the nearby debug line, it's the only thing that depended on the softc, and it depended on it in a way that couldn't work in this part of the code. This fixes some reports of use-after-free and system instability with DEBUG_MEMGUARD enabled. Submitted by: Matthew Macy MFC after: 3 days Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Fri May 13 05:49:02 2016 (r299589) +++ head/sys/dev/bxe/bxe.c Fri May 13 05:57:21 2016 (r299590) @@ -2454,14 +2454,11 @@ bxe_sp_post(struct bxe_softc *sc, static int bxe_probe(device_t dev) { - struct bxe_softc *sc; struct bxe_device_type *t; char *descbuf; uint16_t did, sdid, svid, vid; /* Find our device structure */ - sc = device_get_softc(dev); - sc->dev = dev; t = bxe_devs; /* Get the data for the device to be probed. */ @@ -2470,10 +2467,6 @@ bxe_probe(device_t dev) svid = pci_get_subvendor(dev); sdid = pci_get_subdevice(dev); - BLOGD(sc, DBG_LOAD, - "%s(); VID = 0x%04X, DID = 0x%04X, SVID = 0x%04X, " - "SDID = 0x%04X\n", __FUNCTION__, vid, did, svid, sdid); - /* Look through the list of known devices for a match. */ while (t->bxe_name != NULL) { if ((vid == t->bxe_vid) && (did == t->bxe_did) &&
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605130557.u4D5vMBZ015636>