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 356261DC99C for ; Thu, 1 May 2025 14:14:45 +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=1746108886; cv=none; b=XEonihIExN/pYjmxcrrTZCEx1K6Fn3OedryG//XZ98mFdm8ExA6PolpR6q710M9PtTDIvBYdHIt80HTIR/s81XP7ivrOiwrDtCnAhvlGsf9RBFg94PPpb6pHzBWhnLKDlW59+C1iY7fL9yTgcbTeqL3GkxH71MtQ6FtxLEX5ekc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746108886; c=relaxed/simple; bh=lu/F0Ie3rUG9bk4QA5ZKJmjbndfQqaw4quFGj8Ug4gw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=YUMLa3vOWsbCf0iLslPWM2BJRe2QvVmNgBnTR3nMferIjoKIU4XtT4EvWNSrSVbUUVL3qMl3TvWLFP+6arQI3hdfCYuD83NdVRFItyjDnZwAyiZDilWqnvrr8RTY2F5IkTpP6fHXRjTgKtC/sR+wD1uxVz/R07OP0C/RCqKyJWU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rT0kaKdS; 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="rT0kaKdS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F2C5C4CEE3; Thu, 1 May 2025 14:14:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746108885; bh=lu/F0Ie3rUG9bk4QA5ZKJmjbndfQqaw4quFGj8Ug4gw=; h=From:To:Cc:Subject:Date:Reply-to:From; b=rT0kaKdSrJOMkGcGABACmXqwrR+v6QydB5P0coS4t9V6OnkfeoFlb/5/+GvH7thwi i+RloZu8z9K3exytQrGhj6hFLF0KRdm+l5n8aJ5o1r3i9/sBSw7cH8EWK4/oozT1Ls NXtv0pJTACRzIdMuOp1YXsGRjVSgpo4y6zdiM97E= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49803: netdevsim: Fix memory leak of nsim_dev->fa_cookie Date: Thu, 1 May 2025 16:09:53 +0200 Message-ID: <2025050127-CVE-2022-49803-38e4@gregkh> X-Mailer: git-send-email 2.49.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=2695; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=7f1pv9b5990RrGbNvlFWFE4NFcIn3IermmuiiZf/eYQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnCDdMVlBUr3lfaxHp+NrPXWWG06cJs9/UZZ8+90vuqe VEmWYmtI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACbCbMQwT/2pcl2zSbWqft8z nQeSh796ntosy7Dg6G2vQ2/PpJmXB15f9HqCYsrtSglmAA== 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 of nsim_dev->fa_cookie kmemleak reports this issue: unreferenced object 0xffff8881bac872d0 (size 8): comm "sh", pid 58603, jiffies 4481524462 (age 68.065s) hex dump (first 8 bytes): 04 00 00 00 de ad be ef ........ backtrace: [<00000000c80b8577>] __kmalloc+0x49/0x150 [<000000005292b8c6>] nsim_dev_trap_fa_cookie_write+0xc1/0x210 [netdevsim] [<0000000093d78e77>] full_proxy_write+0xf3/0x180 [<000000005a662c16>] vfs_write+0x1c5/0xaf0 [<000000007aabf84a>] ksys_write+0xed/0x1c0 [<000000005f1d2e47>] do_syscall_64+0x3b/0x90 [<000000006001c6ec>] entry_SYSCALL_64_after_hwframe+0x63/0xcd The issue occurs in the following scenarios: nsim_dev_trap_fa_cookie_write() kmalloc() fa_cookie nsim_dev->fa_cookie = fa_cookie .. nsim_drv_remove() The fa_cookie allocked in nsim_dev_trap_fa_cookie_write() is not freed. To fix, add kfree(nsim_dev->fa_cookie) to nsim_drv_remove(). The Linux kernel CVE team has assigned CVE-2022-49803 to this issue. Affected and fixed versions =========================== Issue introduced in 5.7 with commit d3cbb907ae57fe5da314b51d949b617b538bdeae and fixed in 6.0.10 with commit 207edad5717e0a5709ce8467f0eff41c607835c9 Issue introduced in 5.7 with commit d3cbb907ae57fe5da314b51d949b617b538bdeae and fixed in 6.1 with commit 064bc7312bd09a48798418663090be0c776183db 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-49803 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/207edad5717e0a5709ce8467f0eff41c607835c9 https://git.kernel.org/stable/c/064bc7312bd09a48798418663090be0c776183db