All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jann Horn <jann@thejh.net>
To: Daniel Axtens <dja@axtens.net>
Cc: kernel-hardening@lists.openwall.com,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Baoquan He <bhe@redhat.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Subject: Re: [RFC] kernel/panic: place an upper limit on number of oopses
Date: Wed, 13 Jan 2016 00:51:17 +0100	[thread overview]
Message-ID: <20160112235117.GA2537@pc.thejh.net> (raw)
In-Reply-To: <87mvsa5q40.fsf@gamma.ozlabs.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 852 bytes --]

On Wed, Jan 13, 2016 at 10:34:39AM +1100, Daniel Axtens wrote:
> Jann Horn <jann@thejh.net> writes:
> > +	 * limit is reached, just panic.
> > +	 * The constant used as limit should be low enough to
> > +	 * mitigate this kind of exploitation attempt, but high
> > +	 * enough to avoid unnecessary panics.
> > +	 */
> > +	if (atomic_inc_return(&oops_counter) >= 0x100000 &&
> > +			panic_on_oops == 0) {
> Do you need to check panic_on_oops? If it was 1 you'd already have
> paniced, right?
[...]
> > +		pr_emerg("oopsed too often, setting panic_on_oops=1\n");
> > +		panic_on_oops = 1;
> Would it be easier to just panic here, rather than wait for another oops?

Ah, yes. So the code would be just this, apart from the definition of
oops_counter:

        if (atomic_inc_return(&oops_counter) >= 0x100000)
                panic("oopsed too often\n");

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Jann Horn <jann@thejh.net>
To: Daniel Axtens <dja@axtens.net>
Cc: kernel-hardening@lists.openwall.com,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Baoquan He <bhe@redhat.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Subject: [kernel-hardening] Re: [RFC] kernel/panic: place an upper limit on number of oopses
Date: Wed, 13 Jan 2016 00:51:17 +0100	[thread overview]
Message-ID: <20160112235117.GA2537@pc.thejh.net> (raw)
In-Reply-To: <87mvsa5q40.fsf@gamma.ozlabs.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 852 bytes --]

On Wed, Jan 13, 2016 at 10:34:39AM +1100, Daniel Axtens wrote:
> Jann Horn <jann@thejh.net> writes:
> > +	 * limit is reached, just panic.
> > +	 * The constant used as limit should be low enough to
> > +	 * mitigate this kind of exploitation attempt, but high
> > +	 * enough to avoid unnecessary panics.
> > +	 */
> > +	if (atomic_inc_return(&oops_counter) >= 0x100000 &&
> > +			panic_on_oops == 0) {
> Do you need to check panic_on_oops? If it was 1 you'd already have
> paniced, right?
[...]
> > +		pr_emerg("oopsed too often, setting panic_on_oops=1\n");
> > +		panic_on_oops = 1;
> Would it be easier to just panic here, rather than wait for another oops?

Ah, yes. So the code would be just this, apart from the definition of
oops_counter:

        if (atomic_inc_return(&oops_counter) >= 0x100000)
                panic("oopsed too often\n");

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-01-12 23:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-12 19:25 [RFC] kernel/panic: place an upper limit on number of oopses Jann Horn
2016-01-12 19:25 ` [kernel-hardening] " Jann Horn
2016-01-12 23:34 ` Daniel Axtens
2016-01-12 23:34   ` [kernel-hardening] " Daniel Axtens
2016-01-12 23:51   ` Jann Horn [this message]
2016-01-12 23:51     ` Jann Horn
2016-01-13  0:20   ` Solar Designer
2016-01-13  0:20     ` [kernel-hardening] " Solar Designer
2016-01-13  0:33     ` Daniel Axtens
2016-01-13  0:33       ` [kernel-hardening] " Daniel Axtens
2016-01-13 18:08     ` Jann Horn
2016-01-13 18:08       ` [kernel-hardening] " Jann Horn
2016-01-17  3:58       ` Jann Horn

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=20160112235117.GA2537@pc.thejh.net \
    --to=jann@thejh.net \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=d.hatayama@jp.fujitsu.com \
    --cc=dja@axtens.net \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=vkuznets@redhat.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.