Skip to content

Commit 29b65a3

Browse files
xiaogang-chen-amdgregkh
authored andcommitted
udmabuf: fix a buf size overflow issue during udmabuf creation
[ Upstream commit 021ba7f ] by casting size_limit_mb to u64 when calculate pglimit. Signed-off-by: Xiaogang Chen<[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Christian König <[email protected]> Signed-off-by: Amelia Crate <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 57100b8 commit 29b65a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma-buf/udmabuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ static long udmabuf_create(struct miscdevice *device,
350350
return -ENOMEM;
351351

352352
INIT_LIST_HEAD(&ubuf->unpin_list);
353-
pglimit = (size_limit_mb * 1024 * 1024) >> PAGE_SHIFT;
353+
pglimit = ((u64)size_limit_mb * 1024 * 1024) >> PAGE_SHIFT;
354354
for (i = 0; i < head->count; i++) {
355355
if (!PAGE_ALIGNED(list[i].offset))
356356
goto err;

0 commit comments

Comments
 (0)