Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1311105

Re: [kernel-hardening] Re: [RFC] kernel/panic: place an upper limit on number of oopses

From Jann Horn <jann@thejh.net>
Newsgroups linux.kernel
Subject Re: [kernel-hardening] Re: [RFC] kernel/panic: place an upper limit on number of oopses
Date 2016-01-17 05:00 +0100
Message-ID <qRMFr-5u9-1@gated-at.bofh.it> (permalink)
References <qQcNJ-5oL-25@gated-at.bofh.it> <qQgHE-80F-23@gated-at.bofh.it> <qQhu2-8P-9@gated-at.bofh.it> <qQy1R-3qh-29@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Wed, Jan 13, 2016 at 07:08:19PM +0100, Jann Horn wrote:
> On Wed, Jan 13, 2016 at 03:20:43AM +0300, Solar Designer wrote:
> > Jann Horn <jann@thejh.net> wrote:
> > > To prevent an attacker from turning a mostly harmless oops into an
> > > exploitable issue using a refcounter wraparound caused by repeated
> > > oopsing, limit the number of oopses.
> > 
> > This may also reduce the likelihood of successful exploitation of some
> > other vulnerabilities involving memory corruption, where an unsuccessful
> > attempt may inadvertently trigger an Oops.  The attacker would then need
> > to succeed in fewer than the maximum allowed number of Oops'es.  Jann's
> > currently proposed default of 0x100000 is too high to make a difference
> > in that respect, but people may set it differently.
> 
> I chose such a high value to increase the likelyhood that this gets
> included in the kernel by default. Lower values would mitigate more
> attacks, but I'm not sure whether they'd be acceptable for everyone.
> 
> 
> > On Wed, Jan 13, 2016 at 10:34:39AM +1100, Daniel Axtens wrote:
> > > I'm torn between making the limit configurable and not adding to the
> > > massive proliferation of config options.
> > 
> > What about reusing panic_on_oops for the configurable limit?  The
> > currently supported values of 0 and 1 would retain their meaning,
> > 2 would panic after 2nd Oops, and so on.
> > 
> > There's overlap with grsecurity's banning of users on Oops, but I think
> > it makes sense to have both the trivial change proposed by Jann (perhaps
> > with the reuse of panic_on_oops for configuration) and grsecurity-style
> > banning (maybe with a low configurable limit, rather than always on
> > first Oops).
> 
> One edgecase here is that, afaik, grsecurity-style banning isn't very
> effective in combination with the subuid mechanism (implemented in
> userland, using the newuidmap setuid helper and /etc/subuid) because
> it allows every user to control 2^16 kuids (not just inside namespaces,
> but also indirectly in the init namespace).
> This probably doesn't affect many people though: Debian and Ubuntu ship
> newuidmap in a separate package "uidmap" that isn't installed by
> default and is only installed by a few people (0.18% on Debian
> according to popcon, those probably need it for unprivileged LXC or
> so?). Arch ships with newuidmap installed, but without /etc/subuid.
> I don't know what other distros do.

Aaand now grsecurity mitigates that (by panicking if too many uids
cause kernel crashes).

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [kernel-hardening] Re: [RFC] kernel/panic: place an upper limit  on number of oopses Jann Horn <jann@thejh.net> - 2016-01-17 05:00 +0100

csiph-web