From nobody Fri Oct 18 08:44:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XVJDV5Krmz5YwJv; Fri, 18 Oct 2024 08:44:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XVJDV3Q8sz4mQJ; Fri, 18 Oct 2024 08:44:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729241098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s91VsAyZQeqSmyJpJ+/66Gq30zipusxJx3aJ+kEHxck=; b=PVIqLH4S3BZaskS1N5HMSrw59Osjjn4h0xVGT/KJscjstRoGceKOHLZslf0AewkltgHYYA TYxDMy2k+6l7MolhMBbGp5nIqo04voYqJs3wkm2FM2FOMUQq+wVWKqglXzLYRpbcZcVf/b iN4bUgqEvpVNIRn/idju99tQjL9Rsd9eumI5TJnrz6TUJdWPYnr0UJupdKBdyA8gVQDPDg 19anXm88h0yoyIoIaT82PxfwXcvQLoMUgRaz7NkCwIJ54HLUIO2gqW0EEpU/Z5qVebqAFj Q3pMl8Sgpn1T8W+IJpF+S1TLIgBsWMJ7epXxT4xXRfU9q84FzOXL7fZrgCWD9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729241098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s91VsAyZQeqSmyJpJ+/66Gq30zipusxJx3aJ+kEHxck=; b=VNo3uupFIjsER8z2oG2Vuaz+tB/w9pEsJ8NKfLpPttIVEIVSrJZhw3rMsnqyBqo0erF6A+ Z1/2yRzV9J5bTDJfCjyNs/G/kJLT7/JEjy08FYMvLwoAxdfs3JA8+ANwpgzGN9KNrKaKUM E4eha+WL0cFcZThu0cYYHBpYuoI0+grHmdS+I7DChRdrbr4+fXoZAh4I/mbnPN6YQMRqF5 Wda5A4s5Z+Aw9o+lx/w+UBLj2gLeX1ayMWH0yccNOecmp8qHOKq3jn+NETzNe014RQ5cV+ IKGy7QMDeBjelB+gbfABVrr94yqEr4UEM3dyJ2p0ooX2R5ajl/kJEgt/B7j3vQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729241098; a=rsa-sha256; cv=none; b=RPXQmzKtSconqnnGS0EBD+D5qCcr9qkxNPp5g+sw8MNd9/DhUfybFTRsSYSCEZBGwUBl3w Tl+2FScitDDZaGlMCfVe4ZAETmkIswjSWtPFFWjoHdaPkoThPVr+IYGLe+0SpR2ppIAKWm 3QQap/PXCXck3ImC+d/XFwZVJkiXyDAFlMOc1Hg1TdrTocyRYGiETxTg0LYDSgAZfSra42 lU3vmA71sDrjcataAvv6FWvhQQ9pmRUv4b1ktNDY8q6rBNImJHD8zTAEt8Gm4JDDX/1HcI 9vQDHKlhmyn8maKsPJJ8rviTmz3ounfbiPgFmSsjfzs/mAJIhzEElyQ8FkGb/A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XVJDV2pPRzRTn; Fri, 18 Oct 2024 08:44:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49I8iwob088048; Fri, 18 Oct 2024 08:44:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49I8iw1w088045; Fri, 18 Oct 2024 08:44:58 GMT (envelope-from git) Date: Fri, 18 Oct 2024 08:44:58 GMT Message-Id: <202410180844.49I8iw1w088045@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: e42c82678219 - main - snd_dummy: Drain callout during detach List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e42c8267821952407d4f4064026058aeaaa741ac Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=e42c8267821952407d4f4064026058aeaaa741ac commit e42c8267821952407d4f4064026058aeaaa741ac Author: Christos Margiolis AuthorDate: 2024-10-18 08:40:08 +0000 Commit: Christos Margiolis CommitDate: 2024-10-18 08:40:08 +0000 snd_dummy: Drain callout during detach If we do not enter dummy_chan_trigger() before detaching, we'll get a use-after-free since the callout(9) callback might be called after having been detached. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj, emaste Differential Revision: https://reviews.freebsd.org/D46715 --- sys/dev/sound/dummy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/sound/dummy.c b/sys/dev/sound/dummy.c index f8193a73fcc8..c1cd4dff15f9 100644 --- a/sys/dev/sound/dummy.c +++ b/sys/dev/sound/dummy.c @@ -327,6 +327,7 @@ dummy_detach(device_t dev) struct dummy_softc *sc = device_get_softc(dev); int err; + callout_drain(&sc->callout); err = pcm_unregister(dev); snd_mtxfree(sc->lock);