Re: [PATCH v2] hpfs: reject dirents with an invalid length in hpfs_count_dnodes()
From: Quchaosheng
Date: Thu Sep 17 2026 - 03:50:38 EST
Hi Mikulas,
Thanks for looking at it, and you are right. I checked the syzbot reproducer
and it mounts with
eas=no,case=asis,check=none,
so this only reproduces with check=none, which is the documented behaviour:
"no fs checks - kernel may crash on corrupted filesystem". The check in
hpfs_map_dnode() does cover the dirent chain that hpfs_count_dnodes() walks
(from offset 20 up to first_free, which is exactly the range the walk covers),
so with the default check=normal the walk is already bounded.
I also should have added an "Assisted-by: LLM ..." tag to this submission per
Documentation/process/coding-assistants.rst, and did not. Sorry for the noise
and for the extra round trip.
Please drop the patch.
Thanks,
Quchaosheng