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 2E9EB20E023 for ; Sat, 4 Oct 2025 15:52:49 +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=1759593170; cv=none; b=JV2obkg87m7NX4ZF1dmvR4IY4HtPH/rfLWSAjIzAocdNms9uTspryzwpoYNGubZYyetQOpc2QCwbIBmAo6vcV7jUQHmPjQafkIeezYne404Los7WV/k3hvUyAfta9AaL00mV/10/MH8BxqOiQJw8yb0Cr9sJ27CfKsGDq5Q49Yk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759593170; c=relaxed/simple; bh=PLfKrCUHMPz6WzXZ0oXqhjOKEu7nKtEZ/HWyQIWDkLc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=f+S/t4Jt1v/MgsA3dBBrIJmqZqffT+CiQghYF473DHrwoJSSUQm/AVaSZg4tddvhACm+4yRp2FLvUYaMYkAYfgBW1A5Q48Ajpp3dXXFJmbZMrRycubys+EzJqwfX1GqmyTrfZQjCF3gk6rgsDYeiLq7/wEoLYvrw6bBb98QUu5s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=clJxDgjH; 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="clJxDgjH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CB72C4CEF1; Sat, 4 Oct 2025 15:52:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759593169; bh=PLfKrCUHMPz6WzXZ0oXqhjOKEu7nKtEZ/HWyQIWDkLc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=clJxDgjHRLCDvgGJ5mXsQ7paV3S73oMeHju8KOh8QrDaCVLNbI1s1lfNZHgtzAy+L 8CRpg4hv6gxRvHyZKS+zvzeK60lMexg5Vl9/g9sVabaN9KJR5u/Fewepn92B4woAiP jPBBll2xFs+6NakzWfFX88eC7mWNi2UEq+/VhJz0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50500: netdevsim: fix memory leak in nsim_drv_probe() when nsim_dev_resources_register() failed Date: Sat, 4 Oct 2025 17:51:25 +0200 Message-ID: <2025100420-CVE-2022-50500-787b@gregkh> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3095; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=k1YoVCZNa53u91cwWqjVraVUVFGAN5Ln9R6FNQL56GE=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkPnSomRQXHnD5+un+3pHej6MvJubumJVsVPbjf1ldzx 7H5sHpdRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzkcRHDfEeXhUqXctafaXAz 4Uo+e3lq6L8nSxgWrNm1Zz9P2q9JthUqpgVTnvoYskxeDgA= 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_drv_probe() when nsim_dev_resources_register() failed If some items in nsim_dev_resources_register() fail, memory leak will occur. The following is the memory leak information. unreferenced object 0xffff888074c02600 (size 128): comm "echo", pid 8159, jiffies 4294945184 (age 493.530s) hex dump (first 32 bytes): 40 47 ea 89 ff ff ff ff 01 00 00 00 00 00 00 00 @G.............. ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ backtrace: [<0000000011a31c98>] kmalloc_trace+0x22/0x60 [<0000000027384c69>] devl_resource_register+0x144/0x4e0 [<00000000a16db248>] nsim_drv_probe+0x37a/0x1260 [<000000007d1f448c>] really_probe+0x20b/0xb10 [<00000000c416848a>] __driver_probe_device+0x1b3/0x4a0 [<00000000077e0351>] driver_probe_device+0x49/0x140 [<0000000054f2465a>] __device_attach_driver+0x18c/0x2a0 [<000000008538f359>] bus_for_each_drv+0x151/0x1d0 [<0000000038e09747>] __device_attach+0x1c9/0x4e0 [<00000000dd86e533>] bus_probe_device+0x1d5/0x280 [<00000000839bea35>] device_add+0xae0/0x1cb0 [<000000009c2abf46>] new_device_store+0x3b6/0x5f0 [<00000000fb823d7f>] bus_attr_store+0x72/0xa0 [<000000007acc4295>] sysfs_kf_write+0x106/0x160 [<000000005f50cb4d>] kernfs_fop_write_iter+0x3a8/0x5a0 [<0000000075eb41bf>] vfs_write+0x8f0/0xc80 The Linux kernel CVE team has assigned CVE-2022-50500 to this issue. Affected and fixed versions =========================== Issue introduced in 4.17 with commit 37923ed6b8cea94d7d76038e2f72c57a0b45daab and fixed in 6.0.7 with commit 7c4957fe40e2a628b7cceaf4c9bfb5b701774d05 Issue introduced in 4.17 with commit 37923ed6b8cea94d7d76038e2f72c57a0b45daab and fixed in 6.1 with commit 6b1da9f7126f05e857da6db24c6a04aa7974d644 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-50500 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/dev.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/7c4957fe40e2a628b7cceaf4c9bfb5b701774d05 https://git.kernel.org/stable/c/6b1da9f7126f05e857da6db24c6a04aa7974d644