[PATCH v2] lsm: don't call d_path() when current->fs is NULL
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Fri Nov 6 11:15:36 UTC 2026
> When the last reference to a file is put from exit_task_work(), the task
> has already run exit_fs(), so current->fs is NULL.
>
> syzbot reported:
>
> Call trace:
> get_fs_root_rcu fs/d_path.c:244 [inline]
> d_path+0x224/0x4dc fs/d_path.c:287
> audit_log_d_path+0xdc/0x19c kernel/audit.c:2221
> audit_log_lsm_data+0xe0/0x12d0 security/lsm_audit.c:199
> dump_common_audit_data security/lsm_audit.c:421 [inline]
> ...
> security_file_open+0xec/0x258 security/security.c:2739
> do_dentry_open+0x2a8/0xfbc fs/open.c:973
> vfs_open+0x44/0x2dc fs/open.c:1101
> [ ... ]
>
> Fixes: 4a9d4b024a31 ("switch fput to task_work_add")
> Reported-by: syzbot+975ace299d6ba2eb1cea at syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=975ace299d6ba2eb1cea
> Signed-off-by: Drif Abdelmalek Mohamed Said <drifabdelmalekmohamedsaid at gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261106111016.5783-1-drifabdelmalekmohamedsaid@gmail.com?part=1
More information about the Linux-security-module-archive
mailing list