lkml.org 
[lkml]   [2020]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.4 168/261] powerpc/mm: Fix conditions to perform MMU specific management by blocks on PPC32.
    Date
    From: Christophe Leroy <christophe.leroy@csgroup.eu>

    commit 4e3319c23a66dabfd6c35f4d2633d64d99b68096 upstream.

    Setting init mem to NX shall depend on sinittext being mapped by
    block, not on stext being mapped by block.

    Setting text and rodata to RO shall depend on stext being mapped by
    block, not on sinittext being mapped by block.

    Fixes: 63b2bc619565 ("powerpc/mm/32s: Use BATs for STRICT_KERNEL_RWX")
    Cc: stable@vger.kernel.org
    Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Link: https://lore.kernel.org/r/7d565fb8f51b18a3d98445a830b2f6548cb2da2a.1589866984.git.christophe.leroy@csgroup.eu
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    arch/powerpc/mm/pgtable_32.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    --- a/arch/powerpc/mm/pgtable_32.c
    +++ b/arch/powerpc/mm/pgtable_32.c
    @@ -207,7 +207,7 @@ void mark_initmem_nx(void)
    unsigned long numpages = PFN_UP((unsigned long)_einittext) -
    PFN_DOWN((unsigned long)_sinittext);

    - if (v_block_mapped((unsigned long)_stext + 1))
    + if (v_block_mapped((unsigned long)_sinittext))
    mmu_mark_initmem_nx();
    else
    change_page_attr(page, numpages, PAGE_KERNEL);
    @@ -219,7 +219,7 @@ void mark_rodata_ro(void)
    struct page *page;
    unsigned long numpages;

    - if (v_block_mapped((unsigned long)_sinittext)) {
    + if (v_block_mapped((unsigned long)_stext + 1)) {
    mmu_mark_rodata_ro();
    ptdump_check_wx();
    return;

    \
     
     \ /
      Last update: 2020-06-19 18:03    [W:4.091 / U:0.328 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site