From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796180365; b=o4JBJJcJfkaqx+IGVTMt/LVXAjNcf8dqsrlsCNVPALH/K3cehGvQa6FxPD6i6DsiKghl /Uah4/eBO6WwPTwUq48BgMuD9tPmsuUjZ5xrh9ExcVaWu5ZfvBIVDOivqeRb+u6FwptWV vyH6+yMNGdLAxk2jA8skNRGjfAObBiVUUKjhzete22Cxlv7fh0K5EJ/nXqxnruPO89fGe p2SzpDensrMO5qpW/yKJrXepoBLSajScWUY52k3qveD2aOZLQLXM2W5+pToVWzNi1JQJJ FJPCOy8ExSldtmx6WT3QiakT9HemecXJyWR3APZfg2eQksT7+dCQWToG/nw2i2pv5fQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796180365; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=QMO0MBxFT6GM+VhqtgH0PBDjazyaa3hgyyIsV4ZpFSg=; b=kbihW2ZZDtcJ4h173ad3BYgVv8TKDw+dKs2bTcpyXzTNDflZ9nssPKTI7r52I+xnwkUi 5MWZdtGkUGg6Qpi8e9v4kIR9uG6uFf1QAQKLu5TUEb0bCaHXkz4+UXGItpag66lEfUFd9 t7kZmE13GsZBuopW6cKNPRtHvu53HVA25svABtUDWdhYRfg+N3yIPANq/GEiznsOKdL1y fqEE7p3E1U6s1l4D4M0yFthdUBf/u+d289Oh8nD711HibcRdOB/NxBdRBhEr0L1wl6hKs w67qouizsFSgm83d857WIE+MKv/mGVt8rFCTsR62rbfgva3PX1VA+l/9xzUZbRWWntQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gU2IzeX1; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47D79606A322 for ; Wed, 2 Dec 2026 02:59:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gU2IzeX1 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D62841F000C1; Wed, 2 Dec 2026 02:59:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796180364; bh=QMO0MBxFT6GM+VhqtgH0PBDjazyaa3hgyyIsV4ZpFSg=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=gU2IzeX17AAqCXo3SaelfwnoLk+ZXL+y//3ExE5mLwvijOCBQz5UFN7G+SJXWnZo3 zNJh7CKFNz10ji8BOT/UUbeM0NI3JjYrIqim9qQyjvaWZKruIu6sMk5ub9d0f7NdVY QFBcNUHXOpsKgyZxrK/R6unyB/wBvByNRvg9fC25rLUQcLsTsi7qh9c/qzI1jAOCXB vvyC2CX/P1HjRFRehp/5L6Ra4lVXb3KLSWCZP5B17KYsbluzhO+nyf5IIkFRKyEYvh PJadr730yM4+8Obn/3RLq1OCoQzaBeoAqxgaHxBAUFIIy8NpRSSuXDbRal0Aj/s/UT QBQJk+DqM0pAw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] ASoC: intel: atom: SST: clear the compress drain callbacks on close and gate them on the stream status (uaf of snd_compr_stream) Reply-To: sashiko-reviews@lists.linux.dev To: "Hanxiang Xu" Cc: linux-sound@vger.kernel.org In-Reply-To: <20261202021739.1-1-xuhx@hust.edu.cn> References: <20261202021739.1-1-xuhx@hust.edu.cn> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 02:59:24 +0000 X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] ASoC: intel: atom: missing Fixes trailer in commit message -- commit 8b22e969b6edb39c81e25e25be00f9bd0eddc9fb Author: Hanxiang Xu > ASoC: intel: atom: SST: clear the compress drain callbacks on close and g= ate them on the stream status (uaf of snd_compr_stream) > > sst_cdev_open() registers four callbacks into the persistent DSP > stream slot, but sst_cdev_close() clears only the compr_cb pair and > leaves drain_notify/drain_cb_param armed, and never clears the slot's > pipe_id. process_fw_async_msg() dispatches IPC_IA_DRAIN_STREAM_MRFLD > purely on "pipe_id matches, drain_notify !=3D NULL" with no status > check, so a drain completion that arrives after the close path has > run snd_compr_free() - which kfrees the runtime and the > snd_compr_file containing the cstream - is dispatched as > sst_drain_notify(cstream) -> snd_compr_drain_notify(), writing the > freed cstream->runtime->state and waking the freed runtime->sleep. > SST implements non-blocking drain, so "drain, then close while the > firmware is still draining" is a routine user sequence, and nothing > synchronizes the threaded IRQ on this path. > > Clear all four callbacks plus pipe_id in sst_cdev_close() and drain > in-flight completions with synchronize_irq(ctx->irq_num) before > returning; gate the DRAIN branch on STREAM_RUNNING like the > PERIOD_ELAPSED branch already does. > > Also reproduced on 7.4.0-rc5: 104 slab-use-after-free reports > (49 in sst_drain_notify itself) with a KASAN kernel; negative control > (callbacks never armed) clean. > > Cc: > Signed-off-by: Hanxiang Xu [Severity: Low] Since this fixes the missing drain callback cleanup in sst_cdev_close() and is tagged for stable, should it include a Fixes: tag? Fixes: 7adab122a57c ("ASoC: Intel: sst - add compressed ops handling") --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202021739.1-1-= xuhx@hust.edu.cn?part=3D1