From: Junxiao Bi <junxiao.bi@oracle.com>
To: Paul Moore <paul@paul-moore.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
linux-kernel@vger.kernel.org,
linux-security-module@vger.kernel.org, jmorris@namei.org,
serge@hallyn.com, nathanl@linux.ibm.com, joe.jin@oracle.com,
Eric <eric.snowberg@oracle.com>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
axboe@kernel.dk
Subject: Re: Semantics of blktrace with lockdown (integrity) enabled kernel.
Date: Mon, 10 Apr 2023 15:31:15 -0700 [thread overview]
Message-ID: <22a584ab-db2b-813c-6f48-3840f56ee6cf@oracle.com> (raw)
In-Reply-To: <CAHC9VhSiviD9uHmB5sK4vgBBYnhUBPFyu+zM+O2m4ycie3RVqQ@mail.gmail.com>
On 4/10/23 3:00 PM, Paul Moore wrote:
>>> Well, you could always submit a patch* and we would review it like any
>>> other; that's usually a much better approach.
>>>
>>> * Yes, there was a patch submitted, but it was against a distro kernel
>>> that diverged significantly from the upstream kernel in the relevant
>>> areas.
>> Sure, i will submit a new one.
>>
>> Before that, may i ask this question? It may affect the approach of the
>> patch.
>>
>> Lockdown blocked files with mmap operation even that files are
>> read-only, may i know what's the security concern there?
>>
>> static int debugfs_locked_down(struct inode *inode,
>> struct file *filp,
>> const struct file_operations *real_fops)
>> {
>> if ((inode->i_mode & 07777 & ~0444) == 0 &&
>> !(filp->f_mode & FMODE_WRITE) &&
>> !real_fops->unlocked_ioctl &&
>> !real_fops->compat_ioctl &&
>> !real_fops->mmap)
>> return 0;
>>
>> if (security_locked_down(LOCKDOWN_DEBUGFS))
>> return -EPERM;
>>
>> return 0;
>> }
> I think the comment block at the top of that function describes it well:
>
> /*
> * Only permit access to world-readable files when the kernel is locked down.
> * We also need to exclude any file that has ways to write or alter it as root
> * can bypass the permissions check.
> */
I may have some misunderstanding of commit 5496197f9b08("debugfs:
Restrict debugfs when the kernel is locked down"), it mentioned chmod
is disabled for debugfs file, so i thought permission of debugfs file
can not be changed. Actually I just tested that, the permission can be
changed! I am not sure whether this is an issue or not. Anyway i
understand the security concern with mmap, thanks a lot.
Thanks,
Junxiao.
>
> --
> paul-moore.com
prev parent reply other threads:[~2023-04-10 22:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-06 17:37 Semantics of blktrace with lockdown (integrity) enabled kernel Konrad Rzeszutek Wilk
2023-04-06 18:39 ` Paul Moore
2023-04-06 19:30 ` Junxiao Bi
2023-04-06 21:30 ` Paul Moore
2023-04-06 19:32 ` Konrad Rzeszutek Wilk
2023-04-06 21:43 ` Paul Moore
2023-04-10 19:19 ` Junxiao Bi
2023-04-10 20:22 ` Paul Moore
2023-04-10 21:28 ` Junxiao Bi
2023-04-10 21:44 ` Paul Moore
2023-04-10 21:51 ` Junxiao Bi
2023-04-10 22:00 ` Paul Moore
2023-04-10 22:31 ` Junxiao Bi [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=22a584ab-db2b-813c-6f48-3840f56ee6cf@oracle.com \
--to=junxiao.bi@oracle.com \
--cc=axboe@kernel.dk \
--cc=boris.ostrovsky@oracle.com \
--cc=eric.snowberg@oracle.com \
--cc=jmorris@namei.org \
--cc=joe.jin@oracle.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=nathanl@linux.ibm.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;
as well as URLs for NNTP newsgroup(s).