]> git.ipfire.org Git - thirdparty/linux.git/commit
accel/amdxdna: Prevent ubuf size overflow
authorLizhi Hou <lizhi.hou@amd.com>
Tue, 17 Feb 2026 19:28:15 +0000 (11:28 -0800)
committerLizhi Hou <lizhi.hou@amd.com>
Mon, 23 Feb 2026 17:24:21 +0000 (09:24 -0800)
commit03808abb1d868aed7478a11a82e5bb4b3f1ca6d6
tree40445a2c540753181393db8aaec7fc7ead6aa596
parent1110a949675ebd56b3f0286e664ea543f745801c
accel/amdxdna: Prevent ubuf size overflow

The ubuf size calculation may overflow, resulting in an undersized
allocation and possible memory corruption.

Use check_add_overflow() helpers to validate the size calculation before
allocation.

Fixes: bd72d4acda10 ("accel/amdxdna: Support user space allocated buffer")
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260217192815.1784689-1-lizhi.hou@amd.com
drivers/accel/amdxdna/amdxdna_ubuf.c