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 430B22494F0; Wed, 8 Apr 2026 18:26:18 +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=1775672778; cv=none; b=uliIni3zfGAEpvGy+6/p5cPPl54CI+SlPXuX8Uz2hKyVyQg31Af6VDQyjjcA84bsSwKyfU9y+Y3w6WggW68Gj4FQLr6Q1MzvPQbj34NSppL4X+rqHaiJpOGv6KUB5T69lZ3RFQBdQaPP1b3fxuHhm6IXUSJR9m9/d189cfaW4ig= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775672778; c=relaxed/simple; bh=8CiO7QP2gBh4rnUJ6gGtjfOqtatpcik5h0nE2lWZkZA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Kb4t9zbOIblVmQFqPITU7zFfdJ2vajGDlOEiCisyQhCQZUknqH1vkLTvSggDaOqM92zqgclBdMniU9MPcTai1xS1E4WSnTLPbvZJqUv/6LrORrA1Wnp959vXBBMeoCr/kXGkWWdvTQriE0UzURpeiTr136VNNm63f4LGhh4/ULg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=IMFFjd7a; 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="IMFFjd7a" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC7BFC19421; Wed, 8 Apr 2026 18:26:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1775672778; bh=8CiO7QP2gBh4rnUJ6gGtjfOqtatpcik5h0nE2lWZkZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IMFFjd7aU3LlIRlmuzLLPFYTOi1U9oYd5PyxegTHsxXbk7/ugzs0RXpo9YEZkQNoW vvUi8aKxsF1kd46qPIqXSJvm9egKWeoeHkPBc9kAmW975jIPZsen69H2iOVrJRID7j JRWQrZkR8xaaIRLp7OedVPEdNDq7Nrjyl3UQljM0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+9a3c54f52bd1edbd975f@syzkaller.appspotmail.com, stable , Heitor Alves de Siqueira Subject: [PATCH 6.6 106/160] usb: usbtmc: Flush anchored URBs in usbtmc_release Date: Wed, 8 Apr 2026 20:03:13 +0200 Message-ID: <20260408175917.140458206@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260408175913.177092714@linuxfoundation.org> References: <20260408175913.177092714@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 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Heitor Alves de Siqueira commit 8a768552f7a8276fb9e01d49773d2094ace7c8f1 upstream. When calling usbtmc_release, pending anchored URBs must be flushed or killed to prevent use-after-free errors (e.g. in the HCD giveback path). Call usbtmc_draw_down() to allow anchored URBs to be completed. Fixes: 4f3c8d6eddc2 ("usb: usbtmc: Support Read Status Byte with SRQ per file") Reported-by: syzbot+9a3c54f52bd1edbd975f@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=9a3c54f52bd1edbd975f Cc: stable Signed-off-by: Heitor Alves de Siqueira Link: https://patch.msgid.link/20260312-usbtmc-flush-release-v1-1-5755e9f4336f@igalia.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/class/usbtmc.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c @@ -254,6 +254,9 @@ static int usbtmc_release(struct inode * list_del(&file_data->file_elem); spin_unlock_irq(&file_data->data->dev_lock); + + /* flush anchored URBs */ + usbtmc_draw_down(file_data); mutex_unlock(&file_data->data->io_mutex); kref_put(&file_data->data->kref, usbtmc_delete);