mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Andy Lutomirski <luto@amacapital.net>
Cc: Tobias Markus <tobias@miglix.eu>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Serge Hallyn <serge.hallyn@canonical.com>,
	Andrew Morton <akpm@linuxfoundation.org>,
	Christoph Lameter <cl@linux.com>,
	"Michael Kerrisk \(man-pages\)" <mtk.manpages@gmail.com>,
	LSM List <linux-security-module@vger.kernel.org>,
	Linux API <linux-api@vger.kernel.org>,
	linux-man <linux-man@vger.kernel.org>,
	Richard Weinberger <richard.weinberger@gmail.com>,
	Yves-Alexis Perez <corsac@debian.org>,
	Austin S Hemmelgarn <ahferroin7@gmail.com>,
	Linux Containers <containers@lists.linux-foundation.org>
Subject: Re: [PATCH] userns/capability: Add user namespace capability
Date: Thu, 22 Oct 2015 16:44:49 -0500	[thread overview]
Message-ID: <874mhi4lym.fsf@x220.int.ebiederm.org> (raw)
In-Reply-To: <CALCETrWKN+Uzw_TYqVTGatNZ3LT5RbSM1WuYPoXeKQs9Yw_qjg@mail.gmail.com> (Andy Lutomirski's message of "Thu, 22 Oct 2015 14:02:09 -0700")

Andy Lutomirski <luto@amacapital.net> writes:

> At the risk of pointing out a can of worms, the attack surface also
> includes things like the iptables configuration APIs, parsers, and
> filter/conntrack/action modules.

It is worth noting that module auto-load does not happen if the
triggering code does not have the proper permissions in the initial user
namespace.

I agree that is another piece of code that should be counted.  How that
compares to the other 130,000 or so lines of code in the network stack
an unprivileged user can caused to be exercised already I don't know.
In my back of the napkin swag I had totally forgotten to count anything
in the network stack.

A lot of the netfilter code that I have read and looked at is
compartively simple and clean so I don't expect there is much risk
except from sheer volume of code there.

It is also tricky to count because the entire network side of the
networking stack is exposed to hostile users on the internet so anything
except the configuration is already exposed to hostile users.  The
average check entry is 15-20 lines long.  There appear to be 117 unique
check entry functions in the kernel so there may be another 2.5k lines of
code there.

Hmm.  And we have not had any design issues with the network stack.

Absent of design issues where the code even when implemented correctly
has the wrong semantics, we are left with the probability of exploitable
buggy code.  I suspect we have enough code even without user namespaces
enabled that the probability of exploitable buggy code someone in the
code that unprivilged users can cause to be exercised run is > 50%.

I wonder if there are any good statistical models that give realistic
estimates of those things.

Eric

  reply	other threads:[~2015-10-22 21:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-17 15:58 Tobias Markus
2015-10-17 20:17 ` Richard Weinberger
2015-10-18 20:13   ` Tobias Markus
2015-10-18 20:21     ` Richard Weinberger
2015-10-18 20:41       ` Tobias Markus
2015-10-18 20:48         ` Richard Weinberger
2015-10-18 21:49           ` Tobias Markus
2015-10-18 22:06             ` Richard Weinberger
2015-10-19  0:28     ` Mike Frysinger
2015-10-17 21:55 ` Serge E. Hallyn
2015-10-18 20:13   ` Tobias Markus
2015-10-19  1:41     ` Serge E. Hallyn
2015-10-19 12:36       ` Yves-Alexis Perez
2015-10-19 12:48         ` Richard Weinberger
2015-10-22 20:45     ` Eric W. Biederman
2015-10-22 21:02       ` Andy Lutomirski
2015-10-22 21:44         ` Eric W. Biederman [this message]
2015-10-19 14:24 ` Austin S Hemmelgarn
2015-10-21 18:53   ` Andy Lutomirski
2015-10-21 19:13     ` Austin S Hemmelgarn
2015-10-22 17:10       ` Andy Lutomirski

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=874mhi4lym.fsf@x220.int.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=ahferroin7@gmail.com \
    --cc=akpm@linuxfoundation.org \
    --cc=cl@linux.com \
    --cc=containers@lists.linux-foundation.org \
    --cc=corsac@debian.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mtk.manpages@gmail.com \
    --cc=richard.weinberger@gmail.com \
    --cc=serge.hallyn@canonical.com \
    --cc=serge@hallyn.com \
    --cc=tobias@miglix.eu \
    --cc=viro@zeniv.linux.org.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome