[PATCH 1/1] Documentation/x86/boot: Correct algorithm for runtime start address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Adrian Huang <ahuang12@xxxxxxxxxx>

Commit 8ab3820fd5b2 ("x86, kaslr: Return location from decompress_kernel")
enforces CONFIG_PHYSICAL_START as the minimum relocation address when
the kernel option CONFIG_RELOCATABLE is enabled. This change should be
included accordingly.

Signed-off-by: Adrian Huang <ahuang12@xxxxxxxxxx>
Cc: Kees Cook <keescook@xxxxxxxxxxxx>
---
 Documentation/x86/boot.rst | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/Documentation/x86/boot.rst b/Documentation/x86/boot.rst
index fc844913dece..808ea181ca40 100644
--- a/Documentation/x86/boot.rst
+++ b/Documentation/x86/boot.rst
@@ -894,10 +894,16 @@ Offset/size:	0x260/4
 
   The kernel runtime start address is determined by the following algorithm::
 
-	if (relocatable_kernel)
-	runtime_start = align_up(load_address, kernel_alignment)
-	else
-	runtime_start = pref_address
+	if (relocatable_kernel) {
+		runtime_start = align_up(load_address, kernel_alignment);
+
+		/* pref_address is the minimum relocation address */
+		if (runtime_start < pref_address)
+			runtime_start = pref_address;
+	} else {
+		/* Adhere to the statement describing in field 'pref_address' */
+		runtime_start = pref_address;
+	}
 
 ============	===============
 Field name:	handover_offset
-- 
2.17.1




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux