All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Popov <alex.popov@linux.com>
To: zerons <zeronsaxm@gmail.com>
Cc: Andrey Konovalov <andreyknvl@google.com>,
	kernel-hardening@lists.openwall.com,
	Shawn <citypw@hardenedlinux.org>,
	spender@grsecurity.net, Jann Horn <jannh@google.com>,
	Kees Cook <keescook@chromium.org>
Subject: Re: Maybe inappropriate use BUG_ON() in CONFIG_SLAB_FREELIST_HARDENED
Date: Thu, 27 Feb 2020 14:28:30 +0300	[thread overview]
Message-ID: <04e89784-5ca8-0ecc-2735-4196ace74b0b@linux.com> (raw)
In-Reply-To: <68e01bc3-f218-01a1-2398-ec51ffa11109@gmail.com>

On 19.02.2020 16:43, zerons wrote:
> This patch does work for cve-2017-2636 case, it is barely impossible to win the
> race. My concern is based on an assumption: we do have a double kfree() bug and
> we can win the race.

Yes, I agree that the double-free check in CONFIG_SLAB_FREELIST_HARDENED can be
bypassed in some cases by winning the race and inserting kmalloc() between kfree().

But I *don't* agree that this double-free check can help the attacker.

Without this check in CONFIG_SLAB_FREELIST_HARDENED, double-free exploitation is
always easier, since the attacker has no need to race at all. In the write-up
about CVE-2017-2636 exploit [1] I showed how to do heap spray *after*
double-free (kfree-kfree-kmalloc-kmalloc).

Best regards,
Alexander

[1]: https://a13xp0p0v.github.io/2017/03/24/CVE-2017-2636.html

  reply	other threads:[~2020-02-27 11:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13 15:16 Maybe inappropriate use BUG_ON() in CONFIG_SLAB_FREELIST_HARDENED zerons
2020-02-17 15:15 ` Andrey Konovalov
2020-02-17 18:23   ` Kees Cook
2020-02-18  2:21     ` zerons
2020-02-18 20:54   ` Alexander Popov
2020-02-19 13:43     ` zerons
2020-02-27 11:28       ` Alexander Popov [this message]
2020-03-08  0:44         ` zerons

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=04e89784-5ca8-0ecc-2735-4196ace74b0b@linux.com \
    --to=alex.popov@linux.com \
    --cc=andreyknvl@google.com \
    --cc=citypw@hardenedlinux.org \
    --cc=jannh@google.com \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=spender@grsecurity.net \
    --cc=zeronsaxm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.