Skip to content

accel/amdxdna: fix two NULL-deref DoS paths reachable via AMDXDNA_EXEC_CMD

Doruk Tan Ozturk dri-devel lkml stable 1 version Applied

Status from this message: Applied to drm-misc-fixes

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 4 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2accel/amdxdna: reject user command submission without a command BOdrivers/accel/amdxdna/amdxdna_ctx.c+10 -02 replies
2/2accel/amdxdna: reject command submission on devices without a submit opdrivers/accel/amdxdna/amdxdna_ctx.c+4 -02 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchLizhi Hou
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] accel/amdxdna: fix two NULL-deref DoS paths reachable via AMDXDNA_EXEC_CMD

An unprivileged process with access to an AMD NPU accel node can oops the kernel with a single AMDXDNA_EXEC_CMD ioctl. Two distinct NULL dereferences are reachable on the command-submit path, both since the driver first gained command execution:

1. cmd_handles = 0 (AMDXDNA_INVALID_BO_HANDLE) leaves job->cmd_bo NULL, dereferenced later by the DRM scheduler.
2. On an AIE4 device (no .cmd_submit op) the ioctl calls a NULL function pointer.

Both are availability-only (local DoS), no memory corruption. Found by static analysis; verified against source, not runtime-reproduced (no NPU on hand).

Doruk Tan Ozturk (2):
accel/amdxdna: reject user command submission without a command BO accel/amdxdna: reject command submission on devices without a submit
op

 drivers/accel/amdxdna/amdxdna_ctx.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
Signature · 1 line
2.43.0