mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Paul Moore <paul@paul-moore.com>
Cc: Christian Brauner <brauner@kernel.org>,
	Daan De Meyer <daan@amutable.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: linux-next: manual merge of the security tree with the vfs-brauner tree
Date: Wed, 23 Sep 2026 15:25:31 +0200	[thread overview]
Message-ID: <arPTSwCBIDM9uhRd@sirena.co.uk> (raw)

[-- Attachment #1: Type: text/plain, Size: 8840 bytes --]

Hi all,

Today's linux-next merge of the security tree got conflicts in:

  include/linux/security.h
  include/linux/lsm_hook_defs.h

between commit:

  ad664d41535a5 ("fs: port ->tmpfile() to pass const mnt_idmap")

from the vfs-brauner tree and commit:

  16959c469f232 ("lsm: expose mount idmaps to inode hooks")

from the security tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --cc include/linux/lsm_hook_defs.h
index c9561564585e7,af9624c30f99d..0000000000000
--- a/include/linux/lsm_hook_defs.h
+++ b/include/linux/lsm_hook_defs.h
@@@ -121,29 -120,30 +121,35 @@@ LSM_HOOK(int, -EOPNOTSUPP, inode_init_s
  	 int *xattr_count)
  LSM_HOOK(int, 0, inode_init_security_anon, struct inode *inode,
  	 const struct qstr *name, const struct inode *context_inode)
- LSM_HOOK(int, 0, inode_create, struct inode *dir, struct dentry *dentry,
- 	 umode_t mode)
 -LSM_HOOK(int, 0, inode_create, struct mnt_idmap *idmap, struct inode *dir,
++LSM_HOOK(int, 0, inode_create, const struct mnt_idmap *idmap, struct inode *dir,
+ 	 struct dentry *dentry, umode_t mode)
 -LSM_HOOK(void, LSM_RET_VOID, inode_post_create_tmpfile, struct mnt_idmap *idmap,
 +LSM_HOOK(void, LSM_RET_VOID, inode_post_create_tmpfile, const struct mnt_idmap *idmap,
  	 struct inode *inode)
- LSM_HOOK(int, 0, inode_link, struct dentry *old_dentry, struct inode *dir,
- 	 struct dentry *new_dentry)
+ LSM_HOOK(int, 0, inode_link, struct mnt_idmap *idmap,
+ 	 struct dentry *old_dentry, struct inode *dir, struct dentry *new_dentry)
  LSM_HOOK(int, 0, inode_unlink, struct inode *dir, struct dentry *dentry)
- LSM_HOOK(int, 0, inode_symlink, struct inode *dir, struct dentry *dentry,
- 	 const char *old_name)
- LSM_HOOK(int, 0, inode_mkdir, struct inode *dir, struct dentry *dentry,
- 	 umode_t mode)
+ LSM_HOOK(int, 0, inode_symlink, struct mnt_idmap *idmap, struct inode *dir,
+ 	 struct dentry *dentry, const char *old_name)
+ LSM_HOOK(int, 0, inode_mkdir, struct mnt_idmap *idmap, struct inode *dir,
+ 	 struct dentry *dentry, umode_t mode)
  LSM_HOOK(int, 0, inode_rmdir, struct inode *dir, struct dentry *dentry)
- LSM_HOOK(int, 0, inode_mknod, struct inode *dir, struct dentry *dentry,
- 	 umode_t mode, dev_t dev)
+ LSM_HOOK(int, 0, inode_mknod, struct mnt_idmap *idmap, struct inode *dir,
+ 	 struct dentry *dentry, umode_t mode, dev_t dev)
  LSM_HOOK(int, 0, inode_rename, struct inode *old_dir, struct dentry *old_dentry,
  	 struct inode *new_dir, struct dentry *new_dentry)
  LSM_HOOK(int, 0, inode_readlink, struct dentry *dentry)
  LSM_HOOK(int, 0, inode_follow_link, struct dentry *dentry, struct inode *inode,
  	 bool rcu)
++<<<<<<< HEAD
 +LSM_HOOK(int, 0, inode_permission, struct inode *inode, int mask)
 +LSM_HOOK(int, 0, inode_setattr, const struct mnt_idmap *idmap, struct dentry *dentry,
++=======
+ LSM_HOOK(int, 0, inode_permission, struct mnt_idmap *idmap,
+ 	 struct inode *inode, int mask)
+ LSM_HOOK(int, 0, inode_setattr, struct mnt_idmap *idmap, struct dentry *dentry,
++>>>>>>> security/next
  	 struct iattr *attr)
 -LSM_HOOK(void, LSM_RET_VOID, inode_post_setattr, struct mnt_idmap *idmap,
 +LSM_HOOK(void, LSM_RET_VOID, inode_post_setattr, const struct mnt_idmap *idmap,
  	 struct dentry *dentry, int ia_valid)
  LSM_HOOK(int, 0, inode_getattr, const struct path *path)
  LSM_HOOK(int, 0, inode_xattr_skipcap, const char *name)
diff --cc include/linux/ns/ns_common_types.h
index 6ed6b497831c7,5cfe0ce3c8818..0000000000000
--- a/include/linux/ns/ns_common_types.h
+++ b/include/linux/ns/ns_common_types.h
@@@ -116,8 -116,13 +116,11 @@@ struct ns_common 
  	struct dentry *stashed;
  	const struct proc_ns_operations *ops;
  	unsigned int inum;
 +	struct ns_tree;
 +	struct rcu_head ns_rcu;
+ #ifdef CONFIG_SECURITY
+ 	void *ns_security;
+ #endif
 -	union {
 -		struct ns_tree;
 -		struct rcu_head ns_rcu;
 -	};
  };
  
  #define to_ns_common(__ns)                                    \
diff --cc include/linux/security.h
index f7ff72ff956b7,7bb073f734f60..0000000000000
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@@ -405,33 -406,37 +407,37 @@@ int security_inode_init_security(struc
  int security_inode_init_security_anon(struct inode *inode,
  				      const struct qstr *name,
  				      const struct inode *context_inode);
- int security_inode_create(struct inode *dir, struct dentry *dentry, umode_t mode);
 -int security_inode_create(struct mnt_idmap *idmap, struct inode *dir,
++int security_inode_create(const struct mnt_idmap *idmap, struct inode *dir,
+ 			  struct dentry *dentry, umode_t mode);
 -void security_inode_post_create_tmpfile(struct mnt_idmap *idmap,
 +void security_inode_post_create_tmpfile(const struct mnt_idmap *idmap,
  					struct inode *inode);
- int security_inode_link(struct dentry *old_dentry, struct inode *dir,
- 			 struct dentry *new_dentry);
+ int security_inode_link(struct mnt_idmap *idmap, struct dentry *old_dentry,
+ 			struct inode *dir, struct dentry *new_dentry);
  int security_inode_unlink(struct inode *dir, struct dentry *dentry);
- int security_inode_symlink(struct inode *dir, struct dentry *dentry,
- 			   const char *old_name);
- int security_inode_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode);
+ int security_inode_symlink(struct mnt_idmap *idmap, struct inode *dir,
+ 			   struct dentry *dentry, const char *old_name);
+ int security_inode_mkdir(struct mnt_idmap *idmap, struct inode *dir,
+ 			 struct dentry *dentry, umode_t mode);
  int security_inode_rmdir(struct inode *dir, struct dentry *dentry);
- int security_inode_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev);
+ int security_inode_mknod(struct mnt_idmap *idmap, struct inode *dir,
+ 			 struct dentry *dentry, umode_t mode, dev_t dev);
  int security_inode_rename(struct inode *old_dir, struct dentry *old_dentry,
  			  struct inode *new_dir, struct dentry *new_dentry,
  			  unsigned int flags);
  int security_inode_readlink(struct dentry *dentry);
  int security_inode_follow_link(struct dentry *dentry, struct inode *inode,
  			       bool rcu);
- int security_inode_permission(struct inode *inode, int mask);
 -int security_inode_permission(struct mnt_idmap *idmap, struct inode *inode,
++int security_inode_permission(const struct mnt_idmap *idmap, struct inode *inode,
+ 			      int mask);
 -int security_inode_setattr(struct mnt_idmap *idmap,
 +int security_inode_setattr(const struct mnt_idmap *idmap,
  			   struct dentry *dentry, struct iattr *attr);
 -void security_inode_post_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 +void security_inode_post_setattr(const struct mnt_idmap *idmap, struct dentry *dentry,
  				 int ia_valid);
  int security_inode_getattr(const struct path *path);
 -int security_inode_setxattr(struct mnt_idmap *idmap,
 +int security_inode_setxattr(const struct mnt_idmap *idmap,
  			    struct dentry *dentry, const char *name,
  			    const void *value, size_t size, int flags);
 -int security_inode_set_acl(struct mnt_idmap *idmap,
 +int security_inode_set_acl(const struct mnt_idmap *idmap,
  			   struct dentry *dentry, const char *acl_name,
  			   struct posix_acl *kacl);
  void security_inode_post_set_acl(struct dentry *dentry, const char *acl_name,
@@@ -917,12 -920,13 +927,13 @@@ static inline int security_inode_create
  }
  
  static inline void
 -security_inode_post_create_tmpfile(struct mnt_idmap *idmap, struct inode *inode)
 +security_inode_post_create_tmpfile(const struct mnt_idmap *idmap, struct inode *inode)
  { }
  
- static inline int security_inode_link(struct dentry *old_dentry,
- 				       struct inode *dir,
- 				       struct dentry *new_dentry)
+ static inline int security_inode_link(struct mnt_idmap *idmap,
+ 				      struct dentry *old_dentry,
+ 				      struct inode *dir,
+ 				      struct dentry *new_dentry)
  {
  	return 0;
  }
diff --git a/security/security.c b/security/security.c
index 5e5c73bfdd93a..09b0af1c0d656 100644
--- a/security/security.c
+++ b/security/security.c
@@ -1662,7 +1662,7 @@ int security_path_chroot(const struct path *path)
  *
  * Return: Returns 0 if permission is granted.
  */
-int security_inode_create(struct mnt_idmap *idmap, struct inode *dir,
+int security_inode_create(const struct mnt_idmap *idmap, struct inode *dir,
 			  struct dentry *dentry, umode_t mode)
 {
 	if (unlikely(IS_PRIVATE(dir)))

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2026-09-23 13:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23 13:25 Mark Brown [this message]
2026-09-23 15:39 ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2026-09-14 11:48 Mark Brown
2026-09-14 13:18 ` Jori Koolstra
2026-04-06 14:05 Mark Brown
2024-09-10  3:27 Stephen Rothwell
2024-09-10 19:45 ` Paul Moore
2023-11-20  3:31 Stephen Rothwell
2023-11-20 21:09 ` Paul Moore

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=arPTSwCBIDM9uhRd@sirena.co.uk \
    --to=broonie@kernel.org \
    --cc=brauner@kernel.org \
    --cc=daan@amutable.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=paul@paul-moore.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

all inboxes | Powered by JetHome®