From: Daniel Micay <danielmicay@gmail.com>
To: kernel-hardening@lists.openwall.com, Kees Cook <keescook@chromium.org>
Cc: David Windsor <dave@progbits.org>
Subject: Re: [kernel-hardening][RFC PATCH v2 00/12] Add PAX_REFCOUNT overflow protection
Date: Wed, 20 Jan 2016 20:01:12 -0500 [thread overview]
Message-ID: <1453338072.4942.16.camel@gmail.com> (raw)
In-Reply-To: <1453323437.6344.32.camel@debian.org>
[-- Attachment #1: Type: text/plain, Size: 2669 bytes --]
On Wed, 2016-01-20 at 21:57 +0100, Yves-Alexis Perez wrote:
> On mar., 2016-01-19 at 11:07 -0800, Kees Cook wrote:
> > Hi David,
> >
> > On Thu, Dec 17, 2015 at 12:55 PM, Kees Cook <keescook@chromium.org>
> > wrote:
> > > On Thu, Dec 17, 2015 at 6:57 AM, David Windsor <dave@progbits.org>
> > > wrote:
> > > > NOTE: This is a v2 submission because patch 3/5 in v1 was too
> > > > large to
> > > > sent
> > > > to kernel-hardening. Taking that as a sign that the patch
> > > > needed to be
> > > > split,
> > > > I'm sending this version of the patchset, with the patches split
> > > > more or
> > > > less
> > > > on a per-maintainer basis (except for those in drivers/).
> >
> > How's the next spin coming? It looks like we have some new real-
> > world
> > examples of exploits that would have been blocked by this
> > protection:
> >
> > http://perception-point.io/2016/01/14/analysis-and-exploitation-of-a
> > -linux-k
> > ernel-vulnerability-cve-2016-0728/
> >
> >
> One thing which is surprising (I have to admit I'm not really an
> expert on how
> SLAB works) is how easy it apparently is to have multiple allocations
> end up
> at the same place. You don't even have to *know* the exact address.
>
> Wouldn't it be possible to at least have some randomization here, so
> new
> object are not at the same place as the not-freed-ones, somehow
> preventing the
> use-after-free and forcing an attacker to do some heap massaging?
>
> Regards,
It could do some fine-grained randomization. It does have a measurable
performance cost since it makes allocations colder and there isn't much
room for adding entropy but it does add up over time. Depending on the
locking design it could also hurt there too.
Take a look at OpenBSD malloc if you're interested in it. It has a few
forms of randomization and they do add up:
* small array of quarantined pointers, free(ptr) randomly swaps with one
and frees that (wastes some memory, makes allocations colder) - can also
have a feature checking that junk filled for sanitization is still in
place when moving out of the quarantine at a further performance cost
(which I recently upstreamed for OpenBSD malloc)
* picking a random slot within a slab (makes allocations colder and
slows down the allocator a bit)
* picking a random slab list to satisfy each allocation (significantly
increases worst-case memory usage by spreading stuff out)
* page cache randomization (i.e. randomization of the layer below slabs
which in userspace means the allocator cache and fine-grained mmap rnd,
but it still applies to the kernel's allocation of the slab pages)
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-01-21 1:01 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-17 14:57 [kernel-hardening][RFC PATCH v2 00/12] Add PAX_REFCOUNT overflow protection David Windsor
2015-12-17 14:57 ` [kernel-hardening][RFC PATCH v2 01/12] x86: add PAX_REFCOUNT support David Windsor
2015-12-17 17:16 ` Greg KH
2015-12-17 17:55 ` David Windsor
2015-12-17 18:11 ` Greg KH
2015-12-17 18:23 ` David Windsor
2015-12-17 19:46 ` Greg KH
2015-12-18 2:59 ` David Windsor
2015-12-17 14:57 ` [kernel-hardening][RFC PATCH v2 02/12] percpu_ref: decrease per-CPU refcount bias David Windsor
2015-12-17 20:56 ` Kees Cook
2015-12-17 14:57 ` [kernel-hardening][RFC PATCH v2 03/12] kernel: opt out of PAX_REFCOUNT protection David Windsor
2015-12-17 14:57 ` [kernel-hardening][RFC PATCH v2 04/12] mm: " David Windsor
2015-12-17 14:57 ` [kernel-hardening][RFC PATCH v2 05/12] fs: " David Windsor
2015-12-17 14:57 ` [kernel-hardening][RFC PATCH v2 06/12] net: " David Windsor
2015-12-17 14:57 ` [kernel-hardening][RFC PATCH v2 07/12] security: " David Windsor
2015-12-17 14:57 ` [kernel-hardening][RFC PATCH v2 08/12] drivers: opt out of PAX_REFCOUNT protection (1 of 2) David Windsor
2015-12-17 14:57 ` [kernel-hardening][RFC PATCH v2 09/12] drivers: opt out of PAX_REFCOUNT protection (2 " David Windsor
2015-12-17 14:57 ` [kernel-hardening][RFC PATCH v2 10/12] pax: opt out of PAX_REFCOUNT protection David Windsor
2015-12-17 14:57 ` [kernel-hardening][RFC PATCH v2 11/12] security: add Kconfig options for PAX_REFCOUNT David Windsor
2015-12-17 20:53 ` Kees Cook
2015-12-17 14:57 ` [kernel-hardening][RFC PATCH v2 12/12] lkdtm: add test for atomic_t underflow/overflow David Windsor
2015-12-17 20:55 ` [kernel-hardening][RFC PATCH v2 00/12] Add PAX_REFCOUNT overflow protection Kees Cook
2016-01-19 19:07 ` Kees Cook
2016-01-20 13:11 ` David Windsor
2016-02-02 11:33 ` David Windsor
2016-02-04 18:19 ` Kees Cook
2016-04-21 20:37 ` Kees Cook
2016-04-28 12:16 ` [kernel-hardening][RFC PATCH 0/5] " David Windsor
2016-01-20 20:57 ` [kernel-hardening][RFC PATCH v2 00/12] " Yves-Alexis Perez
2016-01-20 23:39 ` Kees Cook
2016-01-21 1:01 ` Daniel Micay [this message]
2016-01-21 12:45 ` Yves-Alexis Perez
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=1453338072.4942.16.camel@gmail.com \
--to=danielmicay@gmail.com \
--cc=dave@progbits.org \
--cc=keescook@chromium.org \
--cc=kernel-hardening@lists.openwall.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.