Merge tag 'tee-fix-for-v7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee into arm/fixes

Reject zero-sized allocations in tee_dyn_shm_alloc_helper()

* tag 'tee-fix-for-v7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee:
  tee: shm: reject zero-sized allocations in tee_dyn_shm_alloc_helper()

Signed-off-by: Arnd Bergmann <[email protected]>
This commit is contained in:
Arnd Bergmann committed 2026-10-03 23:33:02 +02:00
commit 1fc2d80928
1 file changed
+4
+4
View File
@@ -343,6 +343,10 @@ int tee_dyn_shm_alloc_helper(struct tee_shm *shm, size_t size, size_t align,
unsigned int i;
int rc = 0;
/* get_order(0) is undefined and exceeds MAX_PAGE_ORDER. */
if (!nr_pages)
return -EINVAL;
/*
* Ignore alignment since this is already going to be page aligned
* and there's no need for any larger alignment.