From nobody Sun Oct 20 11:21:37 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 4XWbcL04gFz5YvJl; Sun, 20 Oct 2024 11:21:38 +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 4XWbcK49Jkz4X2W; Sun, 20 Oct 2024 11:21:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729423297; 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=7AYKu8DrrfiwEVyVEvyzske1jdEgdBmTC+1VTko1S2A=; b=xf0JCZq3xJCApOEGF7IEu8L3xYp1crAgUM8rNUNKVxOYRjdDd+QSI8VTb7ZS2skD1PvGe6 gpIHK92EUTiOyBgHR+OtbecDBTooe6pOtbJ1n9tPlKAx5YV/ZL9h/wHeHK2JPCzKW4eYoY 4iLdtkqafISXMDr/owjajAIaP4e/nfWXSwkwoS/hBUJ4IpREOFl49nYC+Jbpyed53d8Ccl MwgJ+92dWA+BbtrC/vtCclmRlbW4ZrsYyiVPdP9qxX5cnimGAwFgSw75xwgRfxEZXqdJKj fdNElko35c0BErbdVODUcxlmlEnm3aFGUaA7sSkk/cF0HiMVI9LYeS3oNH4TZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729423297; 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=7AYKu8DrrfiwEVyVEvyzske1jdEgdBmTC+1VTko1S2A=; b=C2ggFyQIuXcA2EcwI3k0mcdZK/sxfbUxfykkEkqrVflr634zNIDec3EVuU82qQhE/8cOAA XFDT7XP/1l2CUBy7pp1U+USaFyKeboDVXDNVrMmr7YL5hSqYx8hUFw0+5rN73EVMz+XCpJ hF94Kaepq+pHnKyePO84EgrHlQIj2SVwBRPULlPb0a50kRHXa6YsaHbypmX2YnrERrlvaR p3OpEzMp89WrhaP2ZcvzuyWWCuDLrTbFmy7N9a+na3mmFLJRJeJk/G1cw8N+E98JrOVc8U JyhfBvooxy3ETo6Td2qLwjPlvVNz/Mvf2rjsFA7tjNo+8YzySiFePssWckJLdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729423297; a=rsa-sha256; cv=none; b=vtfLcy3yWlGCTBlL4/GsRXRGfktsoE3z9WI2U1DIqhfviVh1FTg3BpLzqRw/3E8TRFwpjF N8coKUHp7EJBf4p8iYaH7XOFjvI+nLzP1mh8rUUMZaPF948y7PBY1cYXl3hj4tqUMAApbs /WSpOV01fr8VqlBygc0q9uKNHdC/mzpeJss5WtxGNW2uf7qKfyIc3qWwiCCYfQh9boCSne e5b9OkW0N4g2JoHZAyLAHbu1HMZ2OasdWGLG0bdqeaZSjjHmY7E69hL8UjrYJVWLNtbaud KLFydETi9D1Rp+dJoTifkm63Qkf95ajCSqji+un6k1W3prSr4c1M5+X6z/zr9A== 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 4XWbcK3lkqz10Lm; Sun, 20 Oct 2024 11:21:37 +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 49KBLba8062833; Sun, 20 Oct 2024 11:21:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49KBLbIA062830; Sun, 20 Oct 2024 11:21:37 GMT (envelope-from git) Date: Sun, 20 Oct 2024 11:21:37 GMT Message-Id: <202410201121.49KBLbIA062830@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 8065f1af82d1 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 8065f1af82d1443c83168a3e8dd82afc5f658d24 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8065f1af82d1443c83168a3e8dd82afc5f658d24 commit 8065f1af82d1443c83168a3e8dd82afc5f658d24 Author: Christos Margiolis AuthorDate: 2024-10-18 08:40:08 +0000 Commit: Christos Margiolis CommitDate: 2024-10-20 11:21:05 +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 (cherry picked from commit e42c8267821952407d4f4064026058aeaaa741ac) --- 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);