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] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 5 Sep 2016 10:13:23 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     x86@...nel.org, Andi Kleen <ak@...ux.intel.com>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>,
        Borislav Petkov <bp@...e.de>, "H. Peter Anvin" <hpa@...or.com>,
        Ingo Molnar <mingo@...hat.com>, Jiri Olsa <jolsa@...hat.com>,
        Jürgen Groß <jgross@...e.com>,
        Len Brown <len.brown@...el.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Thomas Gleixner <tglx@...utronix.de>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org,
        Julia Lawall <julia.lawall@...6.fr>,
        Paolo Bonzini <pbonzini@...hat.com>
Subject: [PATCH 4/4] x86/smpboot: Return directly after a failed kcalloc()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Mon, 5 Sep 2016 09:39:05 +0200

Return directly after a memory allocation failed in this function.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 arch/x86/kernel/smpboot.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index e3fdc44..a30f625 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -359,6 +359,10 @@ static void __init smp_init_package_map(void)
 	physical_package_map = kcalloc(BITS_TO_LONGS(max_physical_pkg_id),
 				       sizeof(*physical_package_map),
 				       GFP_KERNEL);
+	if (!physical_package_map) {
+		kfree(physical_to_logical_pkg);
+		return;
+	}
 
 	for_each_present_cpu(cpu) {
 		unsigned int apicid = apic->cpu_present_to_apicid(cpu);
-- 
2.9.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ