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 92D9133DEF7 for ; Wed, 24 Dec 2025 13:09:26 +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=1766581766; cv=none; b=RTKZ/7K7ZqvzE6XXhgGg/bMSremxqW78siZbKLTeByzMdfCKhSN0iQd3Wte2JQlfNPnlR3KIjlpWxoEeoF4AI8PF3hT87bpND+wjn9lDQuEjC7kM0GzXT0sbcDJoE47DFZk6rr/tpYNrNZhlaU+JMUICOXL09Q98ig6GCz0A33M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766581766; c=relaxed/simple; bh=bAkl5K1xDgzISF6gDHCv25HZrWVVHi/X8t/7BTw+ves=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=dEslDSdqaSld7au6uKiAiPQ45xHylYPiOKwIBc5d9TDf7d/ALSLHHCGK7/lWzMxU497dux+jQqIBG/WIjkWakvhy8traQtZQoYjbTeI1VEMvaPY2Zdx3OKH4ym5oFiLnmbmdaSXMLOChQ9Ccf9WBgF4WuLN/rlS5Qmp9OuJZkiM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=aJF63nFu; 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="aJF63nFu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18A9CC4CEFB; Wed, 24 Dec 2025 13:09:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1766581766; bh=bAkl5K1xDgzISF6gDHCv25HZrWVVHi/X8t/7BTw+ves=; h=From:To:Cc:Subject:Date:Reply-To:From; b=aJF63nFucuRoiXQGBfhza02ik/FN/S+ckN29yxwHuAluRVZFi1ICMoMnNx0pyDlvm OOMmPpJCGwq18LOn/OKIUdb5vK+DErwfCdn9gpVVeW+x6TQGtKWemdgACwmicOB28o XVLwV8vfRYaimDRGtqU173B1J3RPvZsgvaT7pjzU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50772: netdevsim: fix memory leak in nsim_bus_dev_new() Date: Wed, 24 Dec 2025 14:06:23 +0100 Message-ID: <2025122458-CVE-2022-50772-774d@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=2896; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=smVBhkzcp1I+5HuB3TrONG/rcIGpqR6R1FQM/yRiYAQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDJneT82lTpZYLgz7u/jRiycv2+dy73BqXbx9wra9EYddB ZjkFB8adcSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEcuYxzBVZu2HL5nveJUcO rjdWfikx20X7/WeG+UH972a2778287/zo2B98xNJxZlhEgA= 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: netdevsim: fix memory leak in nsim_bus_dev_new() If device_register() failed in nsim_bus_dev_new(), the value of reference in nsim_bus_dev->dev is 1. obj->name in nsim_bus_dev->dev will not be released. unreferenced object 0xffff88810352c480 (size 16): comm "echo", pid 5691, jiffies 4294945921 (age 133.270s) hex dump (first 16 bytes): 6e 65 74 64 65 76 73 69 6d 31 00 00 00 00 00 00 netdevsim1...... backtrace: [<000000005e2e5e26>] __kmalloc_node_track_caller+0x3a/0xb0 [<0000000094ca4fc8>] kvasprintf+0xc3/0x160 [<00000000aad09bcc>] kvasprintf_const+0x55/0x180 [<000000009bac868d>] kobject_set_name_vargs+0x56/0x150 [<000000007c1a5d70>] dev_set_name+0xbb/0xf0 [<00000000ad0d126b>] device_add+0x1f8/0x1cb0 [<00000000c222ae24>] new_device_store+0x3b6/0x5e0 [<0000000043593421>] bus_attr_store+0x72/0xa0 [<00000000cbb1833a>] sysfs_kf_write+0x106/0x160 [<00000000d0dedb8a>] kernfs_fop_write_iter+0x3a8/0x5a0 [<00000000770b66e2>] vfs_write+0x8f0/0xc80 [<0000000078bb39be>] ksys_write+0x106/0x210 [<00000000005e55a4>] do_syscall_64+0x35/0x80 [<00000000eaa40bbc>] entry_SYSCALL_64_after_hwframe+0x46/0xb0 The Linux kernel CVE team has assigned CVE-2022-50772 to this issue. Affected and fixed versions =========================== Issue introduced in 5.2 with commit 40e4fe4ce115c409c3e2fbb247085103ef1cc755 and fixed in 6.0.7 with commit 77579e4065295071fbd9662f03430dca5b50b086 Issue introduced in 5.2 with commit 40e4fe4ce115c409c3e2fbb247085103ef1cc755 and fixed in 6.1 with commit cf2010aa1c739bab067cbc90b690d28eaa0b47da 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-50772 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/net/netdevsim/bus.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/77579e4065295071fbd9662f03430dca5b50b086 https://git.kernel.org/stable/c/cf2010aa1c739bab067cbc90b690d28eaa0b47da