Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1707260906230.6341@nuc-kabylake>
Date: Wed, 26 Jul 2017 09:08:01 -0500 (CDT)
From: Christopher Lameter <cl@...ux.com>
To: Kees Cook <keescook@...omium.org>
cc: Alexander Popov <alex.popov@...ux.com>, 
    Andrew Morton <akpm@...ux-foundation.org>, 
    Pekka Enberg <penberg@...nel.org>, David Rientjes <rientjes@...gle.com>, 
    Joonsoo Kim <iamjoonsoo.kim@....com>, 
    "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>, 
    Ingo Molnar <mingo@...nel.org>, Josh Triplett <josh@...htriplett.org>, 
    Andy Lutomirski <luto@...nel.org>, 
    Nicolas Pitre <nicolas.pitre@...aro.org>, Tejun Heo <tj@...nel.org>, 
    Daniel Mack <daniel@...que.org>, 
    Sebastian Andrzej Siewior <bigeasy@...utronix.de>, 
    Sergey Senozhatsky <sergey.senozhatsky@...il.com>, 
    Helge Deller <deller@....de>, Rik van Riel <riel@...hat.com>, 
    Linux-MM <linux-mm@...ck.org>, Tycho Andersen <tycho@...ker.com>, 
    LKML <linux-kernel@...r.kernel.org>, 
    "kernel-hardening@...ts.openwall.com" <kernel-hardening@...ts.openwall.com>
Subject: Re: [v3] mm: Add SLUB free list pointer obfuscation

On Tue, 25 Jul 2017, Kees Cook wrote:

> > @@ -290,6 +290,10 @@ static inline void set_freepointer(struct kmem_cache *s,
> > void *object, void *fp)
> >  {
> >         unsigned long freeptr_addr = (unsigned long)object + s->offset;
> >
> > +#ifdef CONFIG_SLAB_FREELIST_HARDENED
> > +       BUG_ON(object == fp); /* naive detection of double free or corruption */
> > +#endif
> > +
> >         *(void **)freeptr_addr = freelist_ptr(s, fp, freeptr_addr);
>
> What happens if, instead of BUG_ON, we do:
>
> if (unlikely(WARN_RATELIMIT(object == fp, "double-free detected"))
>         return;

This may work for the free fastpath but the set_freepointer function is
use in multiple other locations. Maybe just add this to the fastpath
instead of to this fucnction?

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.