lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 22 Sep 2021 13:40:25 -0000
From:   "irqchip-bot for Kaige Fu" <tip-bot2@...utronix.de>
To:     linux-kernel@...r.kernel.org
Cc:     Kaige Fu <kaige.fu@...ux.alibaba.com>,
        Marc Zyngier <maz@...nel.org>, tglx@...utronix.de
Subject: [irqchip: irq/irqchip-fixes] irqchip/gic-v3-its: Fix potential VPE
 leak on error

The following commit has been merged into the irq/irqchip-fixes branch of irqchip:

Commit-ID:     280bef512933b2dda01d681d8cbe499b98fc5bdd
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/280bef512933b2dda01d681d8cbe499b98fc5bdd
Author:        Kaige Fu <kaige.fu@...ux.alibaba.com>
AuthorDate:    Wed, 15 Sep 2021 10:20:55 +08:00
Committer:     Marc Zyngier <maz@...nel.org>
CommitterDate: Wed, 22 Sep 2021 14:37:04 +01:00

irqchip/gic-v3-its: Fix potential VPE leak on error

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: 7d75bbb4bc1a ("irqchip/gic-v3-its: Add VPE irq domain allocation/teardown")
Signed-off-by: Kaige Fu <kaige.fu@...ux.alibaba.com>
[maz: fixed commit message]
Signed-off-by: Marc Zyngier <maz@...nel.org>
Link: https://lore.kernel.org/r/d9e36dee512e63670287ed9eff884a5d8d6d27f2.1631672311.git.kaige.fu@linux.alibaba.com
---
 drivers/irqchip/irq-gic-v3-its.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 7f40dca..eb0882d 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -4501,7 +4501,7 @@ static int its_vpe_irq_domain_alloc(struct irq_domain *domain, unsigned int virq
 
 	if (err) {
 		if (i > 0)
-			its_vpe_irq_domain_free(domain, virq, i - 1);
+			its_vpe_irq_domain_free(domain, virq, i);
 
 		its_lpi_free(bitmap, base, nr_ids);
 		its_free_prop_table(vprop_page);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ