All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vegard Nossum <vegard.nossum@oracle.com>
To: James Morris <jmorris@namei.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Dave Jones <davej@redhat.com>, Kees Cook <keescook@chromium.org>,
	"Theodore Ts'o" <tytso@mit.edu>,
	LKML <linux-kernel@vger.kernel.org>,
	Tommi Rantala <tt.rantala@gmail.com>,
	Ingo Molnar <mingo@kernel.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Andy Lutomirski <luto@amacapital.net>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Alan Cox <alan@linux.intel.com>, Jason Wang <jasowang@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	James Morris <james.l.morris@oracle.com>
Subject: Re: [PATCH 1/9] Known exploit detection
Date: Fri, 13 Dec 2013 11:21:10 +0100	[thread overview]
Message-ID: <52AADF96.4090602@oracle.com> (raw)
In-Reply-To: <alpine.LRH.2.02.1312131557340.32454@tundra.namei.org>

On 12/13/2013 06:09 AM, James Morris wrote:
> On Thu, 12 Dec 2013, Greg Kroah-Hartman wrote:
>
>> On Thu, Dec 12, 2013 at 07:25:23PM -0500, Dave Jones wrote:
>>> On Thu, Dec 12, 2013 at 01:13:41PM -0800, Kees Cook wrote:
>>>
>>>   > - who will keep adding these triggers going forward?
>>>
>
> I think we'd need to have someone commit to maintaining this long term
> before seriously considering it as part of mainline.  Over time it will
> become increasingly useless if new triggers aren't added.

Based on your input, we (the Ksplice team) will probably set up a public 
git repository where we maintain these patches on top of the latest 
released kernel.

> What happens when code is refactored, who refactors the triggers?
>
>>> also..
>>>
>>> - Who will test the existing triggers are doing the right thing when related code changes.
>>

I don't think refactoring or maintenance is a huge issue. The triggers 
are mostly one-liners in the error path of a specific input validation 
check.

I haven't maintained these patches for a very long time, but at least 
nothing came up in the six months of development that I've had these 
patches sitting for.

I'd say the person doing the refactoring should also take care to 
maintain the trigger, but if it just doesn't make sense anymore, it can 
also just be taken out.

In any case, maintaining a public git repository alongside mainline will 
give us some experience with overcoming refactoring/code changes.

>> And:
>>    - how do you determine an "expoit attempt" from "userspace program
>>      doing something stupid" / "corrupted filesytem mounted"?
>>
>
> Right, and if there are enough false positives, it'll end up being quite
> useless.
>
> I suspect this kind of thing is better done in userspace anti-malware
> scanning.
>
>> I really don't like this, it means that our normal error handling for
>> userspace data will suddenly all have CVE entries on them over time.
>> How is that helpful to anyone?
>>
>> Think ahead in 10-20 years, what is the code paths going to look like
>> then?  Horrible...
>
> Agree.
>
> This could make an interesting research project outside of the kernel. It
> doesn't belong in mainline without at least first being proven in the
> field and also properly maintained long term, if at all.
>

I already suggested a 5-year expiry date for any triggers we add. It's 
easy to retire them based on the CVE (or other) identifier that includes 
the year (possibly combined with git blame and friends).

I also think the set of triggers should be limited to serious bugs that 
could lead to privilege escalation. There are not THAT many of them. 
There are probably fewer than 20 every year, which would cap the total 
number of triggers at 100 in the whole kernel at any given time.

The point is NOT to add triggers in every error path in the kernel, of 
course not. Triggers should only be added where there's a real 
possibility of the bug actually being exploited. I thought about 
requiring a proof-of-concept exploit code to be provided with each 
trigger as well, but that could be too hard to be useful in practice, 
since actually exploiting any given potential privilege escalation bug 
could require a lot of ingenuity.

Thanks,


Vegard

  parent reply	other threads:[~2013-12-13 10:23 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-12 16:52 [PATCH 1/9] Known exploit detection vegard.nossum
2013-12-12 16:52 ` [PATCH 2/9] exploit: report to audit subsystem when available vegard.nossum
2013-12-12 16:52 ` [PATCH 3/9] hfs: Known exploit detection for CVE-2011-4330 vegard.nossum
2013-12-13  8:00   ` Dan Carpenter
2013-12-12 16:52 ` [PATCH 4/9] net: Known exploit detection for CVE-2012-2136 vegard.nossum
2013-12-12 16:52 ` [PATCH 5/9] hfsplus: Known exploit detection for CVE-2012-2319 vegard.nossum
2013-12-13  1:40   ` Greg Kroah-Hartman
2013-12-13 11:14   ` One Thousand Gnomes
2013-12-12 16:52 ` [PATCH 6/9] x86: Known exploit detection for CVE-2013-0268 vegard.nossum
2013-12-12 16:52 ` [PATCH 7/9] drm/i915: Known exploit detection for CVE-2013-0913 vegard.nossum
2013-12-12 16:52 ` [PATCH 8/9] userns: Known exploit detection for CVE-2013-1959 vegard.nossum
2013-12-12 16:52 ` [PATCH 9/9] perf: Known exploit detection for CVE-2013-2094 vegard.nossum
2013-12-12 19:06 ` [PATCH 1/9] Known exploit detection Theodore Ts'o
2013-12-12 21:13   ` Kees Cook
2013-12-12 23:50     ` Ryan Mallon
2013-12-12 23:55       ` Kees Cook
2013-12-13 11:10         ` One Thousand Gnomes
2013-12-13 14:21           ` Jiri Kosina
2013-12-13  9:20       ` Vegard Nossum
2013-12-13 22:49         ` Ryan Mallon
2013-12-13 13:06       ` Ingo Molnar
2013-12-13 15:55         ` Jason Cooper
2013-12-13 23:07         ` Ryan Mallon
2013-12-13  0:25     ` Dave Jones
2013-12-13  0:45       ` Andy Lutomirski
2013-12-13  1:42       ` Greg Kroah-Hartman
2013-12-13  1:44         ` Dave Jones
2013-12-13  5:09         ` James Morris
2013-12-13  5:46           ` Theodore Ts'o
2013-12-13 13:19             ` Ingo Molnar
2013-12-13 10:21           ` Vegard Nossum [this message]
2013-12-13 10:31         ` Alexander Holler
2013-12-13 11:48           ` Dan Carpenter
2013-12-13 11:57             ` Greg Kroah-Hartman
2013-12-13 13:23             ` Ingo Molnar
2013-12-13 18:00               ` Kees Cook
2013-12-13 17:58         ` Kees Cook
2013-12-13 18:14           ` Linus Torvalds
2013-12-13 18:37             ` Kees Cook
2013-12-13  5:27     ` Theodore Ts'o
2013-12-13  9:32       ` Jiri Kosina
2013-12-13 18:07       ` Kees Cook
2013-12-13  9:12     ` Vegard Nossum
2013-12-13 13:27       ` Ingo Molnar
2013-12-13  8:20   ` Vegard Nossum
2013-12-14 23:59   ` Ryan Mallon
2013-12-13 12:54 ` Ingo Molnar
2013-12-16  5:17 ` Sasha Levin
2013-12-19  6:14 ` David Rientjes

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=52AADF96.4090602@oracle.com \
    --to=vegard.nossum@oracle.com \
    --cc=alan@linux.intel.com \
    --cc=dan.carpenter@oracle.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=davej@redhat.com \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=james.l.morris@oracle.com \
    --cc=jasowang@redhat.com \
    --cc=jmorris@namei.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@kernel.org \
    --cc=tt.rantala@gmail.com \
    --cc=tytso@mit.edu \
    /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.