linux/drivers/accel/ivpu
Jhonraushan ddb44baed2 accel/ivpu: Reject firmware log with size smaller than header
fw_log_from_bo() validates the tracing buffer header_size and that the
log fits within the BO, but never checks that log->size is at least
log->header_size. fw_log_print_buffer() then computes:

  u32 data_size = log->size - log->header_size;

which underflows to a near-U32_MAX value when firmware reports a log whose
size is smaller than its header. That huge data_size defeats the
log_start/log_end bounds clamps added by commit dd1311bcf0 ("accel/ivpu:
Add bounds checks for firmware log indices"), so fw_log_print_lines() reads
far past the small real data region of the BO. A size of 0 also makes
fw_log_from_bo() advance the offset by 0, causing the callers to loop
forever on the same header.

Reject logs whose size is smaller than the header (which also rejects
size == 0).

Fixes: d4e4257afa ("accel/ivpu: Add firmware tracing support")
Cc: stable@vger.kernel.org
Signed-off-by: Jhonraushan <raushan.jhon@gmail.com>
Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Link: https://patch.msgid.link/20260715074206.867712-1-raushan.jhon@gmail.com
2026-07-15 16:17:10 +02:00
..
ivpu_coredump.c accel/ivpu: Add coredump support 2024-10-11 12:44:38 +02:00
ivpu_coredump.h accel/ivpu: Add coredump support 2024-10-11 12:44:38 +02:00
ivpu_debugfs.c accel/ivpu: prevent uninitialized data bug in debugfs 2026-05-26 08:04:07 +02:00
ivpu_debugfs.h accel/ivpu: Compile ivpu_debugfs.c conditionally 2023-09-27 13:11:51 +02:00
ivpu_drv.c Linux 7.1-rc5 2026-05-28 09:58:36 +02:00
ivpu_drv.h accel/ivpu: Remove disable_d0i3_msg workaround 2026-05-28 07:53:02 +02:00
ivpu_fw_log.c accel/ivpu: Reject firmware log with size smaller than header 2026-07-15 16:17:10 +02:00
ivpu_fw_log.h accel/ivpu: Add coredump support 2024-10-11 12:44:38 +02:00
ivpu_fw.c drm-next for 7.2-rc1 2026-06-17 10:21:00 +01:00
ivpu_fw.h accel/ivpu: Implement warm boot flow for NPU6 and unify boot handling 2026-01-08 11:49:37 +01:00
ivpu_gem_userptr.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ivpu_gem.c accel/ivpu: Apply minor code style cleanups to align with kernel style 2026-03-11 13:31:08 +01:00
ivpu_gem.h accel/ivpu: Add fdinfo support for memory statistics 2025-11-12 07:58:44 +01:00
ivpu_hw_37xx_reg.h accel/ivpu: Split IP and buttress headers 2024-05-17 08:30:23 +02:00
ivpu_hw_40xx_reg.h accel/ivpu: Remove boot params address setting via MMIO register 2026-03-10 13:34:31 +01:00
ivpu_hw_btrs_lnl_reg.h accel/ivpu: Wait for CDYN de-assertion during power down sequence 2025-10-30 16:58:20 +01:00
ivpu_hw_btrs_mtl_reg.h accel/ivpu: Split IP and buttress headers 2024-05-17 08:30:23 +02:00
ivpu_hw_btrs.c accel/ivpu: Fix wrong register read in LNL failure diagnostics 2026-07-13 10:29:08 +02:00
ivpu_hw_btrs.h accel/ivpu: Add support for limiting NPU frequency 2026-04-29 09:41:59 +02:00
ivpu_hw_ip.c accel/ivpu: Fix swapped register names in pwr_island_drive functions 2026-04-23 10:00:35 +02:00
ivpu_hw_ip.h accel/ivpu: Implement warm boot flow for NPU6 and unify boot handling 2026-01-08 11:49:37 +01:00
ivpu_hw_reg_io.h accel/ivpu: Add support for hardware fault injection 2025-02-03 10:39:45 +01:00
ivpu_hw.c accel/ivpu: Add disable clock relinquish workaround for NVL-A0 2026-03-24 09:29:28 +01:00
ivpu_hw.h accel/ivpu: Add support for limiting NPU frequency 2026-04-29 09:41:59 +02:00
ivpu_ipc.c drm-next for 7.2-rc1 2026-06-17 10:21:00 +01:00
ivpu_ipc.h accel/ivpu: Use workqueue for IRQ handling 2025-01-09 09:35:44 +01:00
ivpu_job.c accel/ivpu: fix HWS command queue leak on registration failure 2026-06-15 09:01:01 +02:00
ivpu_job.h accel/ivpu: Return correct job error status 2025-10-08 18:32:39 +02:00
ivpu_jsm_msg.c accel/ivpu: Remove disable_d0i3_msg workaround 2026-05-28 07:53:02 +02:00
ivpu_jsm_msg.h accel/ivpu: Add support for limiting NPU frequency 2026-04-29 09:41:59 +02:00
ivpu_mmu_context.c accel/ivpu: Validate scatter-gather size against buffer size 2025-12-16 08:10:19 +01:00
ivpu_mmu_context.h accel/ivpu: Validate scatter-gather size against buffer size 2025-12-16 08:10:19 +01:00
ivpu_mmu.c accel/ivpu: Perform engine reset instead of device recovery on TDR 2026-03-20 08:03:11 +01:00
ivpu_mmu.h accel/ivpu: Move parts of MMU event IRQ handling to thread handler 2025-01-09 09:35:44 +01:00
ivpu_ms.c accel/ivpu: Add buffer overflow check in MS get_info_ioctl 2026-06-02 07:47:50 +02:00
ivpu_ms.h accel/ivpu: Add NPU profiling support 2024-05-15 07:42:23 +02:00
ivpu_pm.c accel/ivpu: Trigger recovery on TDR with OS scheduling 2026-04-02 21:29:01 +02:00
ivpu_pm.h accel/ivpu: Perform engine reset instead of device recovery on TDR 2026-03-20 08:03:11 +01:00
ivpu_sysfs.c accel/ivpu: Add support for limiting NPU frequency 2026-04-29 09:41:59 +02:00
ivpu_sysfs.h accel/ivpu: Share NPU busy time in sysfs 2024-05-15 07:42:29 +02:00
ivpu_trace_points.c accel/ivpu: Add tracing for IPC/PM/JOB 2024-10-11 12:44:39 +02:00
ivpu_trace.h accel/ivpu: Add tracing for IPC/PM/JOB 2024-10-11 12:44:39 +02:00
Kconfig accel/ivpu: Add debug Kconfig option 2024-10-30 10:23:49 +01:00
Makefile accel/ivpu: Add support for userptr buffer objects 2025-10-30 08:52:51 +01:00
vpu_boot_api.h accel/ivpu: Remove disable_d0i3_msg workaround 2026-05-28 07:53:02 +02:00
vpu_jsm_api.h accel/ivpu: Add support for limiting NPU frequency 2026-04-29 09:41:59 +02:00