]> git.ipfire.org Git - thirdparty/linux.git/commit
accel: ethosu: Handle possible underflow in IFM size calculations
authorRob Herring (Arm) <robh@kernel.org>
Wed, 18 Feb 2026 22:21:57 +0000 (16:21 -0600)
committerRob Herring (Arm) <robh@kernel.org>
Thu, 5 Mar 2026 21:21:17 +0000 (15:21 -0600)
commit021f1b77f70d62351bba67b050b8d784641d817f
tree505e94cbdeef3be15bc94fb693590ef30edd5f2a
parent838ae99f9a77a5724ee6d4e7b7b1eb079147f888
accel: ethosu: Handle possible underflow in IFM size calculations

If the command stream has larger padding sizes than the IFM and OFM
diminsions, then the calculations will underflow to a negative value.
The result is a very large region bounds which is caught on submit, but
it's better to catch it earlier.

Current mesa ethosu driver has a signedness bug which resulted in
padding of 127 (the max) and triggers this issue.

Reviewed-and-Tested-by: Anders Roxell <anders.roxell@linaro.org>
Link: https://patch.msgid.link/20260218-ethos-fixes-v1-3-be3fa3ea9a30@kernel.org
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
drivers/accel/ethosu/ethosu_gem.c