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-next>] [day] [month] [year] [list]
Date:   Wed, 28 Nov 2018 12:09:51 +0100
From:   Norbert Manthey <nmanthey@...zon.de>
To:     Norbert Manthey <nmanthey@...zon.de>,
        <linux-kernel@...r.kernel.org>
CC:     David Woodhouse <dwmw@...zon.co.uk>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "H. Peter Anvin" <hpa@...or.com>, <x86@...nel.org>,
        "Eric W. Biederman" <ebiederm@...ssion.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        "Mike Rapoport" <rppt@...ux.vnet.ibm.com>,
        Baoquan He <bhe@...hat.com>,
        "Nicolai Stange" <nstange@...e.de>,
        Jan Beulich <JBeulich@...e.com>,
        Jan Kiszka <jan.kiszka@...mens.com>
Subject: [PATCH] io_apic: initialize irq with -EINVAL

To catch the case where the uninitialized variable irq might be
returned. As the path that might lead to this situation can only
occur based on invalid arguments, we initialize this variable with
the value -EINVAL, so that callers are notified accordingly, and no
uninitialized value is returned.

The path that would allow to return an uninitialized value for the
variable irq would require legacy IRQs without the ALLOC flag.

Signed-off-by: Norbert Manthey <nmanthey@...zon.de>
Signed-off-by: David Woodhouse <dwmw@...zon.co.uk>
---
 arch/x86/kernel/apic/io_apic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 2953bbf..219dbc1 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1031,7 +1031,7 @@ static int alloc_isa_irq_from_domain(struct irq_domain *domain,
 static int mp_map_pin_to_irq(u32 gsi, int idx, int ioapic, int pin,
 			     unsigned int flags, struct irq_alloc_info *info)
 {
-	int irq;
+	int irq = -EINVAL;
 	bool legacy = false;
 	struct irq_alloc_info tmp;
 	struct mp_chip_data *data;
-- 
2.7.4




Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrer: Christian Schlaeger, Ralf Herbrich
Ust-ID: DE 289 237 879
Eingetragen am Amtsgericht Charlottenburg HRB 149173 B


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ