diff options
| author | Kai Kang <kai.kang@windriver.com> | 2025-12-17 16:14:32 +0800 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-12-31 07:24:54 -0800 |
| commit | cde4ddcfd1659b06ef4703ff7656f4d6738aaf8a (patch) | |
| tree | acb356b84322cea70ea6812524c168f833cb0c48 /meta/recipes-devtools | |
| parent | 0183740845d9142fda9769e3d8cbb3b4e0c3a079 (diff) | |
| download | poky-cde4ddcfd1659b06ef4703ff7656f4d6738aaf8a.tar.gz | |
qemu: fix CVE-2025-12464
Backport patch to fix CVE-2025-12464.
Reference: https://gitlab.com/qemu-project/qemu/-/commit/a01344d9d7
(From OE-Core rev: 7ef40090719cab3fb9bda3f87a9d700d9b503e3e)
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-devtools')
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu/CVE-2025-12464.patch | 70 |
2 files changed, 71 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index fd1a8647df..2866cbe7ec 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
| @@ -129,6 +129,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
| 129 | file://CVE-2024-3446-0006.patch \ | 129 | file://CVE-2024-3446-0006.patch \ |
| 130 | file://CVE-2024-3447.patch \ | 130 | file://CVE-2024-3447.patch \ |
| 131 | file://CVE-2024-8354.patch \ | 131 | file://CVE-2024-8354.patch \ |
| 132 | file://CVE-2025-12464.patch \ | ||
| 132 | " | 133 | " |
| 133 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | 134 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" |
| 134 | 135 | ||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2025-12464.patch b/meta/recipes-devtools/qemu/qemu/CVE-2025-12464.patch new file mode 100644 index 0000000000..6099fc79cd --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2025-12464.patch | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | From a01344d9d78089e9e585faaeb19afccff2050abf Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Peter Maydell <peter.maydell@linaro.org> | ||
| 3 | Date: Tue, 28 Oct 2025 16:00:42 +0000 | ||
| 4 | Subject: [PATCH] net: pad packets to minimum length in qemu_receive_packet() | ||
| 5 | |||
| 6 | In commits like 969e50b61a28 ("net: Pad short frames to minimum size | ||
| 7 | before sending from SLiRP/TAP") we switched away from requiring | ||
| 8 | network devices to handle short frames to instead having the net core | ||
| 9 | code do the padding of short frames out to the ETH_ZLEN minimum size. | ||
| 10 | We then dropped the code for handling short frames from the network | ||
| 11 | devices in a series of commits like 140eae9c8f7 ("hw/net: e1000: | ||
| 12 | Remove the logic of padding short frames in the receive path"). | ||
| 13 | |||
| 14 | This missed one route where the device's receive code can still see a | ||
| 15 | short frame: if the device is in loopback mode and it transmits a | ||
| 16 | short frame via the qemu_receive_packet() function, this will be fed | ||
| 17 | back into its own receive code without being padded. | ||
| 18 | |||
| 19 | Add the padding logic to qemu_receive_packet(). | ||
| 20 | |||
| 21 | This fixes a buffer overrun which can be triggered in the | ||
| 22 | e1000_receive_iov() logic via the loopback code path. | ||
| 23 | |||
| 24 | Other devices that use qemu_receive_packet() to implement loopback | ||
| 25 | are cadence_gem, dp8393x, lan9118, msf2-emac, pcnet, rtl8139 | ||
| 26 | and sungem. | ||
| 27 | |||
| 28 | Cc: qemu-stable@nongnu.org | ||
| 29 | Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3043 | ||
| 30 | Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> | ||
| 31 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
| 32 | Signed-off-by: Jason Wang <jasowang@redhat.com> | ||
| 33 | |||
| 34 | CVE: CVE-2025-12464 | ||
| 35 | |||
| 36 | Upstream-Status: Backport [https://gitlab.com/qemu-project/qemu/-/commit/a01344d9d7] | ||
| 37 | |||
| 38 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
| 39 | --- | ||
| 40 | net/net.c | 10 ++++++++++ | ||
| 41 | 1 file changed, 10 insertions(+) | ||
| 42 | |||
| 43 | diff --git a/net/net.c b/net/net.c | ||
| 44 | index 27e0d27807..8aefdb3424 100644 | ||
| 45 | --- a/net/net.c | ||
| 46 | +++ b/net/net.c | ||
| 47 | @@ -775,10 +775,20 @@ ssize_t qemu_send_packet(NetClientState *nc, const uint8_t *buf, int size) | ||
| 48 | |||
| 49 | ssize_t qemu_receive_packet(NetClientState *nc, const uint8_t *buf, int size) | ||
| 50 | { | ||
| 51 | + uint8_t min_pkt[ETH_ZLEN]; | ||
| 52 | + size_t min_pktsz = sizeof(min_pkt); | ||
| 53 | + | ||
| 54 | if (!qemu_can_receive_packet(nc)) { | ||
| 55 | return 0; | ||
| 56 | } | ||
| 57 | |||
| 58 | + if (net_peer_needs_padding(nc)) { | ||
| 59 | + if (eth_pad_short_frame(min_pkt, &min_pktsz, buf, size)) { | ||
| 60 | + buf = min_pkt; | ||
| 61 | + size = min_pktsz; | ||
| 62 | + } | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | return qemu_net_queue_receive(nc->incoming_queue, buf, size); | ||
| 66 | } | ||
| 67 | |||
| 68 | -- | ||
| 69 | 2.47.1 | ||
| 70 | |||
