From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 0872E2DB788; Sat, 12 Sep 2026 14:02:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789221764; cv=none; b=M4yPf4gCsj+DHZwulmNHJTArKc8+7c4KVAl5ogCXBY8RSGbMWamVLcSCe25HumGsKa5xv/ucubQFGOiEVAsdJ4hkjOEcX3feyTeaeNkkF9bDLN4n2vwF4GbYFknGvEi0KYiCuUNTWc9tNx6Be5vWR+yWD4kjIjrPX/t1jens9oI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789221764; c=relaxed/simple; bh=7h0UTyETGrdlukrREt707BmyIab4KEX9DQMPWnTk7BE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qs9lk+4unCom62qARJ3I3zapa+Tp0TGV6emHsuU8/9PNeUb/Nb7ZfISHj+3YC0WwpR2ViMrw0aWwqqXxfOYP4jKcH3WkqCDNFx4vLKZxSIK5Aky2kiJ41iDFOl4Pkvqe4x7R5ZoKZpGYIfsMRwzLwoBG2xYZ0E/XdIUnc8tTGaw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=mV4LqDug; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="mV4LqDug" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 016EE1F000FF; Sat, 12 Sep 2026 14:02:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789221762; bh=1FVJs6KcCt5bZ/fRHKBVhcz8f03cPcszlY6w7lpwV68=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=mV4LqDugr9WwpTPn+WbNApZ8NCDs8ek1BNlWd2377/XhhXREwI6cvGz2mt8T1wNnQ fm/z4a02TD6H4ad77yyoq+L7jDZvPZHUlcpZQgv8els2QrgxQmiXWYSe4ictBYqvxM W1L0noUA0atoX/bWLoggfnz1tMBxHYv/Pwq6wW6I= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+99d6c66dbbc484f50e1c@syzkaller.appspotmail.com, "Jiangong.Han" , Hans Verkuil Subject: [PATCH 6.6 0450/1424] media: em28xx: fix use-after-free of dev_next->devlist on disconnect Date: Sat, 12 Sep 2026 08:48:02 +0200 Message-ID: <20260912065617.361520520@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.279695368@linuxfoundation.org> References: <20260912065607.279695368@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev 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: Jiangong.Han commit 826915b6b65e2d3251e7248ea54289a22d748c84 upstream. When a device with has_dual_ts=1 is probed and the is_audio_only path is taken, both dev and dev->dev_next are added to the global em28xx_devlist via em28xx_init_extension(). However, during disconnect, em28xx_close_extension(dev) only calls list_del(&dev->devlist), leaving dev->dev_next->devlist still linked in the global list. When dev_next is subsequently freed via kref_put(), its devlist entry becomes a dangling pointer in em28xx_devlist. The next device probe that calls em28xx_init_extension() triggers a list corruption BUG when list_add_tail detects the freed node. This bug was exposed by commit a368ecde8a50 ("USB: core: Fix duplicate endpoint bug by clearing reserved bits in the descriptor") which clears reserved bits in bEndpointAddress during endpoint parsing. This causes fuzzed endpoint addresses like 0xf3 to be normalized to 0x83, which em28xx interprets as a vendor audio endpoint, enabling the is_audio_only + has_dual_ts code path that was previously unreachable with such descriptors. Fix this by removing dev->dev_next->devlist from the global list in em28xx_close_extension() before the device is freed. Fixes: f410b4093fdd ("media: em28xx: split up em28xx_dvb_init to reduce stack size") Cc: stable@vger.kernel.org Reported-by: syzbot+99d6c66dbbc484f50e1c@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=99d6c66dbbc484f50e1c Signed-off-by: Jiangong.Han Signed-off-by: Hans Verkuil Signed-off-by: Greg Kroah-Hartman --- drivers/media/usb/em28xx/em28xx-core.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/media/usb/em28xx/em28xx-core.c +++ b/drivers/media/usb/em28xx/em28xx-core.c @@ -1133,6 +1133,8 @@ void em28xx_close_extension(struct em28x ops->fini(dev); } } + if (dev->dev_next) + list_del(&dev->dev_next->devlist); list_del(&dev->devlist); mutex_unlock(&em28xx_devlist_mutex); }