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 1BA31478E5D; Sat, 12 Sep 2026 11:53:03 +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=1789213986; cv=none; b=nQFo9Yx3jYuBQ/Td6Wiopwpoqc1B7SkKEe1H7uT01CeeBmSjtdKGx7OwdZSrR1lIKHXKEhAmZzWj20XBhLCH5iPjtXggpnVmjN4vYyIXklLzpGzNSIHqOQKjmC/74ZnxxtYoFxhwZW7uunW3ICmuqvqhqo6oY6uXlYtD++FzLxc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789213986; c=relaxed/simple; bh=pC6k2GMyq7WiMHuAEjoTBJ/hD4zRcjLkt0yuAIOebD4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UhjKwX7vbKZvbsEptd3Kc11UVPHUP389HM8gBpCSx8vFVUBvbiAFBz4jcn9vwainbljN0+26Lm2vXYDvI2bids/gsKFAGHCoCTYkY/maQiIG2Tt8slJkfA+BnF8JW4WRfk6N2pTPtdtmUOGkLwOI88cN5zK+zCaEWfr1eXAM/2I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=R6JgNvzp; 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="R6JgNvzp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D26521F000FF; Sat, 12 Sep 2026 11:53:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789213982; bh=yocnPUbmqP4RTnqTqaloz2VofH5BTQwx6LmC8IstiGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=R6JgNvzpvxdCcyNWYzR6QWt5xp4KuQ2ylneWWK23Bf1vuTUjSOP1sgyzFiRy5INgx 1zeIxoS6ZG6WwivyeK1Ow+TYzNoPq0JU5J8NLnV4nDx4HngtLJ+VsZ3HzAhrdl+TvU 6Gv9w1YtYqJCXmG7m2lhvqtVWChT/fyYABdpusIo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+a11c46f37ee083a73deb@syzkaller.appspotmail.com, Fedor Pchelkin , Diego Fernando Mancera Gomez , Hans Verkuil Subject: [PATCH 6.12 0190/1376] media: em28xx: defer audio-only extension registration Date: Sat, 12 Sep 2026 08:43:36 +0200 Message-ID: <20260912065611.786049976@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.535295758@linuxfoundation.org> References: <20260912065607.535295758@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.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Diego Fernando Mancera Gomez commit 95f76f51937fdfb0fc1e14cae606b1ef574a56f3 upstream. The audio-only path registers extensions while probing the primary device. For a dual-TS board, this happens before dev_next is created. The duplicate device inherits is_audio_only and is then independently inserted into em28xx_devlist. The list is intended to contain only primary devices: extension operations reach the secondary device through dev_next. The independently linked secondary can be freed during disconnect while its list node remains reachable, resulting in a use-after-free. Defer audio-only extension registration to the module-request work item. It runs only after probing has completed construction of the optional secondary device, so only the primary is registered and extension callbacks reach the secondary through dev_next. Fixes: 4a089668ef22 ("media: em28xx-cards: rework the em28xx probing code") Cc: stable@vger.kernel.org Reported-by: syzbot+a11c46f37ee083a73deb@syzkaller.appspotmail.com Closes: https://lore.kernel.org/all/66ec3c83.050a0220.29194.002f.GAE@google.com/T/ Suggested-by: Fedor Pchelkin Signed-off-by: Diego Fernando Mancera Gomez Signed-off-by: Hans Verkuil Signed-off-by: Greg Kroah-Hartman --- drivers/media/usb/em28xx/em28xx-cards.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c @@ -3448,6 +3448,7 @@ static void request_module_async(struct * intf. Don't register extensions twice on those devices. */ if (dev->is_audio_only) { + em28xx_init_extension(dev); #if defined(CONFIG_MODULES) && defined(MODULE) request_module("em28xx-alsa"); #endif @@ -3676,8 +3677,6 @@ static int em28xx_init_dev(struct em28xx retval = -ENODEV; goto err_deinit_media; } - em28xx_init_extension(dev); - return 0; }