summaryrefslogtreecommitdiff
path: root/include/linux/security.h
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2026-09-01 14:14:42 +0200
committerChristian Brauner <brauner@kernel.org>2026-09-23 09:19:50 +0200
commitad664d41535a5a8183b15a98ecfa948f5f88779f (patch)
tree8c5c4c8ff01eb9473f4ad42e1f76202c7923ef42 /include/linux/security.h
parent03a56ee3418b8e2cc3218b1a671bf75de2e4b7ad (diff)
downloadlinux-next-ad664d41535a5a8183b15a98ecfa948f5f88779f.tar.gz
linux-next-ad664d41535a5a8183b15a98ecfa948f5f88779f.zip
fs: port ->tmpfile() to pass const mnt_idmap
Convert to const struct mnt_idmap. A mount's idmapping is immutable. The only thing that is allowed to be modified afterwards is the reference count and that is hidden behind mnt_idmap_get() and mnt_idmap_put(). Everything else only ever reads from the idmapping. This is the same model that struct cred uses and the idmapping is also rather sensitive. So make the idmap argument const wherever we can. The conversion is done from the bottom up so callers can continue to pass a non-const pointer to a const parameter until the conversion is finished. No functional changes. Link: https://patch.msgid.link/20260901-work-idmap-const-v1-17-54ccd48e100b@kernel.org Acked-by: Paul Moore <paul@paul-moore.com> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Seth Forshee <sforshee@kernel.org> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Diffstat (limited to 'include/linux/security.h')
-rw-r--r--include/linux/security.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/security.h b/include/linux/security.h
index d5832750418a..b07a85e6aed4 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -405,7 +405,7 @@ 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);
-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);
@@ -910,7 +910,7 @@ static inline int security_inode_create(struct inode *dir,
}
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,