Linux filesystem development
 help / color / mirror / Atom feed
From: Casey Schaufler <casey@schaufler-ca.com>
To: Paul Moore <paul@paul-moore.com>, daan@amutable.com
Cc: Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	Casey Schaufler <casey@schaufler-ca.com>
Subject: Re: [PATCH v3 1/2] lsm: expose mount idmaps to inode hooks
Date: Tue, 8 Sep 2026 15:27:25 -0700	[thread overview]
Message-ID: <312cbf15-71d7-4fac-bee4-67fd237c5f5b@schaufler-ca.com> (raw)
In-Reply-To: <CAHC9VhS5q2=6p2bi5c7CZ3mutji1xiKR2eFKgJ9C+XZsYgky2g@mail.gmail.com>

On 9/8/2026 3:05 PM, Paul Moore wrote:
> On Fri, Sep 4, 2026 at 10:48 AM Daan De Meyer via B4 Relay
> <devnull+daan.amutable.com@kernel.org> wrote:
>> From: Daan De Meyer <daan@amutable.com>
>>
>> Pass the mount idmap through the create, link, symlink, mkdir, mknod,
>> and permission hooks. Update the in-tree security implementations and
>> non-VFS callers accordingly.
>>
>> Signed-off-by: Daan De Meyer <daan@amutable.com>
>> ---
>>  fs/cachefiles/security.c      |  4 +--
>>  fs/namei.c                    | 18 +++++++-------
>>  include/linux/lsm_hook_defs.h | 23 +++++++++--------
>>  include/linux/security.h      | 58 +++++++++++++++++++++++++------------------
>>  security/security.c           | 40 +++++++++++++++++------------
>>  security/selinux/hooks.c      | 19 +++++++++-----
>>  security/smack/smack_lsm.c    |  9 ++++---
>>  7 files changed, 100 insertions(+), 71 deletions(-)
> Casey, are you okay with the Smack changes (below)?

Yes, assuming the 80 character limit is adhered to.

>
>> diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
>> index 8e88ac65fd7f..a45819d13c0d 100644
>> --- a/security/smack/smack_lsm.c
>> +++ b/security/smack/smack_lsm.c
>> @@ -1089,14 +1089,15 @@ static int smack_inode_init_security(struct inode *inode, struct inode *dir,
>>
>>  /**
>>   * smack_inode_link - Smack check on link
>> + * @idmap: idmap of the mount
>>   * @old_dentry: the existing object
>>   * @dir: unused
>>   * @new_dentry: the new object
>>   *
>>   * Returns 0 if access is permitted, an error code otherwise
>>   */
>> -static int smack_inode_link(struct dentry *old_dentry, struct inode *dir,
>> -                           struct dentry *new_dentry)
>> +static int smack_inode_link(struct mnt_idmap *idmap, struct dentry *old_dentry,
>> +                           struct inode *dir, struct dentry *new_dentry)
>>  {
>>         struct smack_known *isp;
>>         struct smk_audit_info ad;
>> @@ -1226,6 +1227,7 @@ static int smack_inode_rename(struct inode *old_inode,
>>
>>  /**
>>   * smack_inode_permission - Smack version of permission()
>> + * @idmap: idmap of the mount
>>   * @inode: the inode in question
>>   * @mask: the access requested
>>   *
>> @@ -1233,7 +1235,8 @@ static int smack_inode_rename(struct inode *old_inode,
>>   *
>>   * Returns 0 if access is permitted, an error code otherwise
>>   */
>> -static int smack_inode_permission(struct inode *inode, int mask)
>> +static int smack_inode_permission(struct mnt_idmap *idmap, struct inode *inode,
>> +                                 int mask)
>>  {
>>         struct superblock_smack *sbsp = smack_superblock(inode->i_sb);
>>         struct smk_audit_info ad;
>>
>> --
>> 2.54.0

  reply	other threads:[~2026-09-08 23:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-04 14:48 [PATCH v3 0/2] lsm: expose mount idmaps to inode hooks Daan De Meyer via B4 Relay
2026-09-04 14:48 ` [PATCH v3 1/2] " Daan De Meyer via B4 Relay
2026-09-08 22:05   ` Paul Moore
2026-09-08 22:27     ` Casey Schaufler [this message]
2026-09-11 17:32       ` Paul Moore
2026-09-09 11:31     ` Daan De Meyer
2026-09-11 17:48       ` Paul Moore
2026-09-04 14:48 ` [PATCH v3 2/2] selftests/bpf: verify mount idmaps reach " Daan De Meyer via B4 Relay
2026-09-08 22:22   ` Paul Moore
2026-09-08 23:20     ` Matt Bobrowski
2026-09-11  3:25   ` Matt Bobrowski
2026-09-11 18:11     ` Paul Moore
2026-09-11 18:14   ` Paul Moore
2026-09-08 22:04 ` [PATCH v3 0/2] lsm: expose mount idmaps to " Paul Moore
2026-09-09 11:28 ` Christian Brauner

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=312cbf15-71d7-4fac-bee4-67fd237c5f5b@schaufler-ca.com \
    --to=casey@schaufler-ca.com \
    --cc=brauner@kernel.org \
    --cc=daan@amutable.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=viro@zeniv.linux.org.uk \
    /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