diff options
| author | Haobin Wu <853555@gmail.com> | 2026-09-18 10:48:51 +0800 |
|---|---|---|
| committer | Dominique Martinet <asmadeus@codewreck.org> | 2026-09-22 08:10:39 +0000 |
| commit | 55d6732b8015705a657d96fc5bd37fbed349624a (patch) | |
| tree | 55d034e63f0a0780b13cf229b566f954811d96ba /scripts/basic | |
| parent | edd807dc2031c62f8358b81a48956ac762bc8a1d (diff) | |
| download | linux-55d6732b8015705a657d96fc5bd37fbed349624a.tar.gz linux-55d6732b8015705a657d96fc5bd37fbed349624a.zip | |
9p: skip over-long directory entry names for legacy 9p2000 too
The legacy 9p2000 and 9p2000.u readdir path, v9fs_dir_readdir(), parses
each entry with p9stat_read() and, unlike the 9p2000.L path, never had
a 256-byte name limit: a name of any length up to the wire maximum was
handed to dir_emit(). getdents64() therefore returned names longer than
NAME_MAX that no later syscall can use, and failed with -EIO for names
of PATH_MAX bytes or more.
Apply the same NAME_MAX check as the previous patch does for
v9fs_dir_readdir_dotl(), so both protocol variants behave the same.
Note that this is a behaviour change for 9p2000 and 9p2000.u,
Name length 256..4095:
- before: listed, but unusable (ENAMETOOLONG)
- now: entry skipped, fetch continues
Name length >=4096:
- before: aborts the entire fetch (similar to 9p2000.L side)
- now: entry skipped, fetch continues
Suggested-by: Christian Schoenebeck <linux_oss@crudebyte.com>
Link: https://lore.kernel.org/all/3910569.MHq7AAxBmi@weasel/
Signed-off-by: Haobin Wu <853555@gmail.com>
Message-ID: <20260918024851.51229-4-853555@gmail.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Diffstat (limited to 'scripts/basic')
0 files changed, 0 insertions, 0 deletions
