From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 324493C1FE2; Thu, 15 Jan 2026 17:27:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768498070; cv=none; b=kBu7JILQNy2zhwXffOQXLd8KYsnPPiKvj6c8L2fFMaYpYeiugmD0lh7BsWz1STpku9OEZWX9LlAD6dSQnADtCuxG2Dz5T3r1uNkeO1aMxWOAwJAIEbSmy/d3bFWj6mK68jReZtGrHcPIZ9gAW4p2R2BPSyxbRQnxAL9UUqgaymM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768498070; c=relaxed/simple; bh=62JhFZ7qS5tSHWL4Xz0HtLZt/Nv7/ctRfPNDp5R1pu8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eOkAj+LXS1yaHqIWUJtcytY0VTZppAiCRw1az3hG9B7sg07Pv6fp/erhOgqYj4jSMtd3UNFBVc3BNwajuAWFRSNE5OcJygR7kSN0LX8LQLtUS42JLFOOJv1DydYU2Nk8tsymUAwy/07LxACTPIt5JP00zNOrYjT19oxsRovqC28= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xFsAGrnZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="xFsAGrnZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AFB82C4AF0B; Thu, 15 Jan 2026 17:27:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1768498070; bh=62JhFZ7qS5tSHWL4Xz0HtLZt/Nv7/ctRfPNDp5R1pu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xFsAGrnZk/KnJM/3e9YfJdcQvoVB34/M9SnX5RlhZ2Apu+PG6bkpU/7QEzBtTp/gw skf18lc5lMOyvWL/M+LNK1lzlcc+CXFGnFEPgJVyNtBJeFRUKN9JAdbh7pWej7Blkj bt1nYQZfgMdpYPV8xT6zUVmkoJ9UPO23flGOOGm8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yuhao Jiang , Junrui Luo , "Martin K. Petersen" Subject: [PATCH 5.15 302/554] scsi: aic94xx: fix use-after-free in device removal path Date: Thu, 15 Jan 2026 17:46:08 +0100 Message-ID: <20260115164257.161916472@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260115164246.225995385@linuxfoundation.org> References: <20260115164246.225995385@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Junrui Luo commit f6ab594672d4cba08540919a4e6be2e202b60007 upstream. The asd_pci_remove() function fails to synchronize with pending tasklets before freeing the asd_ha structure, leading to a potential use-after-free vulnerability. When a device removal is triggered (via hot-unplug or module unload), race condition can occur. The fix adds tasklet_kill() before freeing the asd_ha structure, ensuring all scheduled tasklets complete before cleanup proceeds. Reported-by: Yuhao Jiang Reported-by: Junrui Luo Fixes: 2908d778ab3e ("[SCSI] aic94xx: new driver") Cc: stable@vger.kernel.org Signed-off-by: Junrui Luo Link: https://patch.msgid.link/ME2PR01MB3156AB7DCACA206C845FC7E8AFFDA@ME2PR01MB3156.ausprd01.prod.outlook.com Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/aic94xx/aic94xx_init.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/scsi/aic94xx/aic94xx_init.c +++ b/drivers/scsi/aic94xx/aic94xx_init.c @@ -897,6 +897,9 @@ static void asd_pci_remove(struct pci_de asd_disable_ints(asd_ha); + /* Ensure all scheduled tasklets complete before freeing resources */ + tasklet_kill(&asd_ha->seq.dl_tasklet); + asd_remove_dev_attrs(asd_ha); /* XXX more here as needed */