[PATCH RFC 17/19] proc: look up map_files vma without exec_update_lock held
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Tue Nov 24 23:09:19 UTC 2026
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] proc: separate __free() declaration and initialization in
map_files_mm()
--
commit 6e8b44b478838f53cfc44f13f68cf03b45a869ce
Author: Christian Brauner <brauner at kernel.org>
proc: look up map_files vma without exec_update_lock held
This commit restricts holding exec_update_lock during /proc/<pid>/map_files
symlink resolution to the access check and mm pinning in map_files_mm(),
performing the VMA lookup after releasing the lock.
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index 7685660c36241..b28bd6c57e1d8 100644
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -2228,18 +2228,40 @@ static const struct dentry_operations tid_map_files_dentry_operations = {
> .d_delete = pid_delete_dentry,
> };
>
> -static int map_files_get_link(struct dentry *dentry, struct path *path,
> - struct task_struct *task)
> +/* Check the access and pin the mm with exec_update_lock held. */
> +static struct mm_struct *map_files_mm(struct inode *inode)
> +{
> + struct task_struct *task __free(put_task) = NULL;
> + struct mm_struct *mm;
> + int err;
> +
> + task = get_proc_task(inode);
[Severity: Low]
This isn't a bug, but per the cleanup.h convention, task can be defined
and initialized with get_proc_task(inode) in a single statement rather
than being initialized to NULL and assigned right after.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261124-work-exec-update_lock-v1-0-e489035395b8@kernel.org?part=17
More information about the Linux-security-module-archive
mailing list