From: Greg KH <gregkh@linuxfoundation.org>
To: NeilBrown <neilb@suse.com>
Cc: kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org
Subject: Re: [RFC 0/4] make call_usermodehelper a bit more "safe"
Date: Fri, 16 Dec 2016 04:49:13 -0800 [thread overview]
Message-ID: <20161216124913.GB31485@kroah.com> (raw)
In-Reply-To: <87k2b0wus6.fsf@notabene.neil.brown.name>
On Fri, Dec 16, 2016 at 12:02:33PM +1100, NeilBrown wrote:
> On Thu, Dec 15 2016, Greg KH wrote:
>
> > Hi all,
> >
> > Here's a proof-of-concept patch series that tries to work to address the
> > issue of call_usermodehelper being abused to have the kernel call any
> > userspace binary with full root permissions.
> >
> > The issue is that if you end up getting write access to kernel memory,
> > if you change the string '/sbin/hotplug' to point to
> > '/home/hacked/my_binary', then the next uevent that the system makes
> > will call this binary instead of the "trusted" one.
>
> You seem to be targeting a situation where the kernel memory can be
> easily changed, but filesystem content cannot (if it could - the
> attacker would simply replace /sbin/hotplug).
Correct, like an embedded system with a read-only system partition, or
for when some kernel bug allows for random memory writes, yet privilege
escalation is hard to achieve for your process.
> If that is a credible threat scenario, it seems to me that the simplest
> mitigation is to have call_usermodehelper always call a single
> compiled-in path - e.g. /sbin/usermode-helper - and rely on that
> program to validate argv[0] and call it if it is deemed safe.
>
> i.e. get the policy out of the kernel.
Ah, that's a nice idea. It's one step more flexible than the "just
disable usermodehelper entirely", which is what I was going to do after
this all got reworked, while still allowing a system that relied on only
one or two of these usermodehelper apps to still operate normally. And
it allows for all of those future users of the api to not have to be
manually audited. Punting the issue to userspace is something I always
love to do :)
I'll try that out on an Android system after the holiday break to see
how feasible that would be, thanks for the idea!
greg k-h
next prev parent reply other threads:[~2016-12-16 12:49 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-14 18:50 [RFC 0/4] make call_usermodehelper a bit more "safe" Greg KH
2016-12-14 18:50 ` [PATCH 1/4] kmod: make usermodehelper path a const string Greg KH
2016-12-14 18:50 ` [PATCH 2/4] drbd: rename "usermode_helper" to "drbd_usermode_helper" Greg KH
2016-12-14 18:50 ` [PATCH 3/4] Make static usermode helper binaries constant Greg KH
2016-12-14 19:11 ` [kernel-hardening] " Greg KH
2016-12-14 20:29 ` Rich Felker
2016-12-14 20:54 ` Greg KH
2016-12-15 17:54 ` Greg KH
2016-12-15 20:51 ` Daniel Micay
2016-12-15 21:18 ` Greg KH
2016-12-16 0:05 ` Daniel Micay
2016-12-16 0:14 ` Daniel Micay
2016-12-14 18:51 ` [RFC 4/4] Introduce CONFIG_READONLY_USERMODEHELPER Greg KH
2016-12-14 20:31 ` Kees Cook
2016-12-14 20:57 ` Greg KH
2016-12-14 19:25 ` [kernel-hardening] [RFC 0/4] make call_usermodehelper a bit more "safe" Mark Rutland
2016-12-14 20:16 ` Kees Cook
2016-12-14 21:28 ` Jason A. Donenfeld
2016-12-14 23:16 ` Greg Kroah-Hartman
2016-12-16 1:02 ` NeilBrown
2016-12-16 12:49 ` Greg KH [this message]
2016-12-19 13:34 ` Jiri Kosina
2016-12-20 9:27 ` Greg KH
2016-12-20 10:27 ` Jiri Kosina
2016-12-20 10:31 ` Jiri Kosina
2016-12-20 10:48 ` Greg KH
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=20161216124913.GB31485@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=kernel-hardening@lists.openwall.com \
--cc=linux-kernel@vger.kernel.org \
--cc=neilb@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox