Skip to content

accel/ethosu: fix two command stream parser bugs

Muhammad Bilal dri-devel lkml stable 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2accel/ethosu: reject NPU_OP_RESIZE commands from userspacedrivers/accel/ethosu/ethosu_gem.c+1 -20 replies
2/2accel/ethosu: fix wrong weight index in NPU_SET_SCALE1_LENGTH on U85drivers/accel/ethosu/ethosu_gem.c+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] accel/ethosu: fix two command stream parser bugs

While investigating the IFM region index out-of-bounds fix already sent [1], two additional bugs were found in the same command stream parser function ethosu_gem_cmdstream_copy_and_validate():

Patch 1: NPU_OP_RESIZE unconditionally triggers WARN_ON(1), allowing any unprivileged user with DRM device access to spam the kernel log or panic the kernel if panic_on_warn is set.

Patch 2: NPU_SET_SCALE1_LENGTH on U85 hardware assigns the user-supplied length to weight[1] instead of weight[2], mismatching its BASE handler and corrupting the software bounds-check state for both weight buffers.

Both fixes apply cleanly on top of the IFM patch and target the same
Fixes: tag since all three bugs originate in the same commit.

[1] <[email protected]>

Muhammad Bilal (2):
accel/ethosu: reject NPU_OP_RESIZE commands from userspace accel/ethosu: fix wrong weight index in NPU_SET_SCALE1_LENGTH on U85

 drivers/accel/ethosu/ethosu_gem.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Signature · 1 line
2.53.0