From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw0-f197.google.com (mail-yw0-f197.google.com [209.85.161.197]) by kanga.kvack.org (Postfix) with ESMTP id 108666B02B4 for ; Mon, 7 Aug 2017 13:33:28 -0400 (EDT) Received: by mail-yw0-f197.google.com with SMTP id l82so15348862ywc.1 for ; Mon, 07 Aug 2017 10:33:28 -0700 (PDT) Received: from mail-yw0-x236.google.com (mail-yw0-x236.google.com. [2607:f8b0:4002:c05::236]) by mx.google.com with ESMTPS id 203si1377827ywp.104.2017.08.07.10.33.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Aug 2017 10:33:27 -0700 (PDT) Received: by mail-yw0-x236.google.com with SMTP id u207so6940931ywc.3 for ; Mon, 07 Aug 2017 10:33:27 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Kostya Serebryany Date: Mon, 7 Aug 2017 10:33:26 -0700 Message-ID: Subject: Re: binfmt_elf: use ELF_ET_DYN_BASE only for PIE breaks asan Content-Type: multipart/alternative; boundary="089e0828d3fc91845205562d3ea6" Sender: owner-linux-mm@kvack.org List-ID: To: Dmitry Vyukov Cc: Kees Cook , danielmicay@gmail.com, Michal Hocko , Andrew Morton , "linux-mm@kvack.org" , Rik van Riel , Reid Kleckner , Peter Collingbourne , Jakub Jelinek --089e0828d3fc91845205562d3ea6 Content-Type: text/plain; charset="UTF-8" +Jakub Jelinek, who helped us migrate asan's shadow from high addresses to 0x7fff7000 for a significant ~5% performance and code size gain. (a few years ago) --kcc On Mon, Aug 7, 2017 at 10:24 AM, Dmitry Vyukov wrote: > Hello, > > The recent "binfmt_elf: use ELF_ET_DYN_BASE only for PIE" patch: > https://github.com/torvalds/linux/commit/eab09532d40090698b05a07c1c87f3 > 9fdbc5fab5 > breaks user-space AddressSanitizer. AddressSanitizer makes assumptions > about address space layout for substantial performance gains. There > are multiple people complaining about this already: > https://github.com/google/sanitizers/issues/837 > https://twitter.com/kayseesee/status/894594085608013825 > https://bugzilla.kernel.org/show_bug.cgi?id=196537 > AddressSanitizer maps shadow memory at [0x00007fff7000-0x10007fff7fff] > expecting that non-pie binaries will be below 2GB and pie > binaries/modules will be at 0x55 or 0x7f. This is not the first time > kernel address space shuffling breaks sanitizers. The last one was the > move to 0x55. > > Is it possible to make this change less aggressive and keep the > executable under 2GB? > > In future please be mindful of user-space sanitizers and talk to > address-sanitizer@googlegroups.com before shuffling address space. > > Thanks > --089e0828d3fc91845205562d3ea6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
+Jakub Jelinek, who helped us migrate asan's shad= ow from high addresses
to 0x= 7fff7000 for a significant ~5% performance and code size gain.
(a few years ago)

--kcc=C2=A0

On Mon, Aug 7,= 2017 at 10:24 AM, Dmitry Vyukov <dvyukov@google.com> wrote= :
Hello,

The recent "binfmt_elf: use ELF_ET_DYN_BASE only for PIE" patch:<= br> https://github.com/= torvalds/linux/commit/eab09532d40090698b05a07c1c87f39fdbc5fa= b5
breaks user-space AddressSanitizer. AddressSanitizer makes assumptions
about address space layout for substantial performance gains. There
are multiple people complaining about this already:
https://github.com/google/sanitizers/issues/837<= /a>
https://twitter.com/kayseesee/status/894= 594085608013825
https://bugzilla.kernel.org/show_bug.cgi?id= =3D196537
AddressSanitizer maps shadow memory at [0x00007fff7000-0x10007fff7fff]=
expecting that non-pie binaries will be below 2GB and pie
binaries/modules will be at 0x55 or 0x7f. This is not the first time
kernel address space shuffling breaks sanitizers. The last one was the
move to 0x55.

Is it possible to make this change less aggressive and keep the
executable under 2GB?

In future please be mindful of user-space sanitizers and talk to
address-sanitizer@googlegroups.com before shuffling address space.

Thanks

--089e0828d3fc91845205562d3ea6-- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org