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 99A08316185 for ; Wed, 24 Dec 2025 10:57:20 +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=1766573840; cv=none; b=X3cXUU9n1ungidjo8SWJyn2EpESL5y3KvN60M+WYsAGtQ8b0U9PisYAlyxgNJJzyFleNdVqR42xWP4PZHPA0ds9mi1+AM5yeGabBc5CkjvptUTc8jTWZE00EOkfUR5CzauVo+Lsqorgs0mC7148jAYOAQRavL16uGMQkiOgPetw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766573840; c=relaxed/simple; bh=fpxfN1SBW9+BtZqMJIagXNIvDSDdi1SreUvNyfLW5F4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=uhqPWlLvq7YpZ/2k2iuyKT0+MlyVmwHQ+o9TcQksQa3W4U2MgR7xBB4Bu/VLlSskKjVdi5zii5nomOFzNmccXZ31+5A2Nr6+T8sqQyfH8M+Kt3KvQp696+VtzRNsyxJMhRANXeXKNbWfnLWa9V015snow7/gTMjP6c7HFJxR+so= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=psp+A3jp; 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="psp+A3jp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC6A6C4CEFB; Wed, 24 Dec 2025 10:57:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1766573840; bh=fpxfN1SBW9+BtZqMJIagXNIvDSDdi1SreUvNyfLW5F4=; h=From:To:Cc:Subject:Date:Reply-To:From; b=psp+A3jpbQsFdZCiV7iU703ORt07OykO/2wIWIkijmyhrRLLndd8l+k5ySUs1EslI nZGqgU0jBywHwEaJwvnfpCzIA3kFDGdjeCYfRzS77VGtA0vW0CAaC6c3a14+qPpX4K lUNYPQlz6wYFpJuEhbvj9Affnzqn55TvDzgR1wYo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50702: vdpa_sim: fix possible memory leak in vdpasim_net_init() and vdpasim_blk_init() Date: Wed, 24 Dec 2025 11:56:19 +0100 Message-ID: <2025122418-CVE-2022-50702-c339@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=4390; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=JfGHuydA1ZJopugkJsmtyTxNWlmQd8We/l+VI9/G9ds=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnexy7HqrGWz26/kHCi6ITku5c5soc/X2petOHK0RN/F gnU/NK60xHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQAT8frEsOCSu4VrCL+z5uXN 2UXTfHks5mo9uMCwYPYb8fLkqB0hmrXh1X8f1e3+vWrZNwA= 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: vdpa_sim: fix possible memory leak in vdpasim_net_init() and vdpasim_blk_init() Inject fault while probing module, if device_register() fails in vdpasim_net_init() or vdpasim_blk_init(), but the refcount of kobject is not decreased to 0, the name allocated in dev_set_name() is leaked. Fix this by calling put_device(), so that name can be freed in callback function kobject_cleanup(). (vdpa_sim_net) unreferenced object 0xffff88807eebc370 (size 16): comm "modprobe", pid 3848, jiffies 4362982860 (age 18.153s) hex dump (first 16 bytes): 76 64 70 61 73 69 6d 5f 6e 65 74 00 6b 6b 6b a5 vdpasim_net.kkk. backtrace: [] __kmalloc_node_track_caller+0x4e/0x150 [] kstrdup+0x33/0x60 [] kobject_set_name_vargs+0x41/0x110 [] dev_set_name+0xab/0xe0 [] device_add+0xe3/0x1a80 [] 0xffffffffa0270013 [] do_one_initcall+0x87/0x2e0 [] do_init_module+0x1ab/0x640 [] load_module+0x5d00/0x77f0 [] __do_sys_finit_module+0x110/0x1b0 [] do_syscall_64+0x35/0x80 [] entry_SYSCALL_64_after_hwframe+0x46/0xb0 (vdpa_sim_blk) unreferenced object 0xffff8881070c1250 (size 16): comm "modprobe", pid 6844, jiffies 4364069319 (age 17.572s) hex dump (first 16 bytes): 76 64 70 61 73 69 6d 5f 62 6c 6b 00 6b 6b 6b a5 vdpasim_blk.kkk. backtrace: [] __kmalloc_node_track_caller+0x4e/0x150 [] kstrdup+0x33/0x60 [] kobject_set_name_vargs+0x41/0x110 [] dev_set_name+0xab/0xe0 [] device_add+0xe3/0x1a80 [] 0xffffffffa0220013 [] do_one_initcall+0x87/0x2e0 [] do_init_module+0x1ab/0x640 [] load_module+0x5d00/0x77f0 [] __do_sys_finit_module+0x110/0x1b0 [] do_syscall_64+0x35/0x80 [] entry_SYSCALL_64_after_hwframe+0x46/0xb0 The Linux kernel CVE team has assigned CVE-2022-50702 to this issue. Affected and fixed versions =========================== Issue introduced in 5.12 with commit a3c06ae158dd6fa8336157c31d9234689d068d02 and fixed in 5.15.87 with commit 586e6fd7d581f987f7d0d2592edf0b26397e783e Issue introduced in 5.12 with commit a3c06ae158dd6fa8336157c31d9234689d068d02 and fixed in 6.0.19 with commit 5be953e353fe421f2983e1fd37f07fba97edbffc Issue introduced in 5.12 with commit a3c06ae158dd6fa8336157c31d9234689d068d02 and fixed in 6.1.5 with commit 337c24d817e28dd454ca22f1063dfad20822426e Issue introduced in 5.12 with commit a3c06ae158dd6fa8336157c31d9234689d068d02 and fixed in 6.2 with commit aeca7ff254843d49a8739f07f7dab1341450111d 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-50702 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/vdpa/vdpa_sim/vdpa_sim_blk.c drivers/vdpa/vdpa_sim/vdpa_sim_net.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/586e6fd7d581f987f7d0d2592edf0b26397e783e https://git.kernel.org/stable/c/5be953e353fe421f2983e1fd37f07fba97edbffc https://git.kernel.org/stable/c/337c24d817e28dd454ca22f1063dfad20822426e https://git.kernel.org/stable/c/aeca7ff254843d49a8739f07f7dab1341450111d