Page MenuHomeFreeBSD

bhyve blockif: fix blockif_candelete with Capsicum
ClosedPublic

Authored by chuck on Nov 30 2021, 7:49 PM.
Tags
None
Referenced Files
F158134429: D33203.id99259.diff
Thu, May 28, 9:27 PM
F158134334: D33203.id99259.diff
Thu, May 28, 9:26 PM
F158132655: D33203.id99266.diff
Thu, May 28, 9:11 PM
Unknown Object (File)
Mon, May 25, 9:48 PM
Unknown Object (File)
Thu, May 7, 12:16 PM
Unknown Object (File)
Wed, May 6, 12:29 PM
Unknown Object (File)
Wed, May 6, 12:24 PM
Unknown Object (File)
Sun, May 3, 9:23 AM

Details

Summary

NVMe conformance tests for the Format command failed if the
backing-storage for the bhyve device was a file instead of a Zvol. The
tests (and the specification) expect a Format to destroy all previously
written data. The bhyve NVMe emulation implements this by trimming /
deallocating all data from the backing-storage.

The blockif_candelete() function indicated the file did not support
deallocation (i.e. fpathconf(..., _PC_DEALLOC_PRESENT) returned FALSE)
even though the kernel supported file hole punching. This occurs on
builds with Capsicum enabled because blockif did not allow the
fpathconf(2) right.

Fix is to add CAP_FPATHCONF to the cap_rights_init(3) call.

PR: 260081

Diff Detail

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