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
F171165094: D43089.id.diff
Wed, Sep 9, 4:11 AM
Unknown Object (File)
Sun, Sep 6, 5:31 AM
Unknown Object (File)
Sun, Sep 6, 2:37 AM
Unknown Object (File)
Sun, Sep 6, 1:56 AM
Unknown Object (File)
Sat, Sep 5, 12:03 PM
Unknown Object (File)
Sat, Sep 5, 10:57 AM
Unknown Object (File)
Sat, Sep 5, 7:33 AM
Unknown Object (File)
Thu, Sep 3, 11:54 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