lkml.org 
[lkml]   [2017]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] x86/mm: Fix personality(ADDR_NO_RANDOMIZE)
    Date
    In v4.12, during rework of infrastructure around mmap_base, disable-ASLR
    personality flag got accidentally broken.

    Let's make it work again.

    Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
    Fixes: 1b028f784e8c ("x86/mm: Introduce mmap_compat_base() for 32-bit mmap()")
    Cc: stable <stable@vger.kernel.org> [4.12+]
    ---
    arch/x86/mm/mmap.c | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c
    index 229d04a83f85..779bdbe5e424 100644
    --- a/arch/x86/mm/mmap.c
    +++ b/arch/x86/mm/mmap.c
    @@ -127,6 +127,8 @@ static unsigned long mmap_legacy_base(unsigned long rnd,
    static void arch_pick_mmap_base(unsigned long *base, unsigned long *legacy_base,
    unsigned long random_factor, unsigned long task_size)
    {
    + if (!(current->flags & PF_RANDOMIZE))
    + random_factor = 0;
    *legacy_base = mmap_legacy_base(random_factor, task_size);
    if (mmap_is_legacy())
    *base = *legacy_base;
    --
    2.14.1
    \
     
     \ /
      Last update: 2017-08-14 17:58    [W:3.859 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site