Skip to content

Commit 39bbb0b

Browse files
committed
irqchip/gic-v3-its: Fix potential VPE leak on error
jira LE-1907 cve CVE-2021-47373 Rebuild_History Non-Buildable kernel-4.18.0-553.16.1.el8_10 commit-author Kaige Fu <[email protected]> commit 280bef5 In its_vpe_irq_domain_alloc, when its_vpe_init() returns an error, there is an off-by-one in the number of VPEs to be freed. Fix it by simply passing the number of VPEs allocated, which is the index of the loop iterating over the VPEs. Fixes: 7d75bbb ("irqchip/gic-v3-its: Add VPE irq domain allocation/teardown") Signed-off-by: Kaige Fu <[email protected]> [maz: fixed commit message] Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/d9e36dee512e63670287ed9eff884a5d8d6d27f2.1631672311.git.kaige.fu@linux.alibaba.com (cherry picked from commit 280bef5) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 06f683c commit 39bbb0b

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
@@ -4502,7 +4502,7 @@ static int its_vpe_irq_domain_alloc(struct irq_domain *domain, unsigned int virq
45024502

45034503
if (err) {
45044504
if (i > 0)
4505-
its_vpe_irq_domain_free(domain, virq, i - 1);
4505+
its_vpe_irq_domain_free(domain, virq, i);
45064506

45074507
its_lpi_free(bitmap, base, nr_ids);
45084508
its_free_prop_table(vprop_page);

0 commit comments

Comments
 (0)