Page MenuHomeFreeBSD

Fix potential race condition in linux stat(2)
ClosedPublic

Authored by trasz on Jul 11 2020, 1:19 PM.
Tags
None
Referenced Files
F166498810: D25618.diff
Thu, Aug 13, 8:39 PM
F166498553: D25618.id78510.diff
Thu, Aug 13, 8:39 PM
F166495042: D25618.id78510.diff
Thu, Aug 13, 8:30 PM
F166470103: D25618.id74301.diff
Thu, Aug 13, 6:29 PM
F166323530: D25618.id.diff
Wed, Aug 12, 10:07 PM
Unknown Object (File)
Wed, Aug 12, 5:20 PM
Unknown Object (File)
Mon, Aug 10, 8:18 PM
Unknown Object (File)
Mon, Aug 10, 3:07 AM
Subscribers

Details

Summary

Fix potential race condition in linux stat(2).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

trasz requested review of this revision.Jul 11 2020, 1:19 PM
sys/compat/linux/linux_util.c
206 ↗(On Diff #74301)

Can we use vnode lock to guarantee liveness of the v_rdev read ? This is how it was intended.

sys/compat/linux/linux_util.c
206 ↗(On Diff #74301)

Do we need to? I've looked at vn_isdisk(), and it doesn't seem to use the vnode lock.

kib added inline comments.
sys/compat/linux/linux_util.c
206 ↗(On Diff #74301)

It uses dev_mtx, same as you did, which is global and already contended mutex.

Ok, it probably would be better to do the global sweep for vn_isdisk(), finishing mjg half-done change.

This revision is now accepted and ready to land.Oct 20 2020, 1:45 PM
This revision was automatically updated to reflect the committed changes.