From nobody Fri Mar 29 15:32:57 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 4V5kty1hB0z5DYJT; Fri, 29 Mar 2024 15:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V5kty0Wctz4JmQ; Fri, 29 Mar 2024 15:32:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711726378; 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=klXyxP3nqepnLdFTFf/7HL4cvJvjRVjn9PVlCkOAGCs=; b=JQIgwDatFRsRZOWQtM9/gAjfg88/g9fh6sSda7bZ0zCSgjSfOlaks7LpxMWvskM1ibviSp oK8p6uMzRUw+tzURPs4+GLT2XGRu7DDlwsJVJSfvcsEl8BYk/PAZxsMqz/xhCCEKW7nmA+ zprwe4e7qtjkWQMhNpTquJKtVQa27/pXSsJhlMCZM094hxGDluGYaZ+ZBf/ayiFegQJUM6 YfX2vebrhbvYL/3SwTJ4MBmWpNlcl13VPOcPD9gbh2XXJVt3BCC/7AX0oQEKW4E6oqb0dW 4jijwNOMfJkr5mdfgw50XFfB9vPZfU8hsHQXK2zIxRmk9U38F4xyu9GRYJDvvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711726378; a=rsa-sha256; cv=none; b=s3dDZD1Ku1YhJXTKMkuROe7Cm0gj+ocNniC2z1gCFGefJqYouEm0Fsv4fU3103eZG6hDxM FOuqtyszVPecW4Cq5BqNwUbhzRfVDgZJQKLQSY3At8Dbv0mWAHxC8C+t5xIG/Dot+gWnrC hR48/dFfxZyMkWJKqJk/zS/cBMQtWTT92q5vOtk9UV1XxlMPH6xHwYY6QQgF7GF1VdtZmx iq5zvAnWxai/hLn3KRBQWWTigp6bEtCD8o1ch8tdiKsDKHaUdFfAl+VDJkGyPJ9XUel0tS K3fd8mIrVpOXVmsUDNRn1HEcmRnavWeHOjY4joqeHXC8mGppXf/pOoj9I1uoJQ== 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=1711726378; 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=klXyxP3nqepnLdFTFf/7HL4cvJvjRVjn9PVlCkOAGCs=; b=Y3LS4vW1yBY/OfGH5iZuQhhCzNiKQj1wdWdzcI7O7j941BfuwUFuLzPBwixdea3N6gZQ/d 6LKDbVBqfAzU5wVVnP6kYdT5p6c2Nwl0uvQFYoorCReRq3GL9RyyS+KS8ro/3RgXDXM0oe JNXL8ZN10yxRTZdtRHqWWowtFKk/Foo72pDgRgQbS1rA9NaifbQ/LZ/o+xR9cIOnMo3M2t VjpHiTDJLzLHIYRk2rPIlW8sIlcZVTxOSfAk9Z9RLYLO91aXrQmIr1ZMUUVRtEJcDped6e aGTRDXlhArKkvWL67+7ahLBZ9nByAfLOFMyi9qPOQHrRuP80shTWHMTQVtUkKg== 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 4V5kty06FlzGkC; Fri, 29 Mar 2024 15:32:58 +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 42TFWv7L011310; Fri, 29 Mar 2024 15:32:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42TFWvOs011307; Fri, 29 Mar 2024 15:32:57 GMT (envelope-from git) Date: Fri, 29 Mar 2024 15:32:57 GMT Message-Id: <202403291532.42TFWvOs011307@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: fba54d0179aa - main - 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: owner-dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: fba54d0179aabb3d94211ca80f94fe5b98ac6d3b Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=fba54d0179aabb3d94211ca80f94fe5b98ac6d3b commit fba54d0179aabb3d94211ca80f94fe5b98ac6d3b Author: Christos Margiolis AuthorDate: 2024-03-29 15:29:23 +0000 Commit: Christos Margiolis CommitDate: 2024-03-29 15:29:23 +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 --- 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;