From nobody Fri Apr 12 01:10:14 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 4VFz5231K1z5GWbt; Fri, 12 Apr 2024 01:10:14 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VFz522Hd5z4NX5; Fri, 12 Apr 2024 01:10:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884214; 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=pqcs468MDNEzq+mFNmh/GqkksXZdb2VOhC1/BDDMQoU=; b=sg/9iPzjLW+3JEaTNT9qSGmwGfHE3v6UBY7tIkOmgAoq0GyP0LoeT+towxxnS6bn+tzTZ+ X+gjO3GF/knOa7YUkp69ED4ZMeUnloDZ/lR3TjVKsopqUxqb2F/PGVNXDVQnOOszzD9JiL N1FLRKYBCKAG8mvWNfyHwRXTGMRNp1jwTs74LMORCMaOGwDDUMVPRGb7fQ7uvFZ8VOg5tm VjQ4wxqYg97cEY+viNL1pL0ssOprH9yKTmznsxxd3cyj7IbwWwIFy+7wvb0u60t6MNygGZ zpl9fdag0JUz0pUJtgjIQeFfnnBvGp///ia9gCGdHd4ZwYEZqjGit0ppejut3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712884214; a=rsa-sha256; cv=none; b=xgO8S2XXjwCc94H4OQ1zQvSXSh81iEK/tFQjKTX0ZcAC14sBEwMzj14QsULjj0vLmalelf QjfHVwHT88GBicGSvzQknAolCI7R7wfQjr/uUB5cST6xZ8aDrFKdbsTNlO4hZDJdnsk4nX 86C5m6i1Or8GRFCZn45MM4GDLUKbwDWbpN4uI2ujMvQ0aryyhsHjyBYHyIhivMJsmrjCCy SotQApoPP5ND1zBy2h3RWJXWcMnitHVdyviYZJDYr1PwtgcZ7hSzHTv97rlrdcX7bNPBNY YoVSF+4IuIBnS+jut+nQQW/DfHvLolaT3btvxBXW4aaa4k/VK5qdDXyyBL+gOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884214; 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=pqcs468MDNEzq+mFNmh/GqkksXZdb2VOhC1/BDDMQoU=; b=dnHYSaHSfv32fsFIwMPjNHPvXQYSIoeoW3hHgAFEErj8lf6jbvwKqW2BrQEkLmA7DxJlZ7 faAyEy/uo1sJkaxl3TqwdoNNrbzGr0rzp+CwJzwYBEiQzFlsj7eLxJ5wazUBTfF4oNt/+q hTqCKGpf6D16lbpfD2MfeQUvDdymC2T7c20PZB1aDAHf7RdPiZJQHz6yn5GwqJ2Vr5uizp a+n74H1D+1LCm7tE2SCVVoSraUG7q14FAjy1UMae71SKqHE3WQslkN9J0XtRB6mDHOr+My /oW7Jdomya6Zzo6TJ5f3HR01yBnY/HWTFqVSW5f/QMqxSIpK1PZAdD14l8/QNw== 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 4VFz521mt0zTC6; Fri, 12 Apr 2024 01:10:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43C1AEVF039984; Fri, 12 Apr 2024 01:10:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43C1AED5039975; Fri, 12 Apr 2024 01:10:14 GMT (envelope-from git) Date: Fri, 12 Apr 2024 01:10:14 GMT Message-Id: <202404120110.43C1AED5039975@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: ea2275e72cda - stable/14 - sound: Drain buffer selinfo in sndbuf_free() 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: Sender: dev-commits-src-all+owner@freebsd.org X-BeenThere: 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: ea2275e72cdae3672f3aabde18e3ff55ea101a0a Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ea2275e72cdae3672f3aabde18e3ff55ea101a0a commit ea2275e72cdae3672f3aabde18e3ff55ea101a0a Author: Christos Margiolis AuthorDate: 2024-03-29 15:29:23 +0000 Commit: Christos Margiolis CommitDate: 2024-04-12 01:09:51 +0000 sound: Drain buffer selinfo in sndbuf_free() Prevent a use-after-free in kern_poll() by making sure the buffer's selinfo is drained. This is required for a subsequent patch that implements asynchronous audio device detach. Reported by: KASAN Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44544 (cherry picked from commit fba54d0179aabb3d94211ca80f94fe5b98ac6d3b) --- sys/dev/sound/pcm/buffer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/sound/pcm/buffer.c b/sys/dev/sound/pcm/buffer.c index 915c9110f107..afb4b95e357a 100644 --- a/sys/dev/sound/pcm/buffer.c +++ b/sys/dev/sound/pcm/buffer.c @@ -147,6 +147,7 @@ sndbuf_free(struct snd_dbuf *b) } else free(b->buf, M_DEVBUF); } + seldrain(sndbuf_getsel(b)); b->tmpbuf = NULL; b->shadbuf = NULL;