]> git.ipfire.org Git - thirdparty/linux.git/commit
accel/ethosu: reject NPU_OP_RESIZE commands from userspace
authorMuhammad Bilal <meatuni001@gmail.com>
Sat, 23 May 2026 21:07:52 +0000 (21:07 +0000)
committerRob Herring (Arm) <robh@kernel.org>
Thu, 4 Jun 2026 22:41:46 +0000 (17:41 -0500)
commitef911805d86a05363d3ec2fa9835a41def83bb7e
tree1b1e129e93e3d6f33b6548e39d7de6fb9b3d79e4
parent00f547e0dfecf83014fb32bcba587c6b684c1362
accel/ethosu: reject NPU_OP_RESIZE commands from userspace

NPU_OP_RESIZE is a U85-only command that the driver does not yet
implement. The existing WARN_ON(1) placeholder fires unconditionally
whenever userspace submits this command via DRM_IOCTL_ETHOSU_GEM_CREATE,
causing unbounded kernel log spam.

If panic_on_warn is set the kernel panics, giving any unprivileged user
with access to the DRM device a trivial denial-of-service primitive.

Replace the WARN_ON(1) with an explicit -EINVAL return so the ioctl
rejects the command before it reaches hardware.

Fixes: 5a5e9c0228e6 ("accel: Add Arm Ethos-U NPU driver")
Cc: stable@vger.kernel.org
Signed-off-by: Muhammad Bilal <meatuni001@gmail.com>
Link: https://patch.msgid.link/20260523210840.92039-2-meatuni001@gmail.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
drivers/accel/ethosu/ethosu_gem.c