linux/drivers/accel/qaic
Muhammad Bilal d6c075f797 accel/qaic: use sizeof(*trans_hdr) for transaction length check
In encode_message() the per-transaction lower-bound check compares
trans_hdr->len against sizeof(trans_hdr), i.e. the size of the pointer,
instead of sizeof(*trans_hdr), the size of struct qaic_manage_trans_hdr.

Every other length check in this file (encode_message() at the loop
guard, decode_message(), etc.) correctly uses sizeof(*trans_hdr), so
this is an inconsistency. On 64-bit builds the pointer and the struct
are both 8 bytes, so the check is correct by coincidence and there is
no behavioural change. On 32-bit builds the pointer is 4 bytes, which
weakens the minimum-length check below the 8-byte header size.

Use sizeof(*trans_hdr) so the check validates against the actual
transaction header size on all builds.

Fixes: ea33cb6fc2 ("accel/qaic: tighten bounds checking in encode_message()")
Signed-off-by: Muhammad Bilal <meatuni001@gmail.com>
Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
Signed-off-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
Link: https://patch.msgid.link/20260617212520.59801-1-meatuni001@gmail.com
2026-07-29 14:57:37 -06:00
..
Kconfig accel/qaic: Collect crashdump from SSR channel 2025-11-07 11:16:51 -07:00
Makefile accel/qaic: Implement basic SSR handling 2025-11-07 11:01:18 -07:00
mhi_controller.c accel/qaic: Update copyright headers to yearless format 2026-03-27 11:03:08 -06:00
mhi_controller.h accel/qaic: Update copyright headers to yearless format 2026-03-27 11:03:08 -06:00
qaic_control.c accel/qaic: use sizeof(*trans_hdr) for transaction length check 2026-07-29 14:57:37 -06:00
qaic_data.c Linux 7.1-rc5 2026-05-28 09:58:36 +02:00
qaic_debugfs.c accel/qaic: Retain bootlogs that overflow 2026-03-27 11:25:36 -06:00
qaic_debugfs.h accel/qaic: Update copyright headers to yearless format 2026-03-27 11:03:08 -06:00
qaic_drv.c accel/qaic: kcalloc + kzalloc to kzalloc 2026-05-12 10:20:40 -06:00
qaic_ras.c Linux 7.1-rc5 2026-05-28 09:58:36 +02:00
qaic_ras.h accel/qaic: Update copyright headers to yearless format 2026-03-27 11:03:08 -06:00
qaic_ssr.c accel/qaic: Update copyright headers to yearless format 2026-03-27 11:03:08 -06:00
qaic_ssr.h accel/qaic: Update copyright headers to yearless format 2026-03-27 11:03:08 -06:00
qaic_sysfs.c accel/qaic: Add DMA Bridge Channel(DBC) sysfs and uevents 2025-11-07 10:55:39 -07:00
qaic_timesync.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
qaic_timesync.h accel/qaic: Update copyright headers to yearless format 2026-03-27 11:03:08 -06:00
qaic.h accel/qaic: kcalloc + kzalloc to kzalloc 2026-05-12 10:20:40 -06:00
sahara.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
sahara.h accel/qaic: Update copyright headers to yearless format 2026-03-27 11:03:08 -06:00