From: Lorenzo Stoakes <ljs@kernel.org>
To: Chun-Yi Lee <joeyli.kernel@gmail.com>
Cc: "Rafael J . Wysocki" <rafael@kernel.org>,
Chun-Yi Lee <jlee@suse.com>, David Howells <dhowells@redhat.com>,
Andy Shevchenko <andy.shevchenko@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>,
Matthew Garrett <mjg59@srcf.ucam.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Danilo Krummrich <dakr@kernel.org>,
driver-core@lists.linux.dev, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v2] debugfs: Fix lockdown check for mmap_prepare
Date: Mon, 15 Jun 2026 12:18:29 +0100 [thread overview]
Message-ID: <ai_fWlr61AzrNrDz@lucifer> (raw)
In-Reply-To: <20260615104750.1000-1-jlee@suse.com>
On Mon, Jun 15, 2026 at 06:47:50PM +0800, Chun-Yi Lee wrote:
> From: Chun-Yi Lee <jlee@suse.com>
>
> Commit 651fdda8406d ("relay: update relay to use mmap_prepare")
> changed the `mmap` file operation to `mmap_prepare` for relayfs, but
> the lockdown check in debugfs was not updated accordingly.
>
> This prevents debugfs from being locked down when the kernel is in
> integrity mode if a file uses `mmap_prepare` but not `mmap`.
>
> Since the conversion to `mmap_prepare` across the kernel is not yet
> complete, update the lockdown check to look for both `mmap` and
> `mmap_prepare` to ensure comprehensive coverage.
>
> Fixes: 651fdda8406d ("relay: update relay to use mmap_prepare")
> Signed-off-by: Chun-Yi Lee <jlee@suse.com>
LGTM so:
Reviewed-by: Lorenzo Stoakes <ljs@kernel.org>
> Cc: David Howells <dhowells@redhat.com>
> Cc: Lorenzo Stoakes <ljs@kernel.org>
> Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Rafael J. Wysocki <rafael@kernel.org>
> Cc: Matthew Garrett <mjg59@srcf.ucam.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Danilo Krummrich <dakr@kernel.org>
> Cc: driver-core@lists.linux.dev
> Cc: linux-kernel@vger.kernel.org
> Cc: stable@vger.kernel.org
> ---
> v2:
> - Add explicit From tag to match Signed-off-by.
> - Fix Lorenzo's email address.
> - Add Cc stable for backporting.
> - Check both mmap and mmap_prepare as suggested by Lorenzo.
>
> fs/debugfs/file.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
> index edd6aafbfbaa..08de6652a4f3 100644
> --- a/fs/debugfs/file.c
> +++ b/fs/debugfs/file.c
> @@ -273,7 +273,8 @@ static int debugfs_locked_down(struct inode *inode,
> (!real_fops ||
> (!real_fops->unlocked_ioctl &&
> !real_fops->compat_ioctl &&
> - !real_fops->mmap)))
> + !real_fops->mmap &&
> + !real_fops->mmap_prepare)))
> return 0;
>
> if (security_locked_down(LOCKDOWN_DEBUGFS))
> --
> 2.43.0
>
Cheers, Lorenzo
next prev parent reply other threads:[~2026-06-15 11:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-15 10:47 [PATCH v2] debugfs: Fix lockdown check for mmap_prepare Chun-Yi Lee
2026-06-15 11:18 ` Lorenzo Stoakes [this message]
2026-06-15 14:54 ` joeyli
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=ai_fWlr61AzrNrDz@lucifer \
--to=ljs@kernel.org \
--cc=andy.shevchenko@gmail.com \
--cc=dakr@kernel.org \
--cc=dhowells@redhat.com \
--cc=driver-core@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=jlee@suse.com \
--cc=joeyli.kernel@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg59@srcf.ucam.org \
--cc=rafael@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
/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