Re: [PATCH v2] erofs: fix incorrect symlink detection in fast symlink

From: Colin Walters
Date: Mon Sep 09 2024 - 10:00:57 EST




On Mon, Sep 9, 2024, at 9:21 AM, Gao Xiang wrote:
>
> It can be bigger.
>
> Like ext4, EROFS supports PAGE_SIZE symlink via page_get_link()
> (non-fastsymlink cases), but mostly consider this as 4KiB though
> regardless of on-disk block sizes.

But symlink targets can't be bigger than PATH_MAX which has always been 4KiB right? (Does Linux support systems with sub-4KiB pages?)

I guess let me ask it a different way: Since we're removing a sanity check here I just want to be sure that the constraints are still handled.

Hmm, skimming through the vfs code from vfs_readlink() I'm not seeing anything constraining the userspace buffer length which seems surprising.

Ah interesting, XFS has
#define XFS_SYMLINK_MAXLEN 1024
and always constrains even its kmalloc invocation to that.