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 4C09F199E89 for ; Mon, 8 Dec 2025 01:17:12 +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=1765156632; cv=none; b=Ze1uvx3YqUBcXwC+YHuNLqpairH2xfeE7XsMdKJ2wne+iiUp4AlsDrqvPlSmmZBMwhAsSETwF9us+54++vprh7Nyux1Qm7Bnpl1JCPX7FcOvtmQy5kpVJB9OGYodetxXmxTFoj75ekPMzgb4aPCh4chXlbj2kZ/Xf4lavDim9Kw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765156632; c=relaxed/simple; bh=W05G1eFda3LsQZNK/sYzlj6E1OyllnP+XQhXOXkaUHk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=X8Nfw+5dxxRLHK3GxefKY8+3gG1uAUxdZ5Xyd8TxbqeDMaMhs/S9x9K3AzIprKa3D6k0KgnR/rJcAvuxXMlUL/oWFHZyxFfzeVYEstchoP8iLUuv+xuDHkcWAaoFOlnXdaZwZycoZm02MFDc+P5cTB4u1WlNLn3zKT9xkOWmoGc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dqU9h/At; 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="dqU9h/At" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65B6BC16AAE; Mon, 8 Dec 2025 01:17:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765156631; bh=W05G1eFda3LsQZNK/sYzlj6E1OyllnP+XQhXOXkaUHk=; h=From:To:Cc:Subject:Date:Reply-To:From; b=dqU9h/AtBofzJbAOXmjYKufyQCUIqLom4kNhcsZ4vO/p4/MkTIklh0ZREM69QB4DE nsXydxoqTB5kOwhq9qBQOmo26BTNNILO6i9PvTGjYobOE6LKiP/AWpdREV5+U8/+e3 cXOdHF42KO4oXYYqfa+36kM1smEyhrDv5k+afsCc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50626: media: dvb-usb: fix memory leak in dvb_usb_adapter_init() Date: Mon, 8 Dec 2025 10:17:03 +0900 Message-ID: <2025120853-CVE-2022-50626-a97f@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5837; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=sFpDzNeag1K04p2EMpKDqAXk2IPbpmD9Do/P4ESmdZE=; b=owGbwMvMwCRo6H6F97bub03G02pJDJlm6qytpVnhq79/3rGsadU0n2wGiRn2K63UlkQdvOnSu /zo3WWzO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiLKkMC+YKLNjQoC/2ZL/O krtnt5lcnfEs/jnD/KrTx/SMrBe7JNUcm7uq0efTHU7eDgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: media: dvb-usb: fix memory leak in dvb_usb_adapter_init() Syzbot reports a memory leak in "dvb_usb_adapter_init()". The leak is due to not accounting for and freeing current iteration's adapter->priv in case of an error. Currently if an error occurs, it will exit before incrementing "num_adapters_initalized", which is used as a reference counter to free all adap->priv in "dvb_usb_adapter_exit()". There are multiple error paths that can exit from before incrementing the counter. Including the error handling paths for "dvb_usb_adapter_stream_init()", "dvb_usb_adapter_dvb_init()" and "dvb_usb_adapter_frontend_init()" within "dvb_usb_adapter_init()". This means that in case of an error in any of these functions the current iteration is not accounted for and the current iteration's adap->priv is not freed. Fix this by freeing the current iteration's adap->priv in the "stream_init_err:" label in the error path. The rest of the (accounted for) adap->priv objects are freed in dvb_usb_adapter_exit() as expected using the num_adapters_initalized variable. Syzbot report: BUG: memory leak unreferenced object 0xffff8881172f1a00 (size 512): comm "kworker/0:2", pid 139, jiffies 4294994873 (age 10.960s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] dvb_usb_adapter_init drivers/media/usb/dvb-usb/dvb-usb-init.c:75 [inline] [] dvb_usb_init drivers/media/usb/dvb-usb/dvb-usb-init.c:184 [inline] [] dvb_usb_device_init.cold+0x4e5/0x79e drivers/media/usb/dvb-usb/dvb-usb-init.c:308 [] dib0700_probe+0x8d/0x1b0 drivers/media/usb/dvb-usb/dib0700_core.c:883 [] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396 [] call_driver_probe drivers/base/dd.c:542 [inline] [] really_probe.part.0+0xe7/0x310 drivers/base/dd.c:621 [] really_probe drivers/base/dd.c:583 [inline] [] __driver_probe_device+0x10c/0x1e0 drivers/base/dd.c:752 [] driver_probe_device+0x2a/0x120 drivers/base/dd.c:782 [] __device_attach_driver+0xf6/0x140 drivers/base/dd.c:899 [] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:427 [] __device_attach+0x122/0x260 drivers/base/dd.c:970 [] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:487 [] device_add+0x5fb/0xdf0 drivers/base/core.c:3405 [] usb_set_configuration+0x8f2/0xb80 drivers/usb/core/message.c:2170 [] usb_generic_driver_probe+0x8c/0xc0 drivers/usb/core/generic.c:238 [] usb_probe_device+0x5c/0x140 drivers/usb/core/driver.c:293 [] call_driver_probe drivers/base/dd.c:542 [inline] [] really_probe.part.0+0xe7/0x310 drivers/base/dd.c:621 [] really_probe drivers/base/dd.c:583 [inline] [] __driver_probe_device+0x10c/0x1e0 drivers/base/dd.c:752 The Linux kernel CVE team has assigned CVE-2022-50626 to this issue. Affected and fixed versions =========================== Fixed in 4.9.337 with commit 733bc9e226da2a7f43b10031b8ebfc26d89ec4bd Fixed in 4.14.303 with commit e5a49140035591d13ff57a7537c65217e5af0d15 Fixed in 4.19.270 with commit 21b6b0c9f3796e6917e90db403dae9e74025fc40 Fixed in 5.4.229 with commit 17217737c174883dd975885ab4bee4b00f517239 Fixed in 5.10.163 with commit 7d7ab25ead969594df05fb09ee46ca931d46c5c8 Fixed in 5.15.86 with commit d0af6220bb1eed8225a5511de5a3bd386b94afa4 Fixed in 6.0.16 with commit e5d01eb6dc2f699a395d3e731c58a9b3bb4e269f Fixed in 6.1.2 with commit 93bbf2ed428142aa9a9693721230b28571678bf8 Fixed in 6.2 with commit 94d90fb06b94a90c176270d38861bcba34ce377d Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2022-50626 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/media/usb/dvb-usb/dvb-usb-init.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/733bc9e226da2a7f43b10031b8ebfc26d89ec4bd https://git.kernel.org/stable/c/e5a49140035591d13ff57a7537c65217e5af0d15 https://git.kernel.org/stable/c/21b6b0c9f3796e6917e90db403dae9e74025fc40 https://git.kernel.org/stable/c/17217737c174883dd975885ab4bee4b00f517239 https://git.kernel.org/stable/c/7d7ab25ead969594df05fb09ee46ca931d46c5c8 https://git.kernel.org/stable/c/d0af6220bb1eed8225a5511de5a3bd386b94afa4 https://git.kernel.org/stable/c/e5d01eb6dc2f699a395d3e731c58a9b3bb4e269f https://git.kernel.org/stable/c/93bbf2ed428142aa9a9693721230b28571678bf8 https://git.kernel.org/stable/c/94d90fb06b94a90c176270d38861bcba34ce377d