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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAG_fn=WzHrp0POLvOPUA9Pm+OPj1DOY0UsyGfhc+BPFS2kA=kw@mail.gmail.com>
Date:   Tue, 14 Feb 2017 13:18:52 +0100
From:   Alexander Potapenko <glider@...gle.com>
To:     Andrey Ryabinin <aryabinin@...tuozzo.com>
Cc:     x86@...nel.org, Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...nel.org>,
        "H. Peter Anvin" <hpa@...or.com>,
        kasan-dev <kasan-dev@...glegroups.com>,
        Dmitry Vyukov <dvyukov@...gle.com>,
        LKML <linux-kernel@...r.kernel.org>,
        Mark Rutland <mark.rutland@....com>,
        Tobias Regnery <tobias.regnery@...il.com>
Subject: Re: [PATCH 2/2] x86/mm/ptdump: Add address marker for KASAN shadow region

On Tue, Feb 14, 2017 at 11:08 AM, Andrey Ryabinin
<aryabinin@...tuozzo.com> wrote:
> Annotate the KASAN shadow with address markers in page table
> dump output:
>
> $ cat /sys/kernel/debug/kernel_page_tables
> ...
> ---[ Vmemmap ]---
> 0xffffea0000000000-0xffffea0003000000          48M     RW         PSE     GLB NX pmd
> 0xffffea0003000000-0xffffea0004000000          16M                               pmd
> 0xffffea0004000000-0xffffea0005000000          16M     RW         PSE     GLB NX pmd
> 0xffffea0005000000-0xffffea0040000000         944M                               pmd
> 0xffffea0040000000-0xffffea8000000000         511G                               pud
> 0xffffea8000000000-0xffffec0000000000        1536G                               pgd
> ---[ KASAN shadow ]---
> 0xffffec0000000000-0xffffed0000000000           1T     ro                 GLB NX pte
> 0xffffed0000000000-0xffffed0018000000         384M     RW         PSE     GLB NX pmd
> 0xffffed0018000000-0xffffed0020000000         128M                               pmd
> 0xffffed0020000000-0xffffed0028200000         130M     RW         PSE     GLB NX pmd
> 0xffffed0028200000-0xffffed0040000000         382M                               pmd
> 0xffffed0040000000-0xffffed8000000000         511G                               pud
> 0xffffed8000000000-0xfffff50000000000        7680G                               pgd
> 0xfffff50000000000-0xfffffbfff0000000     7339776M     ro                 GLB NX pte
> 0xfffffbfff0000000-0xfffffbfff0200000           2M                               pmd
> 0xfffffbfff0200000-0xfffffbfff0a00000           8M     RW         PSE     GLB NX pmd
> 0xfffffbfff0a00000-0xfffffbffffe00000         244M                               pmd
> 0xfffffbffffe00000-0xfffffc0000000000           2M     ro                 GLB NX pte
> ---[ KASAN shadow end ]---
> 0xfffffc0000000000-0xffffff0000000000           3T                               pgd
> ---[ ESPfix Area ]---
> ...
>
> Signed-off-by: Andrey Ryabinin <aryabinin@...tuozzo.com>
Reviewed-by: Alexander Potapenko <glider@...gle.com>
> ---
>  arch/x86/mm/dump_pagetables.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c
> index 0813534..58b5bee 100644
> --- a/arch/x86/mm/dump_pagetables.c
> +++ b/arch/x86/mm/dump_pagetables.c
> @@ -18,6 +18,7 @@
>  #include <linux/sched.h>
>  #include <linux/seq_file.h>
>
> +#include <asm/kasan.h>
>  #include <asm/pgtable.h>
>
>  /*
> @@ -51,6 +52,10 @@ enum address_markers_idx {
>         LOW_KERNEL_NR,
>         VMALLOC_START_NR,
>         VMEMMAP_START_NR,
> +#ifdef CONFIG_KASAN
> +       KASAN_SHADOW_START_NR,
> +       KASAN_SHADOW_END_NR,
> +#endif
>  # ifdef CONFIG_X86_ESPFIX64
>         ESPFIX_START_NR,
>  # endif
> @@ -76,6 +81,10 @@ static struct addr_marker address_markers[] = {
>         { 0/* PAGE_OFFSET */,   "Low Kernel Mapping" },
>         { 0/* VMALLOC_START */, "vmalloc() Area" },
>         { 0/* VMEMMAP_START */, "Vmemmap" },
> +#ifdef CONFIG_KASAN
> +       { KASAN_SHADOW_START,   "KASAN shadow" },
> +       { KASAN_SHADOW_END,     "KASAN shadow end" },
> +#endif
>  # ifdef CONFIG_X86_ESPFIX64
>         { ESPFIX_BASE_ADDR,     "ESPfix Area", 16 },
>  # endif
> --
> 2.10.2
>



-- 
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ