mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 04:45:43 +01:00
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:
1 file changed
+4
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user