Page MenuHomeFreeBSD

Ensure that d_off is initialized
ClosedPublic

Authored by markj on Dec 28 2020, 12:39 AM.
Tags
None
Referenced Files
F139332837: D27792.diff
Wed, Dec 10, 10:49 PM
Unknown Object (File)
Wed, Nov 26, 1:36 PM
Unknown Object (File)
Tue, Nov 25, 3:18 PM
Unknown Object (File)
Tue, Nov 18, 5:21 AM
Unknown Object (File)
Nov 3 2025, 12:15 PM
Unknown Object (File)
Nov 3 2025, 12:15 PM
Unknown Object (File)
Nov 3 2025, 12:10 PM
Unknown Object (File)
Nov 3 2025, 12:09 PM
Subscribers

Details

Summary

We have the d_off field in struct dirent for providing the offset of the
next directory entry. Several filesystems did not populate the field,
which ends up being leaked.

Reported by: Syed Faraz Abrar <faraz@elttam.com>

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 35721
Build 32610: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Dec 28 2020, 8:03 PM

I don't remember much about how directory entries work, but I don't see anything wrong with the patch. I have a question, though: how did it work before? Is that field actually used?

d_off was added during ino64 work, for supposed benefit of nfs server. I believe the idea was that d_off use could replace cookies.

Right now it is not used, and d_off presence is optional. If d_off is zero, userspace has to use other methods (lseek ?) to bookmark directory position.