powerpc/fsl_booke/64: implement KASLR for fsl_booke64
maillist inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8OHAZ CVE: NA Reference: https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20200330022023.3691-4-yanaijie@huawei.com/ ------------------------------------------------- The implementation for Freescale BookE64 is similar as BookE32. One difference is that Freescale BookE64 set up a TLB mapping of 1G during booting. Another difference is that ppc64 needs the kernel to be 64K-aligned. So we can randomize the kernel in this 1G mapping and make it 64K-aligned. This can save some code to creat another TLB map at early boot. The disadvantage is that we only have about 1G/64K = 16384 slots to put the kernel in. To support secondary cpu boot up, a variable __kaslr_offset was added in first_256B section. This can help secondary cpu get the kaslr offset before the 1:1 mapping has been setup. Signed-off-by:Jason Yan <yanaijie@huawei.com> Cc: Scott Wood <oss@buserror.net> Cc: Diana Craciun <diana.craciun@nxp.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Christophe Leroy <christophe.leroy@c-s.fr> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: Kees Cook <keescook@chromium.org> Signed-off-by:
Cui GaoSheng <cuigaosheng1@huawei.com> Signed-off-by:
GUO Zihua <guozihua@huawei.com>
Loading
Please sign in to comment