diff options
| author | Christian Brauner <brauner@kernel.org> | 2026-09-01 14:14:51 +0200 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-09-23 09:19:51 +0200 |
| commit | 025756ee7b476241270dd8ccbe17cc4c473800fa (patch) | |
| tree | 0d58995c7e0768ccbc9ae25c62a7ff5178ee725a /security/apparmor | |
| parent | e2f7f94b5a25ecfbb05df1437c5b46e848adc948 (diff) | |
| download | linux-next-025756ee7b476241270dd8ccbe17cc4c473800fa.tar.gz linux-next-025756ee7b476241270dd8ccbe17cc4c473800fa.zip | |
fs: port mnt_idmap() and file_mnt_idmap() to const mnt_idmap
Now that everything takes a mnt_idmap as const store a const pointer in
struct vfsmount, struct mount_kattr and struct kstatmount and return one
from mnt_idmap(), file_mnt_idmap() and ovl_upper_mnt_idmap(). Finally,
also make mnt_idmap_get() return a const pointer. Also convert the
remaining local variables that are initialized from the accessors.
alloc_mnt_idmap() keeps returning a non-const pointer. It is the only
place where an idmapping is actually written to.
Link: https://patch.msgid.link/20260901-work-idmap-const-v1-26-54ccd48e100b@kernel.org
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 'security/apparmor')
| -rw-r--r-- | security/apparmor/lsm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index d502ad0ac26f..c73681d820a0 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -397,7 +397,7 @@ static int apparmor_path_rename(const struct path *old_dir, struct dentry *old_d label = begin_current_label_crit_section(&needput); if (!unconfined(label)) { - struct mnt_idmap *idmap = mnt_idmap(old_dir->mnt); + const struct mnt_idmap *idmap = mnt_idmap(old_dir->mnt); vfsuid_t vfsuid; struct path old_path = { .mnt = old_dir->mnt, .dentry = old_dentry }; @@ -485,7 +485,7 @@ static int apparmor_file_open(struct file *file) label = aa_get_newest_cred_label_condref(file->f_cred, &needput); if (!unconfined(label)) { - struct mnt_idmap *idmap = file_mnt_idmap(file); + const struct mnt_idmap *idmap = file_mnt_idmap(file); struct inode *inode = file_inode(file); vfsuid_t vfsuid; struct path_cond cond = { |
