lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1518625818.24026.2.camel@oracle.com>
Date:   Wed, 14 Feb 2018 09:30:18 -0700
From:   Khalid Aziz <khalid.aziz@...cle.com>
To:     Michal Hocko <mhocko@...nel.org>, Kees Cook <keescook@...omium.org>
Cc:     Anshuman Khandual <khandual@...ux.vnet.ibm.com>,
        Michael Ellerman <mpe@...erman.id.au>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        mm-commits@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
        Linux-MM <linux-mm@...ck.org>,
        "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
        Linux-Next <linux-next@...r.kernel.org>,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        Mark Brown <broonie@...nel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [RFC PATCH] elf: enforce MAP_FIXED on overlaying elf segments
 (was: Re: ppc elf_map breakage with MAP_FIXED_NOREPLACE)

On Tue, 2018-02-13 at 11:04 +0100, Michal Hocko wrote:
> 
> From 97e7355a6dc31a73005fa806566a57eb5c38032b Mon Sep 17 00:00:00
> 2001
> From: Michal Hocko <mhocko@...e.com>
> Date: Tue, 13 Feb 2018 10:50:53 +0100
> Subject: [PATCH] elf: enforce MAP_FIXED on overlaying elf segments
> 
> Anshuman has reported that some ELF binaries in his environment fail
> to
> start with
>  [   23.423642] 9148 (sed): Uhuuh, elf segment at 0000000010030000
> requested but the memory is mapped already
>  [   23.423706] requested [10030000, 10040000] mapped [10030000,
> 10040000] 100073 anon
> 
> The reason is that the above binary has overlapping elf segments:
>   LOAD           0x0000000000000000 0x0000000010000000
> 0x0000000010000000
>                  0x0000000000013a8c 0x0000000000013a8c  R E    10000
>   LOAD           0x000000000001fd40 0x000000001002fd40
> 0x000000001002fd40
>                  0x00000000000002c0 0x00000000000005e8  RW     10000
>   LOAD           0x0000000000020328 0x0000000010030328
> 0x0000000010030328
>                  0x0000000000000384 0x00000000000094a0  RW     10000
> 
> That binary has two RW LOAD segments, the first crosses a page border
> into the second
> 
> 0x1002fd40 (LOAD2-vaddr) + 0x5e8 (LOAD2-memlen) == 0x10030328 (LOAD3-
> vaddr)
> 
> Handle this situation by enforcing MAP_FIXED when we establish a
> temporary brk VMA to handle overlapping segments. All other mappings
> will still use MAP_FIXED_NOREPLACE.
> 
> Fixes: fs, elf: drop MAP_FIXED usage from elf_map
> Reported-by: Anshuman Khandual <khandual@...ux.vnet.ibm.com>
> Signed-off-by: Michal Hocko <mhocko@...e.com>
> ---
> 

Looks reasonable to me.

Reviewed-by: Khalid Aziz <khalid.aziz@...cle.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ