Fix potential TOCTTOU bug in the geli tests
ClosedPublic

Authored by asomers on Thu, Dec 28, 6:05 PM.

Details

Summary

Fix potential TOCTTOU bug in the geli tests

This change mostly reverts r293436, which introduced the bug due to a belief
that geli(8) would allocate md(4) devices by itself. However, that belief is
incorrect. Instead of using linear probing to find available md(4) numbers,
it's best to use the existing attach_md function.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
asomers created this revision.Thu, Dec 28, 6:05 PM
asomers updated this revision to Diff 37151.Thu, Dec 28, 7:03 PM

Add missing cleanup step

This revision was not accepted when it landed; it landed in state Needs Review.Fri, Dec 29, 4:06 PM
Closed by commit rS327346: Fix potential TOCTTOU bug in the geli tests (authored by asomers, committed by ). · Explain Why
This revision was automatically updated to reflect the committed changes.