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]
Message-Id: <1482161533-21097-1-git-send-email-boris.ostrovsky@oracle.com>
Date:   Mon, 19 Dec 2016 10:32:13 -0500
From:   Boris Ostrovsky <boris.ostrovsky@...cle.com>
To:     bp@...en8.de
Cc:     x86@...nel.org, linux-kernel@...r.kernel.org,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>
Subject: [PATCH] x86/microcode: Adjust ramdisk address when accessing by virtual address

When searching for microcode in the ramdisk image we need to adjust the
start address after paging has been turned on (in 32-bit mode).

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@...cle.com>
---
 arch/x86/kernel/cpu/microcode/core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index c4bb2f7..bc8c3345 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -227,8 +227,11 @@ struct cpio_data find_microcode_in_initrd(const char *path, bool use_pa)
 	 * Set start only if we have an initrd image. We cannot use initrd_start
 	 * because it is not set that early yet.
 	 */
-	if (size)
+	if (size) {
 		start = params->hdr.ramdisk_image;
+		if (!use_pa)
+			start += PAGE_OFFSET;
+	}
 
 # else /* CONFIG_X86_64 */
 	size  = (unsigned long)boot_params.ext_ramdisk_size << 32;
-- 
2.5.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ