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 3ED0F43172 for ; Wed, 18 Jun 2025 11:02:32 +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=1750244553; cv=none; b=C60S7cdEyCKHoTXArwAxje/Lainnvv+r+tkp139F9XsSbv+PMcp1gTCAWxWOT10lNssViUlQmFLjD9jSCYk+F6tbsKu1qqQnGitTSaSeb3SzrHy+mi9FkFg2MA62GIGmpFKS6iY6cUXn1Bm3QHUxLY6WVogegBh9I+dt1UJOt8g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750244553; c=relaxed/simple; bh=nXYkuXxNnUGwxERTKypFykd+VIuDP8fQaU4yLVPJS7g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=LfSdPYPEuATl/71mqpzWPUy6ObQ53Plnj2bctoFIB44IWgho3AyyVXNKciKj0OP0AP+3/JOc5EPuf1RelivcRSyssiTfzYDlo+iwT75OMOzambMEapNqO5nkUjPkmcVXtRy2+yjXTEwEvUvHDeZhtdeMBiEoehLsj2ektHKgwKQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=UGrCvhFn; 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="UGrCvhFn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79FD9C4CEE7; Wed, 18 Jun 2025 11:02:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750244552; bh=nXYkuXxNnUGwxERTKypFykd+VIuDP8fQaU4yLVPJS7g=; h=From:To:Cc:Subject:Date:Reply-to:From; b=UGrCvhFnQMH58vgpYjl1zdCuDoXjc2Y9mhGSobiC4vPj+8mWa9y2I5CKnAAxSuUlU C9mR0FWqL0NlDIxr7MnTWdr689SXzZEV2QGTNIwmY9KSzb8uOSZ2I3HzTwvJ2l+e1l E8GDsADkZW+qpjloI03pnNcWqmuMkkTHDZOf7INY= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49959: openvswitch: fix memory leak at failed datapath creation Date: Wed, 18 Jun 2025 13:00:24 +0200 Message-ID: <2025061813-CVE-2022-49959-d2b7@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=3330; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=bQfeIEFxWJq3Kejg3ydsvTv1zZMe188kwGfx7SdORac=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlBc2zDfZK+nHgVaVg4OUeSf06wWJq08gyPfxuEN0+uv DFJ8tzRjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIrgyGeeazDbWOLJvRft3i wIcNKtLMKyMYchgWbJz8vL7v1LoLPDc+r1nqqNl5zGW7FAA= 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: openvswitch: fix memory leak at failed datapath creation ovs_dp_cmd_new()->ovs_dp_change()->ovs_dp_set_upcall_portids() allocates array via kmalloc. If for some reason new_vport() fails during ovs_dp_cmd_new() dp->upcall_portids must be freed. Add missing kfree. Kmemleak example: unreferenced object 0xffff88800c382500 (size 64): comm "dump_state", pid 323, jiffies 4294955418 (age 104.347s) hex dump (first 32 bytes): 5e c2 79 e4 1f 7a 38 c7 09 21 38 0c 80 88 ff ff ^.y..z8..!8..... 03 00 00 00 0a 00 00 00 14 00 00 00 28 00 00 00 ............(... backtrace: [<0000000071bebc9f>] ovs_dp_set_upcall_portids+0x38/0xa0 [<000000000187d8bd>] ovs_dp_change+0x63/0xe0 [<000000002397e446>] ovs_dp_cmd_new+0x1f0/0x380 [<00000000aa06f36e>] genl_family_rcv_msg_doit+0xea/0x150 [<000000008f583bc4>] genl_rcv_msg+0xdc/0x1e0 [<00000000fa10e377>] netlink_rcv_skb+0x50/0x100 [<000000004959cece>] genl_rcv+0x24/0x40 [<000000004699ac7f>] netlink_unicast+0x23e/0x360 [<00000000c153573e>] netlink_sendmsg+0x24e/0x4b0 [<000000006f4aa380>] sock_sendmsg+0x62/0x70 [<00000000d0068654>] ____sys_sendmsg+0x230/0x270 [<0000000012dacf7d>] ___sys_sendmsg+0x88/0xd0 [<0000000011776020>] __sys_sendmsg+0x59/0xa0 [<000000002e8f2dc1>] do_syscall_64+0x3b/0x90 [<000000003243e7cb>] entry_SYSCALL_64_after_hwframe+0x63/0xcd The Linux kernel CVE team has assigned CVE-2022-49959 to this issue. Affected and fixed versions =========================== Issue introduced in 5.15 with commit b83d23a2a38b1770da0491257ae81d52307f7816 and fixed in 5.15.66 with commit ca54b2bfaab385778e55a9fd33f6c31e7f743b48 Issue introduced in 5.15 with commit b83d23a2a38b1770da0491257ae81d52307f7816 and fixed in 5.19.8 with commit c0c1c0241917459644326a1a3102207c871ae159 Issue introduced in 5.15 with commit b83d23a2a38b1770da0491257ae81d52307f7816 and fixed in 6.0 with commit a87406f4adee9c53b311d8a1ba2849c69e29a6d0 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-49959 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: net/openvswitch/datapath.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/ca54b2bfaab385778e55a9fd33f6c31e7f743b48 https://git.kernel.org/stable/c/c0c1c0241917459644326a1a3102207c871ae159 https://git.kernel.org/stable/c/a87406f4adee9c53b311d8a1ba2849c69e29a6d0