Skip to content

Commit 021ba7f

Browse files
Xiaogang ChenChristianKoenigAMD
authored andcommitted
udmabuf: fix a buf size overflow issue during udmabuf creation
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]>
1 parent cb83f4b commit 021ba7f

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
@@ -393,7 +393,7 @@ static long udmabuf_create(struct miscdevice *device,
393393
if (!ubuf)
394394
return -ENOMEM;
395395

396-
pglimit = (size_limit_mb * 1024 * 1024) >> PAGE_SHIFT;
396+
pglimit = ((u64)size_limit_mb * 1024 * 1024) >> PAGE_SHIFT;
397397
for (i = 0; i < head->count; i++) {
398398
pgoff_t subpgcnt;
399399

0 commit comments

Comments
 (0)