]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.1-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Apr 2026 16:48:29 +0000 (10:48 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Apr 2026 16:48:29 +0000 (10:48 -0600)
added patches:
drm-nouveau-fix-u32-overflow-in-pushbuf-reloc-bounds-check.patch
firmware-google-framebuffer-do-not-mark-framebuffer-as-busy.patch
ibmasm-fix-heap-over-read-in-ibmasm_send_i2o_message.patch
ibmasm-fix-oob-reads-in-command_file_write-due-to-missing-size-checks.patch
misc-ibmasm-fix-oob-mmio-read-in-ibmasm_handle_mouse_interrupt.patch

queue-6.1/drm-nouveau-fix-u32-overflow-in-pushbuf-reloc-bounds-check.patch [new file with mode: 0644]
queue-6.1/firmware-google-framebuffer-do-not-mark-framebuffer-as-busy.patch [new file with mode: 0644]
queue-6.1/ibmasm-fix-heap-over-read-in-ibmasm_send_i2o_message.patch [new file with mode: 0644]
queue-6.1/ibmasm-fix-oob-reads-in-command_file_write-due-to-missing-size-checks.patch [new file with mode: 0644]
queue-6.1/misc-ibmasm-fix-oob-mmio-read-in-ibmasm_handle_mouse_interrupt.patch [new file with mode: 0644]
queue-6.1/series

diff --git a/queue-6.1/drm-nouveau-fix-u32-overflow-in-pushbuf-reloc-bounds-check.patch b/queue-6.1/drm-nouveau-fix-u32-overflow-in-pushbuf-reloc-bounds-check.patch
new file mode 100644 (file)
index 0000000..4f6d471
--- /dev/null
@@ -0,0 +1,49 @@
+From 2fc87d37be1b730a149b035f9375fdb8cc5333a5 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Mon, 20 Apr 2026 21:16:09 +0200
+Subject: drm/nouveau: fix u32 overflow in pushbuf reloc bounds check
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit 2fc87d37be1b730a149b035f9375fdb8cc5333a5 upstream.
+
+nouveau_gem_pushbuf_reloc_apply() validates each relocation with
+
+    if (r->reloc_bo_offset + 4 > nvbo->bo.base.size)
+
+but reloc_bo_offset is __u32 (uapi/drm/nouveau_drm.h) and the integer
+literal 4 promotes to unsigned int, so the addition is performed in 32
+bits and wraps before the comparison against the size_t bo size.
+
+Cast to u64 so the addition happens in 64-bit arithmetic.
+
+Cc: Lyude Paul <lyude@redhat.com>
+Cc: Danilo Krummrich <dakr@kernel.org>
+Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
+Cc: Maxime Ripard <mripard@kernel.org>
+Cc: Thomas Zimmermann <tzimmermann@suse.de>
+Cc: David Airlie <airlied@gmail.com>
+Cc: Simona Vetter <simona@ffwll.ch>
+Reported-by: Anthropic
+Cc: stable <stable@kernel.org>
+Assisted-by: gkh_clanker_t1000
+Fixes: a1606a9596e5 ("drm/nouveau: new gem pushbuf interface, bump to 0.0.16")
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+[ Add Fixes: tag. - Danilo ]
+Signed-off-by: Danilo Krummrich <dakr@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/nouveau/nouveau_gem.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
++++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
+@@ -668,7 +668,7 @@ nouveau_gem_pushbuf_reloc_apply(struct n
+               }
+               nvbo = (void *)(unsigned long)bo[r->reloc_bo_index].user_priv;
+-              if (unlikely(r->reloc_bo_offset + 4 >
++              if (unlikely((u64)r->reloc_bo_offset + 4 >
+                            nvbo->bo.base.size)) {
+                       NV_PRINTK(err, cli, "reloc outside of bo\n");
+                       ret = -EINVAL;
diff --git a/queue-6.1/firmware-google-framebuffer-do-not-mark-framebuffer-as-busy.patch b/queue-6.1/firmware-google-framebuffer-do-not-mark-framebuffer-as-busy.patch
new file mode 100644 (file)
index 0000000..6272c66
--- /dev/null
@@ -0,0 +1,47 @@
+From f3850d399de3b6142b02315227ef9e772ed0c302 Mon Sep 17 00:00:00 2001
+From: Thomas Zimmermann <tzimmermann@suse.de>
+Date: Tue, 17 Feb 2026 16:56:12 +0100
+Subject: firmware: google: framebuffer: Do not mark framebuffer as busy
+
+From: Thomas Zimmermann <tzimmermann@suse.de>
+
+commit f3850d399de3b6142b02315227ef9e772ed0c302 upstream.
+
+Remove the flag IORESOURCE_BUSY flag from coreboot's framebuffer
+resource. It prevents simpledrm from successfully requesting the
+range for its own use; resulting in errors such as
+
+[    2.775430] simple-framebuffer simple-framebuffer.0: [drm] could not acquire memory region [mem 0x80000000-0x80407fff flags 0x80000200]
+
+As with other uses of simple-framebuffer, the simple-framebuffer
+device should only declare it's I/O resources, but not actively use
+them.
+
+Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
+Fixes: 851b4c14532d ("firmware: coreboot: Add coreboot framebuffer driver")
+Acked-by: Tzung-Bi Shih <tzungbi@kernel.org>
+Acked-by: Julius Werner <jwerner@chromium.org>
+Cc: Samuel Holland <samuel@sholland.org>
+Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: Tzung-Bi Shih <tzungbi@kernel.org>
+Cc: Brian Norris <briannorris@chromium.org>
+Cc: Julius Werner <jwerner@chromium.org>
+Cc: chrome-platform@lists.linux.dev
+Cc: <stable@vger.kernel.org> # v4.18+
+Link: https://patch.msgid.link/20260217155836.96267-3-tzimmermann@suse.de
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/firmware/google/framebuffer-coreboot.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/firmware/google/framebuffer-coreboot.c
++++ b/drivers/firmware/google/framebuffer-coreboot.c
+@@ -50,7 +50,7 @@ static int framebuffer_probe(struct core
+               return -ENODEV;
+       memset(&res, 0, sizeof(res));
+-      res.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
++      res.flags = IORESOURCE_MEM;
+       res.name = "Coreboot Framebuffer";
+       res.start = fb->physical_address;
+       length = PAGE_ALIGN(fb->y_resolution * fb->bytes_per_line);
diff --git a/queue-6.1/ibmasm-fix-heap-over-read-in-ibmasm_send_i2o_message.patch b/queue-6.1/ibmasm-fix-heap-over-read-in-ibmasm_send_i2o_message.patch
new file mode 100644 (file)
index 0000000..5cd0f2d
--- /dev/null
@@ -0,0 +1,72 @@
+From 9aad71144fa3682cca3837a06c8623016790e7ec Mon Sep 17 00:00:00 2001
+From: Tyllis Xu <livelycarpet87@gmail.com>
+Date: Sat, 14 Mar 2026 11:58:05 -0500
+Subject: ibmasm: fix heap over-read in ibmasm_send_i2o_message()
+
+From: Tyllis Xu <livelycarpet87@gmail.com>
+
+commit 9aad71144fa3682cca3837a06c8623016790e7ec upstream.
+
+The ibmasm_send_i2o_message() function uses get_dot_command_size() to
+compute the byte count for memcpy_toio(), but this value is derived from
+user-controlled fields in the dot_command_header (command_size: u8,
+data_size: u16) and is never validated against the actual allocation size.
+A root user can write a small buffer with inflated header fields, causing
+memcpy_toio() to read up to ~65 KB past the end of the allocation into
+adjacent kernel heap, which is then forwarded to the service processor
+over MMIO.
+
+Silently clamping the copy size is not sufficient: if the header fields
+claim a larger size than the buffer, the SP receives a dot command whose
+own header is inconsistent with the I2O message length, which can cause
+the SP to desynchronize. Reject such commands outright by returning
+failure.
+
+Validate command_size before calling get_mfa_inbound() to avoid leaking
+an I2O message frame: reading INBOUND_QUEUE_PORT dequeues a hardware
+frame from the controller's free pool, and returning without a
+corresponding set_mfa_inbound() call would permanently exhaust it.
+
+Additionally, clamp command_size to I2O_COMMAND_SIZE before the
+memcpy_toio() so the MMIO write stays within the I2O message frame,
+consistent with the clamping already performed by outgoing_message_size()
+for the header field.
+
+Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
+Reported-by: Yuhao Jiang <danisjiang@gmail.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Tyllis Xu <LivelyCarpet87@gmail.com>
+Link: https://patch.msgid.link/20260314165805.548293-1-LivelyCarpet87@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/misc/ibmasm/lowlevel.c |   12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+--- a/drivers/misc/ibmasm/lowlevel.c
++++ b/drivers/misc/ibmasm/lowlevel.c
+@@ -19,17 +19,21 @@ static struct i2o_header header = I2O_HE
+ int ibmasm_send_i2o_message(struct service_processor *sp)
+ {
+       u32 mfa;
+-      unsigned int command_size;
++      size_t command_size;
+       struct i2o_message *message;
+       struct command *command = sp->current_command;
++      command_size = get_dot_command_size(command->buffer);
++      if (command_size > command->buffer_size)
++              return 1;
++      if (command_size > I2O_COMMAND_SIZE)
++              command_size = I2O_COMMAND_SIZE;
++
+       mfa = get_mfa_inbound(sp->base_address);
+       if (!mfa)
+               return 1;
+-      command_size = get_dot_command_size(command->buffer);
+-      header.message_size = outgoing_message_size(command_size);
+-
++      header.message_size = outgoing_message_size((unsigned int)command_size);
+       message = get_i2o_message(sp->base_address, mfa);
+       memcpy_toio(&message->header, &header, sizeof(struct i2o_header));
diff --git a/queue-6.1/ibmasm-fix-oob-reads-in-command_file_write-due-to-missing-size-checks.patch b/queue-6.1/ibmasm-fix-oob-reads-in-command_file_write-due-to-missing-size-checks.patch
new file mode 100644 (file)
index 0000000..fdf6a0b
--- /dev/null
@@ -0,0 +1,59 @@
+From 0eb09f737428e482a32a2e31e5e223f2b35a71d3 Mon Sep 17 00:00:00 2001
+From: Tyllis Xu <livelycarpet87@gmail.com>
+Date: Sat, 14 Mar 2026 11:53:54 -0500
+Subject: ibmasm: fix OOB reads in command_file_write due to missing size checks
+
+From: Tyllis Xu <livelycarpet87@gmail.com>
+
+commit 0eb09f737428e482a32a2e31e5e223f2b35a71d3 upstream.
+
+The command_file_write() handler allocates a kernel buffer of exactly
+count bytes and copies user data into it, but does not validate the
+buffer against the dot command protocol before passing it to
+get_dot_command_size() and get_dot_command_timeout().
+
+Since both the allocation size (count) and the header fields (command_size,
+data_size) are independently user-controlled, an attacker can cause
+get_dot_command_size() to return a value exceeding the allocation,
+triggering OOB reads in get_dot_command_timeout() and an out-of-bounds
+memcpy_toio() that leaks kernel heap memory to the service processor.
+
+Fix with two guards: reject writes smaller than sizeof(struct
+dot_command_header) before allocation, then after copying user data
+reject commands where the buffer is smaller than the total size declared
+by the header (sizeof(header) + command_size + data_size). This ensures
+all subsequent header and payload field accesses stay within the buffer.
+
+Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
+Reported-by: Yuhao Jiang <danisjiang@gmail.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Tyllis Xu <LivelyCarpet87@gmail.com>
+Link: https://patch.msgid.link/20260314165355.548119-1-LivelyCarpet87@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/misc/ibmasm/ibmasmfs.c |    7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/drivers/misc/ibmasm/ibmasmfs.c
++++ b/drivers/misc/ibmasm/ibmasmfs.c
+@@ -303,6 +303,8 @@ static ssize_t command_file_write(struct
+               return -EINVAL;
+       if (count == 0 || count > IBMASM_CMD_MAX_BUFFER_SIZE)
+               return 0;
++      if (count < sizeof(struct dot_command_header))
++              return -EINVAL;
+       if (*offset != 0)
+               return 0;
+@@ -319,6 +321,11 @@ static ssize_t command_file_write(struct
+               return -EFAULT;
+       }
++      if (count < get_dot_command_size(cmd->buffer)) {
++              command_put(cmd);
++              return -EINVAL;
++      }
++
+       spin_lock_irqsave(&command_data->sp->lock, flags);
+       if (command_data->command) {
+               spin_unlock_irqrestore(&command_data->sp->lock, flags);
diff --git a/queue-6.1/misc-ibmasm-fix-oob-mmio-read-in-ibmasm_handle_mouse_interrupt.patch b/queue-6.1/misc-ibmasm-fix-oob-mmio-read-in-ibmasm_handle_mouse_interrupt.patch
new file mode 100644 (file)
index 0000000..e612ad0
--- /dev/null
@@ -0,0 +1,62 @@
+From 4b6e6ead556734bdc14024c5f837132b1e7a4b84 Mon Sep 17 00:00:00 2001
+From: Tyllis Xu <livelycarpet87@gmail.com>
+Date: Sun, 8 Mar 2026 00:21:08 -0600
+Subject: misc: ibmasm: fix OOB MMIO read in ibmasm_handle_mouse_interrupt()
+
+From: Tyllis Xu <livelycarpet87@gmail.com>
+
+commit 4b6e6ead556734bdc14024c5f837132b1e7a4b84 upstream.
+
+ibmasm_handle_mouse_interrupt() performs an out-of-bounds MMIO read
+when the queue reader or writer index from hardware exceeds
+REMOTE_QUEUE_SIZE (60).
+
+A compromised service processor can trigger this by writing an
+out-of-range value to the reader or writer MMIO register before
+asserting an interrupt. Since writer is re-read from hardware on
+every loop iteration, it can also be set to an out-of-range value
+after the loop has already started.
+
+The root cause is that get_queue_reader() and get_queue_writer() return
+raw readl() values that are passed directly into get_queue_entry(),
+which computes:
+
+  queue_begin + reader * sizeof(struct remote_input)
+
+with no bounds check. This unchecked MMIO address is then passed to
+memcpy_fromio(), reading 8 bytes from unintended device registers.
+For sufficiently large values the address falls outside the PCI BAR
+mapping entirely, triggering a machine check exception.
+
+Fix by checking both indices against REMOTE_QUEUE_SIZE at the top of
+the loop body, before any call to get_queue_entry(). On an out-of-range
+value, reset the reader register to 0 via set_queue_reader() before
+breaking, so that normal queue operation can resume if the corrupted
+hardware state is transient.
+
+Reported-by: Yuhao Jiang <danisjiang@gmail.com>
+Fixes: 278d72ae8803 ("[PATCH] ibmasm driver: redesign handling of remote control events")
+Cc: stable@vger.kernel.org
+Cc: ychen@northwestern.edu
+Signed-off-by: Tyllis Xu <LivelyCarpet87@gmail.com>
+Link: https://patch.msgid.link/20260308062108.258940-1-LivelyCarpet87@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/misc/ibmasm/remote.c |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/misc/ibmasm/remote.c
++++ b/drivers/misc/ibmasm/remote.c
+@@ -177,6 +177,11 @@ void ibmasm_handle_mouse_interrupt(struc
+       writer = get_queue_writer(sp);
+       while (reader != writer) {
++              if (reader >= REMOTE_QUEUE_SIZE || writer >= REMOTE_QUEUE_SIZE) {
++                      set_queue_reader(sp, 0);
++                      break;
++              }
++
+               memcpy_fromio(&input, get_queue_entry(sp, reader),
+                               sizeof(struct remote_input));
index 8cd023382567b42b48e0f2502484d48256c25a79..69f255f9a221b85047b22f8f941e98c54673bef9 100644 (file)
@@ -162,3 +162,8 @@ alsa-usb-audio-avoid-false-e-mu-sample-rate-notifications.patch
 alsa-usb-audio-fix-audio-advantage-micro-ii-spdif-switch.patch
 usb-xhci-make-usb_host_endpoint.hcpriv-survive-endpoint_disable.patch
 alsa-usb-audio-evaluate-packsize-caps-at-the-right-place.patch
+drm-nouveau-fix-u32-overflow-in-pushbuf-reloc-bounds-check.patch
+misc-ibmasm-fix-oob-mmio-read-in-ibmasm_handle_mouse_interrupt.patch
+ibmasm-fix-oob-reads-in-command_file_write-due-to-missing-size-checks.patch
+ibmasm-fix-heap-over-read-in-ibmasm_send_i2o_message.patch
+firmware-google-framebuffer-do-not-mark-framebuffer-as-busy.patch