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 3FDC830DEBD for ; Tue, 13 Jan 2026 15:31:54 +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=1768318314; cv=none; b=WoErZJgP6MbLbAjmoBcOc31yBU5t1j+TgdY2pt3DxiTyD6NCvmI4uicn8rpFzHvA0AGULzqLOuHTzn89NENNwS5co2lz9URtM1mx8TaMiO3XfSfnHWVYIwFedPMONVGarNMiXMyNvmFV4R9YQDXZWV8gCs/ZWDzCn9DADPqvxxY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768318314; c=relaxed/simple; bh=6UzssYhjP/kYX1qwfqTUqy0eOl4YLRmqJdG74uWYbmk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Lckk2EONrBxhOEynfis8nzqqFUqij17XGvpzJ3GwCL0Hm73S2mmVuZWjnYOW2EV32C1hd1gx4J1oz6lML3IC7dKVGyWCIfMjIGDQW5pzFfWhZIx407bzmLTkfYPj9opJZB39UtArgw+JsMVENVqOALAOxT1WTNnoN2PIMKbI8k0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Bl+9OnmH; 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="Bl+9OnmH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C593EC116C6; Tue, 13 Jan 2026 15:31:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1768318314; bh=6UzssYhjP/kYX1qwfqTUqy0eOl4YLRmqJdG74uWYbmk=; h=From:To:Cc:Subject:Date:Reply-To:From; b=Bl+9OnmHPo4muMfJI5zy2Fs423f2JoKUKdhlFesOFcEeFw+dPqV5YBzvWTXweDS8w 1V6WFUkC8MpfndwWGkbSVYi6Hm6uOJwOArtaeGomemtCs5s7VDJU2m16kcw/MaOplC sBfuNt8+SFBed+lUpx/ol8bv8dJbQwtUQbNzIltc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-68785: net: openvswitch: fix middle attribute validation in push_nsh() action Date: Tue, 13 Jan 2026 16:29:11 +0100 Message-ID: <2026011302-CVE-2025-68785-c96c@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=4732; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=9KjJvV5QOcxZkM7Q/fXeDdsHtp90xfC+Zw4ep9qHkXY=; b=owGbwMvMwCRo6H6F97bub03G02pJDJlpKfsY5txn/6kzfcXDFaG9/6evD+kSjs+6fyTHTvpTh HfxEeGcjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE9gQLk4BmEhGDcOC1XGsxh4FB3M0La53 hxTn73RQ0GRgmCuzV609QXfDxO5qtwdeusKWnmrPawA= 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: net: openvswitch: fix middle attribute validation in push_nsh() action The push_nsh() action structure looks like this: OVS_ACTION_ATTR_PUSH_NSH(OVS_KEY_ATTR_NSH(OVS_NSH_KEY_ATTR_BASE,...)) The outermost OVS_ACTION_ATTR_PUSH_NSH attribute is OK'ed by the nla_for_each_nested() inside __ovs_nla_copy_actions(). The innermost OVS_NSH_KEY_ATTR_BASE/MD1/MD2 are OK'ed by the nla_for_each_nested() inside nsh_key_put_from_nlattr(). But nothing checks if the attribute in the middle is OK. We don't even check that this attribute is the OVS_KEY_ATTR_NSH. We just do a double unwrap with a pair of nla_data() calls - first time directly while calling validate_push_nsh() and the second time as part of the nla_for_each_nested() macro, which isn't safe, potentially causing invalid memory access if the size of this attribute is incorrect. The failure may not be noticed during validation due to larger netlink buffer, but cause trouble later during action execution where the buffer is allocated exactly to the size: BUG: KASAN: slab-out-of-bounds in nsh_hdr_from_nlattr+0x1dd/0x6a0 [openvswitch] Read of size 184 at addr ffff88816459a634 by task a.out/22624 CPU: 8 UID: 0 PID: 22624 6.18.0-rc7+ #115 PREEMPT(voluntary) Call Trace: dump_stack_lvl+0x51/0x70 print_address_description.constprop.0+0x2c/0x390 kasan_report+0xdd/0x110 kasan_check_range+0x35/0x1b0 __asan_memcpy+0x20/0x60 nsh_hdr_from_nlattr+0x1dd/0x6a0 [openvswitch] push_nsh+0x82/0x120 [openvswitch] do_execute_actions+0x1405/0x2840 [openvswitch] ovs_execute_actions+0xd5/0x3b0 [openvswitch] ovs_packet_cmd_execute+0x949/0xdb0 [openvswitch] genl_family_rcv_msg_doit+0x1d6/0x2b0 genl_family_rcv_msg+0x336/0x580 genl_rcv_msg+0x9f/0x130 netlink_rcv_skb+0x11f/0x370 genl_rcv+0x24/0x40 netlink_unicast+0x73e/0xaa0 netlink_sendmsg+0x744/0xbf0 __sys_sendto+0x3d6/0x450 do_syscall_64+0x79/0x2c0 entry_SYSCALL_64_after_hwframe+0x76/0x7e Let's add some checks that the attribute is properly sized and it's the only one attribute inside the action. Technically, there is no real reason for OVS_KEY_ATTR_NSH to be there, as we know that we're pushing an NSH header already, it just creates extra nesting, but that's how uAPI works today. So, keeping as it is. The Linux kernel CVE team has assigned CVE-2025-68785 to this issue. Affected and fixed versions =========================== Issue introduced in 4.15 with commit b2d0f5d5dc53532e6f07bc546a476a55ebdfe0f3 and fixed in 6.1.160 with commit 1b569db9c2f28b599e40050524aae5f7332bc294 Issue introduced in 4.15 with commit b2d0f5d5dc53532e6f07bc546a476a55ebdfe0f3 and fixed in 6.6.120 with commit 10ffc558246f2c75619aedda0921906095e46702 Issue introduced in 4.15 with commit b2d0f5d5dc53532e6f07bc546a476a55ebdfe0f3 and fixed in 6.12.64 with commit 2ecfc4433acdb149eafd7fb22d7fd4adf90b25e9 Issue introduced in 4.15 with commit b2d0f5d5dc53532e6f07bc546a476a55ebdfe0f3 and fixed in 6.18.3 with commit c999153bfb2d1d9b295b7010d920f2a7c6d7595f Issue introduced in 4.15 with commit b2d0f5d5dc53532e6f07bc546a476a55ebdfe0f3 and fixed in 6.19-rc2 with commit 5ace7ef87f059d68b5f50837ef3e8a1a4870c36e 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-2025-68785 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/flow_netlink.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/1b569db9c2f28b599e40050524aae5f7332bc294 https://git.kernel.org/stable/c/10ffc558246f2c75619aedda0921906095e46702 https://git.kernel.org/stable/c/2ecfc4433acdb149eafd7fb22d7fd4adf90b25e9 https://git.kernel.org/stable/c/c999153bfb2d1d9b295b7010d920f2a7c6d7595f https://git.kernel.org/stable/c/5ace7ef87f059d68b5f50837ef3e8a1a4870c36e