Skip to content

Conversation

@tych0
Copy link
Collaborator

@tych0 tych0 commented Mar 17, 2022

Let's get rid of the FIXME's and make re-use of existing devices actually
safe. We can access the existing root-hash through device-mapper directly
(there does not seem to be any way through cryptsetup). Of course, there is
no static-build-able version of libdevmapper bindings anywhere (the only
real bindings are in moby/docker, and they disabled static builds some time
ago). So, let's just write our own tiny bit of cgo for the stuff we want to
extract.

Note that there is already a test case for the happy path: the third test
case in test/atomfs.bats relies on pre-existing verity devices, so we only
add a negative test case here.

Signed-off-by: Tycho Andersen tycho@tycho.pizza

tych0 added 2 commits March 17, 2022 10:14
Let's get rid of the FIXME's and make re-use of existing devices actually
safe. We can access the existing root-hash through device-mapper directly
(there does not seem to be any way through cryptsetup). Of course, there is
no static-build-able version of libdevmapper bindings anywhere (the only
real bindings are in moby/docker, and they disabled static builds some time
ago). So, let's just write our own tiny bit of cgo for the stuff we want to
extract.

Note that there is already a test case for the happy path: the third test
case in test/atomfs.bats relies on pre-existing verity devices, so we only
add a negative test case here.

Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
We choose the AllowMissing double negative because that allows for a
default to false so that things are secure-by-default.

Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
@tych0 tych0 force-pushed the add-devmapper-calls branch from af72448 to 3602f83 Compare March 17, 2022 22:53
@tych0 tych0 merged commit a37207b into project-stacker:master Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant