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] [thread-next>] [day] [month] [year] [list]
Message-ID: <2fdcea8f-521d-c06c-15f0-b0b6782fd30e@arista.com>
Date:   Mon, 21 Jun 2021 21:59:59 +0100
From:   Dmitry Safonov <dima@...sta.com>
To:     Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org
Cc:     Dmitry Safonov <0x7f454c46@...il.com>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Andy Lutomirski <luto@...nel.org>,
        Arnd Bergmann <arnd@...db.de>, Borislav Petkov <bp@...en8.de>,
        Catalin Marinas <catalin.marinas@....com>,
        Christophe Leroy <christophe.leroy@...roup.eu>,
        Guo Ren <guoren@...nel.org>, "H. Peter Anvin" <hpa@...or.com>,
        Ingo Molnar <mingo@...hat.com>,
        Oleg Nesterov <oleg@...hat.com>,
        Russell King <linux@...linux.org.uk>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        Vincenzo Frascino <vincenzo.frascino@....com>,
        Will Deacon <will@...nel.org>, x86@...nel.org
Subject: Re: [PATCH v3 01/23] x86/elf: Check in_x32_syscall() in
 compat_arch_setup_additional_pages()

Hi Thomas,

On 6/19/21 9:41 PM, Thomas Gleixner wrote:
> On Fri, Jun 11 2021 at 19:02, Dmitry Safonov wrote:
>> Partly revert commit 3316ec8ccd34 ("x86/elf: Use e_machine to check for
>> x32/ia32 in setup_additional_pages()") and commit 9a29a671902c ("elf:
>> Expose ELF header on arch_setup_additional_pages()".
>> Both patches did a good thing: removed usage of TIF_X32, but with
>> a price of additional macros ARCH_SETUP_ADDITIONAL_PAGES() and ifdeffs.
>>
>> Instead, use in_x32_syscall() - the first thing load_elf_binary() does
>> after parsing and checking new ELF binary. It's done that early after
>> exec() that mmap() code already uses it straight away, which is needed
>> to know which mmap_base to use (see arch_pick_mmap_layout()).
>> Add comments to describe how it works.
> 
> I still have no idea what this is trying to solve. All you describe is
> what this does.

Yeah, I still have problems with describing why rather than what sometimes..

How about something like this:

In order to simplify code, new macro ARCH_SETUP_ADDITIONAL_PAGES() can
be dropped as well as a new argument in
compat_arch_setup_additional_pages(). Resulting in partial revert of the
commit 3316ec8ccd34 ("x86/elf: Use e_machine to check for x32/ia32 in
setup_additional_pages()") and the commit 9a29a671902c ("elf: Expose ELF
header on arch_setup_additional_pages()".

Instead of a new macro and an additional function argument, use
in_x32_syscall() which is already valid at the moment of premapping
vDSO. Add comments to describe how it works.

Thanks for reviewing,
          Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ