Page MenuHomeFreeBSD

ufs: Update *eofflag upon a read of an unlinked directory
ClosedPublic

Authored by markj on Dec 18 2023, 9:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 14, 12:41 PM
Unknown Object (File)
Fri, Dec 12, 4:55 PM
Unknown Object (File)
Thu, Dec 11, 12:16 PM
Unknown Object (File)
Sun, Dec 7, 5:38 AM
Unknown Object (File)
Sat, Dec 6, 9:50 PM
Unknown Object (File)
Sat, Nov 22, 3:34 AM
Unknown Object (File)
Thu, Nov 20, 7:53 PM
Unknown Object (File)
Nov 20 2025, 5:04 AM
Subscribers

Details

Summary

If the directory is unlinked, no further entries will be returned, but
we return no error. At least one caller (vn_dir_next_dirent()) asserts
that a VOP_READDIR call which returns no error and no entries will set
*eofflag != 0, so the current behaviour of UFS can trigger an assertion
failure.

Simply set *eofflag in this scenario.

Reported by: syzkaller

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable