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: <CAG_fn=UUbex_=Tao8g2Pcz2A7ZrhnOvEnV=8HCR5myWP5eL+AQ@mail.gmail.com>
Date:   Fri, 14 May 2021 18:29:18 +0200
From:   Alexander Potapenko <glider@...gle.com>
To:     akpm@...ux-foundation.org,
        Vincenzo Frascino <vincenzo.frascino@....com>,
        Catalin Marinas <catalin.marinas@....com>
Cc:     Marco Elver <elver@...gle.com>,
        Andrey Ryabinin <aryabinin@...tuozzo.com>,
        Andrey Konovalov <andreyknvl@...il.com>,
        Elliot Berman <eberman@...eaurora.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kasan: slab: always reset the tag in get_freepointer_safe()

On Fri, May 14, 2021 at 9:22 AM Alexander Potapenko <glider@...gle.com> wrote:
>
> With CONFIG_DEBUG_PAGEALLOC enabled, the kernel should also untag the
> object pointer, as done in get_freepointer().
>
> Failing to do so reportedly leads to SLUB freelist corruptions that
> manifest as boot-time crashes.
>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Marco Elver <elver@...gle.com>
> Cc: Vincenzo Frascino <vincenzo.frascino@....com>
> Cc: Andrey Ryabinin <aryabinin@...tuozzo.com>
> Cc: Andrey Konovalov <andreyknvl@...il.com>
> Cc: Elliot Berman <eberman@...eaurora.org>
> Cc: linux-kernel@...r.kernel.org
> Signed-off-by: Alexander Potapenko <glider@...gle.com>
> ---
>  mm/slub.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/mm/slub.c b/mm/slub.c
> index feda53ae62ba..9a4f59e5b0c2 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -301,6 +301,7 @@ static inline void *get_freepointer_safe(struct kmem_cache *s, void *object)
>         if (!debug_pagealloc_enabled_static())
>                 return get_freepointer(s, object);
>
> +       object = kasan_reset_tag(object);
>         freepointer_addr = (unsigned long)object + s->offset;
>         copy_from_kernel_nofault(&p, (void **)freepointer_addr, sizeof(p));
>         return freelist_ptr(s, p, freepointer_addr);
> --
> 2.31.1.751.gd2f1c929bd-goog
>


-- 
Alexander Potapenko
Software Engineer

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

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ