Skip to content

Commit bc88d44

Browse files
Steven PriceKAGA-KOKO
authored andcommitted
irqchip/gic-v3-its: Fix over allocation in itt_alloc_pool()
itt_alloc_pool() calls its_alloc_pages_node() to allocate an individual page to add to the pool (for allocations <PAGE_SIZE). However the final argument of its_alloc_pages_node() is the page order not the number of pages. Currently it allocates two pages and leaks the second page. Fix it by passing 0 instead (1 << 0 = 1 page). Fixes: b08e2f4 ("irqchip/gic-v3-its: Share ITS tables with a non-trusted hypervisor") Reported-by: Shanker Donthineni <[email protected]> Signed-off-by: Steven Price <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected] Closes: https://lore.kernel.org/r/ed65312a-245c-4fa5-91ad-5d620cab7c6b%40nvidia.com
1 parent 010863f commit bc88d44

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/irqchip/irq-gic-v3-its.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ static void *itt_alloc_pool(int node, int size)
261261
if (addr)
262262
break;
263263

264-
page = its_alloc_pages_node(node, GFP_KERNEL | __GFP_ZERO, 1);
264+
page = its_alloc_pages_node(node, GFP_KERNEL | __GFP_ZERO, 0);
265265
if (!page)
266266
break;
267267

0 commit comments

Comments
 (0)