Date: Wed, 21 Aug 2019 07:45:39 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351324 - head/sys/netgraph/bluetooth/drivers/ubt Message-ID: <201908210745.x7L7jd30086482@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: delphij Date: Wed Aug 21 07:45:39 2019 New Revision: 351324 URL: https://svnweb.freebsd.org/changeset/base/351324 Log: Fix a panic in ubt_do_hci_request. The 'mtx' is on stack and can contain garbages that would cause mtx_init (and in turn lock_init) to think that the mutex was already initialized. Modified: head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Modified: head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c ============================================================================== --- head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Wed Aug 21 04:54:48 2019 (r351323) +++ head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Wed Aug 21 07:45:39 2019 (r351324) @@ -554,6 +554,7 @@ ubt_do_hci_request(struct usb_device *udev, struct ubt return (USB_ERR_NORMAL_COMPLETION); /* Initialize INTR endpoint xfer and wait for response */ + bzero(&mtx, sizeof(mtx)); mtx_init(&mtx, "ubt pb", NULL, MTX_DEF); error = usbd_transfer_setup(udev, &iface_index, xfer,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908210745.x7L7jd30086482>