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]
Message-ID: <161614425117.398.12898724326370108722.tip-bot2@tip-bot2>
Date:   Fri, 19 Mar 2021 08:57:31 -0000
From:   "tip-bot2 for Dave Hansen" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     kernel test robot <lkp@...el.com>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Borislav Petkov <bp@...e.de>,
        Jarkko Sakkinen <jarkko@...nel.org>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: [tip: x86/sgx] x86/sgx: Fix uninitialized 'nid' variable

The following commit has been merged into the x86/sgx branch of tip:

Commit-ID:     262e88b63f55e3d2bacdf629874a0af486775572
Gitweb:        https://git.kernel.org/tip/262e88b63f55e3d2bacdf629874a0af486775572
Author:        Dave Hansen <dave.hansen@...el.com>
AuthorDate:    Thu, 18 Mar 2021 14:49:33 -07:00
Committer:     Borislav Petkov <bp@...e.de>
CommitterDate: Fri, 19 Mar 2021 09:51:55 +01:00

x86/sgx: Fix uninitialized 'nid' variable

The NUMA fallback in __sgx_alloc_epc_page() recently grew an
additional 'nid' variable to prevent extra trips through the
fallback loop in case where the thread is migrated around.

But, the new copy is not properly initialized.  Fix it.

This was found by some fancy clang that 0day runs.  My gcc
does not detect it.

Fixes: 5b8719504e3a ("x86/sgx: Add a basic NUMA allocation scheme to sgx_alloc_epc_page()")
Reported-by: kernel test robot <lkp@...el.com>
Signed-off-by: Dave Hansen <dave.hansen@...ux.intel.com>
Signed-off-by: Borislav Petkov <bp@...e.de>
Reviewed-by: Jarkko Sakkinen <jarkko@...nel.org>
Link: https://lkml.kernel.org/r/20210318214933.29341-1-dave.hansen@intel.com
---
 arch/x86/kernel/cpu/sgx/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/sgx/main.c b/arch/x86/kernel/cpu/sgx/main.c
index 5c9c5e5..13a7599 100644
--- a/arch/x86/kernel/cpu/sgx/main.c
+++ b/arch/x86/kernel/cpu/sgx/main.c
@@ -489,7 +489,7 @@ struct sgx_epc_page *__sgx_alloc_epc_page(void)
 {
 	struct sgx_epc_page *page;
 	int nid_of_current = numa_node_id();
-	int nid;
+	int nid = nid_of_current;
 
 	if (node_isset(nid_of_current, sgx_numa_mask)) {
 		page = __sgx_alloc_epc_page_from_node(nid_of_current);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ