Re: [PATCH] f2fs: validate dentry name length before lookup compares it

From: Chao Yu

Date: Sun Jun 14 2026 - 23:20:17 EST


On 6/4/26 00:11, Samuel Moelius wrote:
> The f2fs dentry lookup path can use the on-disk name length before
> checking that the name fits in the dentry filename area. A corrupted
> dentry can then make lookup read beyond the filename slots.
>
> The bounds check needs to happen before any comparison that consumes
> the name length from disk.
>
> Reject dentries with invalid name lengths before comparing their names.

Will be better to merge two patch into one:

f2fs: validate inline dentry name lengths before conversion
f2fs: validate dentry name length before lookup compares it

>
> Assisted-by: Codex:gpt-5.5-cyber-preview
> Signed-off-by: Samuel Moelius <sam.moelius@xxxxxxxxxxxxxxx>

Anyway, this patch looks good to me.

Reviewed-by: Chao Yu <chao@xxxxxxxxxx>

Thanks,