diff options
| author | Peter Marko <peter.marko@siemens.com> | 2025-10-11 23:39:51 +0200 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-10-17 07:27:23 -0700 |
| commit | 2952d99f0f777bf337c45ca1499eff04925a5e85 (patch) | |
| tree | 991f93f0ce4d1e1f7cb56aec7192d1df818e0019 /meta/recipes-devtools | |
| parent | 962d08fb4077f44a1d2b6d6c6d29a466adebeb85 (diff) | |
| download | poky-2952d99f0f777bf337c45ca1499eff04925a5e85.tar.gz | |
qemu: patch CVE-2024-8354
Pick commit per [1].
(From OE-Core rev: bebd1b24473e3480ae6c4ae2897fbfdf4942ea11)
Signed-off-by: Peter Marko <peter.marko@siemens.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-2024-8354.patch | 75 |
2 files changed, 76 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index 1298514cd7..fd1a8647df 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
| @@ -128,6 +128,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
| 128 | file://CVE-2024-3446-0005.patch \ | 128 | file://CVE-2024-3446-0005.patch \ |
| 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 | " | 132 | " |
| 132 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | 133 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" |
| 133 | 134 | ||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2024-8354.patch b/meta/recipes-devtools/qemu/qemu/CVE-2024-8354.patch new file mode 100644 index 0000000000..c469dcabb4 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2024-8354.patch | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | From 746269eaae16423572ae7c0dfeb66140fa882149 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Peter Maydell <peter.maydell@linaro.org> | ||
| 3 | Date: Mon, 15 Sep 2025 14:29:10 +0100 | ||
| 4 | Subject: [PATCH] hw/usb/hcd-uhci: don't assert for SETUP to non-0 endpoint | ||
| 5 | |||
| 6 | If the guest feeds invalid data to the UHCI controller, we | ||
| 7 | can assert: | ||
| 8 | qemu-system-x86_64: ../../hw/usb/core.c:744: usb_ep_get: Assertion `pid == USB_TOKEN_IN || pid == USB_TOKEN_OUT' failed. | ||
| 9 | |||
| 10 | (see issue 2548 for the repro case). This happens because the guest | ||
| 11 | attempts USB_TOKEN_SETUP to an endpoint other than 0, which is not | ||
| 12 | valid. The controller code doesn't catch this guest error, so | ||
| 13 | instead we hit the assertion in the USB core code. | ||
| 14 | |||
| 15 | Catch the case of SETUP to non-zero endpoint, and treat it as a fatal | ||
| 16 | error in the TD, in the same way we do for an invalid PID value in | ||
| 17 | the TD. | ||
| 18 | |||
| 19 | This is the UHCI equivalent of the same bug in OHCI that we fixed in | ||
| 20 | commit 3c3c233677 ("hw/usb/hcd-ohci: Fix #1510, #303: pid not IN or | ||
| 21 | OUT"). | ||
| 22 | |||
| 23 | This bug has been tracked as CVE-2024-8354. | ||
| 24 | |||
| 25 | Cc: qemu-stable@nongnu.org | ||
| 26 | Fixes: https://gitlab.com/qemu-project/qemu/-/issues/2548 | ||
| 27 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
| 28 | Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> | ||
| 29 | (cherry picked from commit d0af3cd0274e265435170a583c72b9f0a4100dff) | ||
| 30 | Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> | ||
| 31 | |||
| 32 | CVE: CVE-2024-8354 | ||
| 33 | Upstream-Status: Backport [https://gitlab.com/qemu-project/qemu/-/commit/746269eaae16423572ae7c0dfeb66140fa882149] | ||
| 34 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
| 35 | --- | ||
| 36 | hw/usb/hcd-uhci.c | 10 ++++++++-- | ||
| 37 | 1 file changed, 8 insertions(+), 2 deletions(-) | ||
| 38 | |||
| 39 | diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c | ||
| 40 | index 0561a6d801..8f4d6a0f71 100644 | ||
| 41 | --- a/hw/usb/hcd-uhci.c | ||
| 42 | +++ b/hw/usb/hcd-uhci.c | ||
| 43 | @@ -724,6 +724,7 @@ static int uhci_handle_td(UHCIState *s, UHCIQueue *q, uint32_t qh_addr, | ||
| 44 | bool spd; | ||
| 45 | bool queuing = (q != NULL); | ||
| 46 | uint8_t pid = td->token & 0xff; | ||
| 47 | + uint8_t ep_id = (td->token >> 15) & 0xf; | ||
| 48 | UHCIAsync *async; | ||
| 49 | |||
| 50 | async = uhci_async_find_td(s, td_addr); | ||
| 51 | @@ -767,9 +768,14 @@ static int uhci_handle_td(UHCIState *s, UHCIQueue *q, uint32_t qh_addr, | ||
| 52 | |||
| 53 | switch (pid) { | ||
| 54 | case USB_TOKEN_OUT: | ||
| 55 | - case USB_TOKEN_SETUP: | ||
| 56 | case USB_TOKEN_IN: | ||
| 57 | break; | ||
| 58 | + case USB_TOKEN_SETUP: | ||
| 59 | + /* SETUP is only valid to endpoint 0 */ | ||
| 60 | + if (ep_id == 0) { | ||
| 61 | + break; | ||
| 62 | + } | ||
| 63 | + /* fallthrough */ | ||
| 64 | default: | ||
| 65 | /* invalid pid : frame interrupted */ | ||
| 66 | s->status |= UHCI_STS_HCPERR; | ||
| 67 | @@ -816,7 +822,7 @@ static int uhci_handle_td(UHCIState *s, UHCIQueue *q, uint32_t qh_addr, | ||
| 68 | return uhci_handle_td_error(s, td, td_addr, USB_RET_NODEV, | ||
| 69 | int_mask); | ||
| 70 | } | ||
| 71 | - ep = usb_ep_get(dev, pid, (td->token >> 15) & 0xf); | ||
| 72 | + ep = usb_ep_get(dev, pid, ep_id); | ||
| 73 | q = uhci_queue_new(s, qh_addr, td, ep); | ||
| 74 | } | ||
| 75 | async = uhci_async_alloc(q, td_addr); | ||
