Skip to content

Commit

Permalink
udmabuf: fix a buf size overflow issue during udmabuf creation
Browse files Browse the repository at this point in the history
by casting size_limit_mb to u64  when calculate pglimit.

Signed-off-by: Xiaogang Chen<Xiaogang.Chen@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250321164126.329638-1-xiaogang.chen@amd.com
Signed-off-by: Christian König <christian.koenig@amd.com>
  • Loading branch information
Xiaogang Chen authored and Christian König committed Mar 24, 2025
1 parent cb83f4b commit 021ba7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/dma-buf/udmabuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ static long udmabuf_create(struct miscdevice *device,
if (!ubuf)
return -ENOMEM;

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

Expand Down

0 comments on commit 021ba7f

Please sign in to comment.