From: Greg KH <gregkh@linuxfoundation.org>
To: kernel-hardening@lists.openwall.com
Cc: linux-kernel@vger.kernel.org,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Thomas Sailer <t.sailer@alumni.ethz.ch>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>,
"J. Bruce Fields" <bfields@fieldses.org>,
Jeff Layton <jlayton@poochiereds.net>,
David Howells <dhowells@redhat.com>, NeilBrown <neilb@suse.com>
Subject: [PATCH 0/4] make call_usermodehelper a bit more "safe"
Date: Mon, 16 Jan 2017 17:49:44 +0100 [thread overview]
Message-ID: <20170116164944.GA28984@kroah.com> (raw)
Hi all,
Here's a second cut at my attempt to make call_usermodehelper a bit more
"safe". It includes some patches from my previous series, and one new
one. In all, this is a much smaller patchset, with better functionality
in the end.
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.
This series addresses this issue by doing two different things. The
first 2 patches move a lot of existing call_usermodehelper binaries to
read-only memory, preventing them from being able to be changed at all.
The last patch introduces a new configuration option,
STATIC_USERMODEHELPER. This option routes all call_usermodehelper()
calls to a single userspace binary. That binary can then
filter/mediate/blacklist/whitelist/whatever the "real" usermodehelper
binaries and call them as needed (it determines the real one by looking
at the first argument.)
The location of this new binary can be set with the
STATIC_USERMODEHELPER_PATH configuration option.
If the user wants call_usermodehelper() to be disabled entirely,
STATIC_USERMODEHELPER_PATH can be set to "", which will cause all
call_usermodehelper() calls to do nothing, but return successful.
Many thanks to the reviewers of the last patch series for their hints on
how to mark strings properly to live in read-only memory always, and to
Neil Brown for the idea of STATIC_USERMODEHELPER.
If there are no complaints about these patches, I'll take them through
my driver-core tree.
thanks,
greg k-h
next reply other threads:[~2017-01-16 16:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-16 16:49 Greg KH [this message]
2017-01-16 16:50 ` [PATCH 1/3] kmod: make usermodehelper path a const string Greg KH
2017-01-16 16:50 ` [PATCH 2/3] Make static usermode helper binaries constant Greg KH
2017-01-16 21:25 ` J. Bruce Fields
2017-01-17 7:13 ` Greg KH
2017-01-17 15:19 ` J. Bruce Fields
2017-01-17 15:29 ` Greg KH
2017-01-19 12:03 ` [kernel-hardening] " Greg KH
2017-01-19 16:27 ` J. Bruce Fields
2017-01-17 15:45 ` Jeff Layton
2017-01-17 15:56 ` Greg KH
2017-01-17 16:07 ` Jeff Layton
2017-01-17 16:12 ` Greg KH
2017-01-16 16:50 ` [PATCH 3/3] Introduce STATIC_USERMODEHELPER to mediate call_usermodehelper() Greg KH
2017-01-17 16:20 ` Jeff Layton
2017-01-17 16:26 ` Greg KH
2017-01-17 16:52 ` Jeff Layton
2017-01-16 16:51 ` [PATCH 0/4] make call_usermodehelper a bit more "safe" Greg KH
2017-01-17 17:23 ` Kees Cook
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=20170116164944.GA28984@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=benh@kernel.crashing.org \
--cc=bfields@fieldses.org \
--cc=dhowells@redhat.com \
--cc=elder@kernel.org \
--cc=jlayton@poochiereds.net \
--cc=johan@kernel.org \
--cc=kernel-hardening@lists.openwall.com \
--cc=linux-kernel@vger.kernel.org \
--cc=neilb@suse.com \
--cc=rafael.j.wysocki@intel.com \
--cc=t.sailer@alumni.ethz.ch \
/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