From b60befa806ffbdd413aa0c470b311d01d5fdbadd Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 19 Sep 2023 18:47:18 +0000 Subject: [PATCH] riscv64: minor ASLR bits changes. Improve the comment, and increase the "minimum maximum" to 24 --- we only support 64-bit, and 64-bit never has less than 24 bits. Bug: https://github.com/google/android-riscv64/issues/1 Test: treehugger Change-Id: I478c7649aa19258352c908a449cabe12da94952c --- init/security.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/init/security.cpp b/init/security.cpp index 6e616be93..445286aa5 100644 --- a/init/security.cpp +++ b/init/security.cpp @@ -117,10 +117,10 @@ Result SetMmapRndBitsAction(const BuiltinArguments&) { return {}; } #elif defined(__riscv) - // TODO: sv48 and sv57 were both added to the kernel this year, so we - // probably just need some kernel fixes to enable higher ASLR randomization, - // but for now 24 is the maximum that the kernel supports. - if (SetMmapRndBitsMin(24, 18, false)) { + // TODO: sv48 and sv57 have both been added to the kernel, but the kernel + // still doesn't support more than 24 bits. + // https://github.com/google/android-riscv64/issues/1 + if (SetMmapRndBitsMin(24, 24, false)) { return {}; } #elif defined(__x86_64__)