Re: [PATCH v3 1/2] f2fs: avoid NULL checkpoint thread access in sysfs

Chao Yu <[email protected]> Tue, 4 Aug 2026 08:03:55 +0800
Newsgroups org.kernel.vger.linux-kernel,net.sourceforge.lists.linux-f2fs-devel
Message-ID <[email protected]>
On 8/3/26 20:32, Wenjie Qi wrote:
> checkpoint_merge can be enabled even when no checkpoint merge thread is
> running. A read-only mount is one case: f2fs does not start
> f2fs_issue_ckpt there, but ckpt_thread_ioprio is still writable through
> sysfs.
> 
> The ckpt_thread_ioprio store path updates the saved ioprio value and,
> when checkpoint_merge is enabled, calls set_task_ioprio() for the
> checkpoint thread. If cprc->f2fs_issue_ckpt is NULL, that dereferences a
> NULL task pointer.
> 
> Protect ckpt_thread_ioprio sysfs writes with s_umount as well, so the
> checkpoint thread cannot disappear under the store path while updating
> its ioprio.
> 
> Fixes: e65920661708 ("f2fs: add ckpt_thread_ioprio sysfs node")
> Cc: [email protected]
> Signed-off-by: Wenjie Qi <[email protected]>

Reviewed-by: Chao Yu <[email protected]>

Thanks,