A process acquires a block channel the way a filesystem does (consumer-hello the device manager), confines ITSELF to blocks [1,3), then proves the clamp and the gate: volume-relative LBA 0 maps inside the range and reads; a read reaching past the range is refused; geometry reports the confined size; and a confined caller can no longer call define_range (no widening, no escape). It gates on argv so the ramdisk sweep leaves it silent in other boots, and coexists with fat (ranges are per-badge). Discrimination (verified by reverting usb-storage to pre-clamp f1bdce2~1): the unconfined read still succeeds but define_range returns ENOSYS, so the fixture cannot arm confinement and the case fails — exactly the property the clamp adds. With the clamp: block-range 1/1.
17 lines
731 B
Zig
17 lines
731 B
Zig
.{
|
|
.name = .block_range_test,
|
|
.version = "0.0.0",
|
|
.fingerprint = 0xa7f2045ed72783c3, // Changing this has security and trust implications.
|
|
.minimum_zig_version = "0.16.0",
|
|
.dependencies = .{
|
|
// build-support supplies the shared recipe; kernel is implicit in every
|
|
// binary. device (block, driver) and protocol (device-manager-protocol,
|
|
// envelope) are the homes of this fixture's remaining imports.
|
|
.@"build-support" = .{ .path = "../../../../build-support" },
|
|
.kernel = .{ .path = "../../../../library/kernel" },
|
|
.device = .{ .path = "../../../../library/device" },
|
|
.protocol = .{ .path = "../../../../library/protocol" },
|
|
},
|
|
.paths = .{""},
|
|
}
|