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]
Date:   Fri, 11 Jun 2021 19:37:52 +0100
From:   Dmitry Safonov <0x7f454c46@...il.com>
To:     Shuah Khan <skhan@...uxfoundation.org>,
        Dmitry Safonov <dima@...sta.com>, linux-kernel@...r.kernel.org
Cc:     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>,
        Thomas Gleixner <tglx@...utronix.de>,
        Vincenzo Frascino <vincenzo.frascino@....com>,
        Will Deacon <will@...nel.org>, x86@...nel.org,
        Shuah Khan <shuah@...nel.org>
Subject: Re: [PATCH v3 23/23] x86/vdso/selftest: Add a test for unmapping vDSO

On 6/11/21 7:21 PM, Shuah Khan wrote:
> On 6/11/21 12:02 PM, Dmitry Safonov wrote:
>> Output for landing on x86:
>>> [root@...alhost ~]# ./test_munmap_vdso_64
>>>     AT_SYSINFO_EHDR is 0x7fffead9f000
>>> [NOTE]    unmapping vDSO: [0x7fffead9f000, 0x7fffeada0000]
>>> [NOTE]    vDSO partial move failed, will try with bigger size
>>> [NOTE]    unmapping vDSO: [0x7fffead9f000, 0x7fffeada1000]
>>> [OK]
>>> [root@...alhost ~]# ./test_munmap_vdso_32
>>>     AT_SYSINFO_EHDR is 0xf7eef000
>>> [NOTE]    unmapping vDSO: [0xf7eef000, 0xf7ef0000]
>>> [NOTE]    vDSO partial move failed, will try with bigger size
>>> [NOTE]    unmapping vDSO: [0xf7eef000, 0xf7ef1000]
>>> [OK]
>>
>> The test also can check force_sigsegv(SIGSEGV) in do_fast_syscall_32():
>>> [root@...alhost ~]# ./test_munmap_vdso_32 sysenter
>>> [NOTE]    Using sysenter after munmap
>>>     AT_SYSINFO_EHDR is 0xf7efe000
>>> [NOTE]    unmapping vDSO: [0xf7efe000, 0xf7eff000]
>>> [NOTE]    vDSO partial move failed, will try with bigger size
>>> [NOTE]    unmapping vDSO: [0xf7efe000, 0xf7f00000]
>>> [OK]    32-bit process gets segfault on fast syscall with unmapped vDSO
>>
>> Cc: Shuah Khan <shuah@...nel.org>
>> Signed-off-by: Dmitry Safonov <dima@...sta.com>
>> ---
>>   tools/testing/selftests/x86/.gitignore        |   1 +
>>   tools/testing/selftests/x86/Makefile          |  11 +-
>>   .../testing/selftests/x86/test_munmap_vdso.c  | 151 ++++++++++++++++++
>>   3 files changed, 158 insertions(+), 5 deletions(-)
>>   create mode 100644 tools/testing/selftests/x86/test_munmap_vdso.c
>>
> 
> I can take this through kselftest tree for 5.14 - are there any
> dependencies on x86 tree, I should be aware of?

The test should work without other patches from the set.
So I guess, it's good to go by it's own.

The only note I can make here is that without previous patches this part
of the commit message is not exactly precise:
> The test also can check force_sigsegv(SIGSEGV) in
> do_fast_syscall_32()

I will still crash, but not by the kernel enforcement, rather with
landing on the area where vdso was previously mapped.

Thanks,
            Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ