Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] accel/ethosu: missing Fixes trailer for feat_matrix_length() fix
--

commit b15b9b8e0339b0188ac3731a239755db7038a2cd
Author: Bilal Hashim <[email protected]>

> accel/ethosu: validate strides, format, and overflow in feat_matrix_length()
>
> In ethosu_gem_cmdstream_copy_and_validate(), `cmd_state_init()` fills
> `struct cmd_state` with `0xff` so that missing setup commands can be
> detected (leaving `s64 stride_x`, `stride_y`, and `stride_c` equal to
> `-1`).
>
> However, `feat_matrix_length()` never checks whether `fm->stride_y`,
> `fm->stride_x`, or `fm->stride_c` are negative (uninitialized), does not
> reject invalid format values `(fm->precision >> 6) & 0x3` greater than 1,
> and performs unchecked arithmetic on `addr` and `addr + 1`. If a command
> stream omits a stride setup command, multiplying by `-1` shrinks `addr`
> below `fm->base[tile]`, underestimating `info->region_size[fm->region]`
> and weakening the BO bounds check in `ethosu_ioctl_submit_job()`.
>
> Reject negative strides and unknown formats, and use `check_mul_overflow`
> and `check_add_overflow` when computing `addr` and `end = addr + 1`.
>
> Signed-off-by: Bilal Hashim <[email protected]>

[Severity: Low]
This fixes a bug in command stream validation introduced with the driver.
Should this include:

  Fixes: 5a5e9c0228e6 ("accel: Add Arm Ethos-U NPU driver")

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to