From: Igor Stoppa <igor.stoppa@huawei.com>
To: Sargun Dhillon <sargun@sargun.me>,
<linux-security-module@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: <penguin-kernel@i-love.sakura.ne.jp>, <keescook@chromium.org>,
<casey@schaufler-ca.com>, <jmorris@namei.org>,
<sds@tycho.nsa.gov>, <paul@paul-moore.com>, <plautrba@redhat.com>
Subject: Re: [PATCH v4 0/1] Safe LSM (un)loading, and immutable hooks
Date: Thu, 5 Apr 2018 12:55:33 +0300 [thread overview]
Message-ID: <911d9855-cd45-26f0-90eb-563db899d5ee@huawei.com> (raw)
In-Reply-To: <cover.1522560550.git.sargun@sargun.me>
On 01/04/18 08:41, Sargun Dhillon wrote:
> The biggest security benefit of this patchset is the introduction of
> read-only hooks, even if some security modules have mutable hooks.
> Currently, if you have any LSMs with mutable hooks it will render all heads, and
> list nodes mutable. These are a prime place to attack, because being able to
> manipulate those hooks is a way to bypass all LSMs easily, and to create a
> persistent, covert channel to intercept nearly all calls.
>
>
> If LSMs have a model to be unloaded, or are compled as modules, they should mark
> themselves mutable at compile time, and use the LSM_HOOK_INIT_MUTABLE macro
> instead of the LSM_HOOK_INIT macro, so their hooks are on the mutable
> chain.
I'd rather consider these types of hooks:
A) hooks that are either const or marked as RO after init
B) hooks that are writable for a short time, long enough to load
additional, non built-in modules, but then get locked down
I provided an example some time ago [1]
C) hooks that are unloadable (and therefore always attackable?)
Maybe type-A could be dropped and used only as type-B, if it's
acceptable that type-A hooks are vulnerable before lock-down of type-B
hooks.
I have some doubts about the usefulness of type-C, though.
The benefit I see htat it brings is that it avoids having to reboot when
a mutable LSM is changed, at the price of leaving it attackable.
Do you have any specific case in mind where this trade-off would be
acceptable?
[1] https://lkml.org/lkml/2017/7/10/403
--
igor
next prev parent reply other threads:[~2018-04-05 9:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-01 5:41 Sargun Dhillon
2018-04-01 5:41 ` [PATCH v4 1/1] security: Add mechanism to safely (un)load LSMs after boot time Sargun Dhillon
2018-04-05 9:55 ` Igor Stoppa [this message]
2018-04-05 10:31 ` [PATCH v4 0/1] Safe LSM (un)loading, and immutable hooks Peter Dolding
2018-04-05 11:34 ` Igor Stoppa
2018-04-05 12:28 ` Peter Dolding
2018-04-05 16:29 ` Casey Schaufler
2018-04-06 1:50 ` Sargun Dhillon
[not found] ` <CAMp4zn95V1BLg5n0MT6F1qGdu=aHxC7_kZr36tZ=pqYB80aQ7g@mail.gmail.com>
2018-04-06 4:12 ` Peter Dolding
2018-04-06 16:31 ` Casey Schaufler
2018-04-07 9:26 ` Peter Dolding
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=911d9855-cd45-26f0-90eb-563db899d5ee@huawei.com \
--to=igor.stoppa@huawei.com \
--cc=casey@schaufler-ca.com \
--cc=jmorris@namei.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=plautrba@redhat.com \
--cc=sargun@sargun.me \
--cc=sds@tycho.nsa.gov \
/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
all inboxes | Powered by JetHome®