From: <dan.j.williams@intel.com>
To: Nicolas Bouchinet <nicolas.bouchinet@oss.cyber.gouv.fr>,
Nikolay Borisov <nik.borisov@suse.com>
Cc: <linux-security-module@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <paul@paul-moore.com>,
<serge@hallyn.com>, <jmorris@namei.org>,
<dan.j.williams@intel.com>
Subject: Re: [PATCH v2 0/3] Allow individual features to be locked down
Date: Tue, 5 Aug 2025 16:43:28 -0700 [thread overview]
Message-ID: <68929720cd3b7_184e1f100e4@dwillia2-xfh.jf.intel.com.notmuch> (raw)
In-Reply-To: <kl4rvgnupxnz4zrwlofrawdfy23tj2ylp5s3wovnsjxkr6tbrt@x5s3avqo2e7t>
Nicolas Bouchinet wrote:
> Hi Nikolay,
>
> Thanks for you patch.
>
> Quoting Kees [1], Lockdown is "about creating a bright line between
> uid-0 and ring-0".
>
> Having a bitmap enabled Lockdown would mean that Lockdown reasons could
> be activated independently. I fear this would lead to a false sense of
> security, locking one reason alone often permits Lockdown restrictions
> bypass. i.e enforcing kernel module signature verification but not
> blocking accesses to `/dev/{k,}mem` or authorizing gkdb which can be
> used to disable the module signature enforcement.
>
> If one wants to restrict accesses to `/dev/mem`,
> `security_locked_down(LOCKDOWN_DEV_MEM)` should be sufficient.
>
> My understanding of your problem is that this locks too much for your
> usecase and you want to restrict reasons of Lockdown independently in
> case it has not been enabled in "integrity" mode by default ?
>
> Can you elaborate more on the usecases for COCO ?
Nikolay already shared some of this but the succinct answer is that COCO
breaks the fundamental expectations of /dev/mem that the only
requirement to map memory is to install a page table entry for it.
For COCO an additional step is needed to decide if the memory is private
to the COCO guest VM (cVM) or shared with the host VMM. If it is private
it additionally must be "accepted" by the cVM before it can be mapped.
/dev/mem allows uncoordinated mapping attempts and at present causes
memory protection violations because the /dev/mem backend attetmps to
map it as shared, but another part of the kernel expects it is only
mapped as cVM-private.
The attempt to communicate the mapping type, control for the acceptance
status resulted in a pile of hacks, or even just add another
COCO-specific check near the existing
"security_locked_down(LOCKDOWN_DEV_MEM)" check were met with "please
just use LOCKDOWN_DEV_MEM" directly and be done.
prev parent reply other threads:[~2025-08-05 23:43 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-28 11:15 [PATCH v2 0/3] Allow individual features to be locked down Nikolay Borisov
2025-07-28 11:15 ` [PATCH v2 1/3] lockdown: Switch implementation to using bitmap Nikolay Borisov
2025-07-28 12:47 ` Serge E. Hallyn
2025-07-28 13:21 ` Serge E. Hallyn
2025-08-05 22:18 ` dan.j.williams
2025-07-28 11:15 ` [PATCH v2 2/3] lockdown/kunit: Introduce kunit tests Nikolay Borisov
2025-07-28 12:49 ` Serge E. Hallyn
2025-07-28 22:04 ` kernel test robot
2025-07-29 7:46 ` Nikolay Borisov
2025-07-29 23:28 ` Philip Li
2025-07-29 7:30 ` kernel test robot
2025-07-28 11:15 ` [PATCH v2 3/3] lockdown: Use snprintf in lockdown_read Nikolay Borisov
2025-07-28 12:39 ` Serge E. Hallyn
2025-08-05 7:56 ` Nikolay Borisov
2025-08-05 22:30 ` dan.j.williams
2025-07-29 12:16 ` [PATCH v2 0/3] Allow individual features to be locked down Nicolas Bouchinet
2025-07-29 12:25 ` Nikolay Borisov
2025-08-05 6:57 ` xiujianfeng
2025-08-05 8:03 ` Nikolay Borisov
2025-08-05 23:28 ` dan.j.williams
2025-08-14 8:59 ` Nicolas Bouchinet
2025-08-14 10:02 ` Nikolay Borisov
2025-08-14 10:51 ` Nicolas Bouchinet
2025-08-05 23:43 ` dan.j.williams [this message]
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=68929720cd3b7_184e1f100e4@dwillia2-xfh.jf.intel.com.notmuch \
--to=dan.j.williams@intel.com \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=nicolas.bouchinet@oss.cyber.gouv.fr \
--cc=nik.borisov@suse.com \
--cc=paul@paul-moore.com \
--cc=serge@hallyn.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