1 From bc88d44bd7e45b992cf8c2c2ffbc7bb3e24db4a7 Mon Sep 17 00:00:00 2001
2 From: Steven Price <steven.price@arm.com>
3 Date: Mon, 21 Oct 2024 11:41:05 +0100
4 Subject: [PATCH] irqchip/gic-v3-its: Fix over allocation in
7 itt_alloc_pool() calls its_alloc_pages_node() to allocate an individual
8 page to add to the pool (for allocations <PAGE_SIZE). However the final
9 argument of its_alloc_pages_node() is the page order not the number of
10 pages. Currently it allocates two pages and leaks the second page.
11 Fix it by passing 0 instead (1 << 0 = 1 page).
13 Fixes: b08e2f42e86b ("irqchip/gic-v3-its: Share ITS tables with a non-trusted hypervisor")
14 Reported-by: Shanker Donthineni <sdonthineni@nvidia.com>
15 Signed-off-by: Steven Price <steven.price@arm.com>
16 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
17 Link: https://lore.kernel.org/all/1f6e19c4-1fb9-43ab-a8a2-a465c9cff84b@arm.com
18 Closes: https://lore.kernel.org/r/ed65312a-245c-4fa5-91ad-5d620cab7c6b%40nvidia.com
20 drivers/irqchip/irq-gic-v3-its.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
23 --- a/drivers/irqchip/irq-gic-v3-its.c
24 +++ b/drivers/irqchip/irq-gic-v3-its.c
25 @@ -260,7 +260,7 @@ static void *itt_alloc_pool(int node, in
29 - page = its_alloc_pages_node(node, GFP_KERNEL | __GFP_ZERO, 1);
30 + page = its_alloc_pages_node(node, GFP_KERNEL | __GFP_ZERO, 0);