<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/meta-security.git/classes, branch nanbield</title>
<subtitle>Mirror of git.yoctoproject.org/meta-security.git</subtitle>
<id>https://git.enea.com/cgit/linux/meta-security.git/atom?h=nanbield</id>
<link rel='self' href='https://git.enea.com/cgit/linux/meta-security.git/atom?h=nanbield'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-security.git/'/>
<updated>2023-06-25T19:05:28+00:00</updated>
<entry>
<title>dm-verity: add wks.in fragment with dynamic build hash data</title>
<updated>2023-06-25T19:05:28+00:00</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2023-06-21T17:13:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-security.git/commit/?id=3b88f75323bd399615eb6c0897b13cbb59e35e64'/>
<id>urn:sha1:3b88f75323bd399615eb6c0897b13cbb59e35e64</id>
<content type='text'>
Export the dynamic build data for consumption in wic image generation.

It can either be included directly or manually parsed for useful chunks
in custom configurations people end up making.

For convenience, it is placed alongside the work-shared/dm-verity dir
where we already store the plain environment file and the veritysetup
formatting argument that was used.

There is a subtle thing going on here with respect to using an include,
which warrants a mention.  The wic (wks.in) stuff only has access to
normal Yocto/OE/bitbake variables.

So, instead of a fragment, say if you had:
   DM_VERITY_ROOT_HASH = "__not_set__"
and then later, did a:
   d.setVar("DM_VERITY_ROOT_HASH", value)
after the image was built, and the hash was known - that seems sane.

But the problem is that once you do that, your variables are tracked
by default, and bitbake/lib/bb/siggen.py will be angry with you for
changing metadata during a build.  In theory one should be able to avoid
this with BB_BASEHASH_IGNORE_VARS and "vardepsexclude" but it means more
exposed variables, and as much as I tried, I couldn't get this to work.

Creating a fragment with the dynamic data for inclusion avoids all that.
The wks template itself remains static, and hence doesn't trigger warns.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Armin Kuster &lt;akuster808@gmail.com&gt;
</content>
</entry>
<entry>
<title>dm-verity: add support for hash storage on separate partition</title>
<updated>2023-06-25T19:05:28+00:00</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2023-06-21T17:13:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-security.git/commit/?id=4922b3053af9e0f66a3e0a65bd25b9f51df3a4f9'/>
<id>urn:sha1:4922b3053af9e0f66a3e0a65bd25b9f51df3a4f9</id>
<content type='text'>
There are essentially two ways for dealing with where to put the hash
data for dm-verity block integrity checks.

You can store both in a single partition, by using ~95% of the storage
space for the filesystem and the remaining 5% tail for the hash, or you
can use a completely separate partition (or even device) for storing the
hash data elsewhere.

Method A relies on using a hash offset argument during creation, which
is generally OK from a scripted use case but is error prone when run
from the command line and the offset calculated manually.

Method B has the advantage of using the basic partition/device
compartmentalization of the kernel to ensure the fs data doesn't
overwrite the hash or vice versa.  It takes any possible errors due to
math miscalculations completely off the table.

At the moment, our current support is hard coded to only support the
offset method A.  Here we add support for separate hash as per B.

As multiple partitions are now in play, we use the UUID creation
standard adopted by the systemd/verity community which implicitly links
the root and hash partitions by splitting the top roothash in two for
the UUIDs of the components.

This change optionally creates the separate hash file but no examples
use it yet.  Further commits will implement an example.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Armin Kuster &lt;akuster808@gmail.com&gt;
</content>
</entry>
<entry>
<title>dm-verity: save veritysetup args beside runtime environment</title>
<updated>2023-06-25T19:05:28+00:00</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2023-06-21T17:13:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-security.git/commit/?id=39c69c8b5dd56730c469c90e934f8b0606331d3b'/>
<id>urn:sha1:39c69c8b5dd56730c469c90e934f8b0606331d3b</id>
<content type='text'>
We already have this directory to save the environment variable settings
so they can be copied into the initramfs for runtime setup.

There are quite a few veritysetup args, and the nature of storing the
hash data after the filesystem data in an "oversized" partition can be
error prone due to rounding, fencepost errors, etc.

Save a copy of what we used for ease of debug inspection, and for basic
cut and paste use in experimentation and tweaking.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Armin Kuster &lt;akuster808@gmail.com&gt;
</content>
</entry>
<entry>
<title>dm-verity: restructure the veritysetup arg parsing</title>
<updated>2023-06-25T19:05:28+00:00</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2023-06-21T17:13:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-security.git/commit/?id=fc12521b08071a56d03e3c95ea0ae3bb00f77259'/>
<id>urn:sha1:fc12521b08071a56d03e3c95ea0ae3bb00f77259</id>
<content type='text'>
In making changes to the existing veritysetup arg list, it is harder to
see what the proposed change is since they are are glued together on one
long line.  Break them up so reviewing future unified diffs will be more
easy to visually parse.

This also makes it easier to temp. dump the args to a file for debugging.

In theory this should have no functional change.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Armin Kuster &lt;akuster808@gmail.com&gt;
</content>
</entry>
<entry>
<title>dm-verity-img.bbclass: Fix the hash offset alignment issue</title>
<updated>2023-03-20T20:27:24+00:00</updated>
<author>
<name>Kevin Hao</name>
<email>kexin.hao@windriver.com</email>
</author>
<published>2023-03-15T02:12:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-security.git/commit/?id=a7f73ab5918c79fcaec7d6638a2f801c8dc2aeb9'/>
<id>urn:sha1:a7f73ab5918c79fcaec7d6638a2f801c8dc2aeb9</id>
<content type='text'>
When using the kernel module parameter "dm-mod.create=" [1] to create
the device-mapper device, the hash offset address we passed to kernel
module is the hash block number. That means the hash offset address
would have to be aligned to the max(data_block_size, hash_block_size),
otherwise there would be no way to set the correct hash offset address
via "dm-mo.create=".

[1] https://www.kernel.org/doc/Documentation/admin-guide/device-mapper/dm-init.rst

Signed-off-by: Kevin Hao &lt;kexin.hao@windriver.com&gt;
Signed-off-by: Armin Kuster &lt;akuster808@gmail.com&gt;
</content>
</entry>
<entry>
<title>dm-verity-img.bbclass: fix syntax warning</title>
<updated>2023-03-20T20:27:24+00:00</updated>
<author>
<name>Eero Aaltonen</name>
<email>eero.aaltonen@vaisala.com</email>
</author>
<published>2023-03-09T13:04:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-security.git/commit/?id=4c786d4e098188912525d45af5d5cbe947adb0de'/>
<id>urn:sha1:4c786d4e098188912525d45af5d5cbe947adb0de</id>
<content type='text'>
Fixes warning
```
SyntaxWarning: "is not" with a literal. Did you mean "!="?
```

Signed-off-by: Eero Aaltonen &lt;eero.aaltonen@vaisala.com&gt;
Signed-off-by: Armin Kuster &lt;akuster808@gmail.com&gt;
</content>
</entry>
<entry>
<title>dm-verity-img.bbclass: add squashfs images</title>
<updated>2023-02-11T15:36:23+00:00</updated>
<author>
<name>Maciej Borzęcki</name>
<email>maciek@thing.com</email>
</author>
<published>2023-02-01T14:17:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-security.git/commit/?id=ab8651c139a05c476d7e8a6a987106b2f7e9a354'/>
<id>urn:sha1:ab8651c139a05c476d7e8a6a987106b2f7e9a354</id>
<content type='text'>
Add squashfs to images supported by verity.

Signed-off-by: Maciek Borzecki &lt;maciek@thing.com&gt;
Signed-off-by: Armin Kuster &lt;akuster808@gmail.com&gt;
</content>
</entry>
<entry>
<title>classes: add aide routines</title>
<updated>2022-06-24T01:47:59+00:00</updated>
<author>
<name>Armin Kuster</name>
<email>akuster808@gmail.com</email>
</author>
<published>2022-06-18T04:59:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-security.git/commit/?id=a0665584abfe79e8f55e1f479fa35d0a85478765'/>
<id>urn:sha1:a0665584abfe79e8f55e1f479fa35d0a85478765</id>
<content type='text'>
Signed-off-by: Armin Kuster &lt;akuster808@gmail.com&gt;
</content>
</entry>
<entry>
<title>Add EROFS support to dm-verity-img class</title>
<updated>2022-05-01T17:26:52+00:00</updated>
<author>
<name>Josh Harley</name>
<email>jharley@orangedogsolutions.co.uk</email>
</author>
<published>2022-04-20T10:05:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-security.git/commit/?id=8ca6bb86e653a332f7cb5b30babc0cd6c58769d0'/>
<id>urn:sha1:8ca6bb86e653a332f7cb5b30babc0cd6c58769d0</id>
<content type='text'>
 [PATCH] Add support for the EROFS image, and it's compressed options,
 to the dm-verity-img.bbclass setup, theoretically this is a simple addition
 to the list of types however there is a quirk in how Poky handles the
 filesystems in poky/meta/classes/image_types.bbclass.

Specifically the 'IMAGE_CMD' and 'IMAGE_FSTYPES' use a hyphen, e.g.
erofs-lz4, however in the image_type bbclass the task for that would be
"do_image_erofs_lz4", replacing the hyphen with an underscore.

As the dm-verity-img.bbclass adds a dependency to the wic image creation
on the do_image_* task then it fails as there is no
"do_image_erofs-lz4", so simply replace the hypen with an underscore.

Signed-off-by: Armin Kuster &lt;akuster808@gmail.com&gt;
</content>
</entry>
<entry>
<title>dm-verity-img.bbclass: Fix wrong override syntax for CONVERSION_DEPENDS</title>
<updated>2021-12-25T19:31:45+00:00</updated>
<author>
<name>Kristian Klausen</name>
<email>kristian@klausen.dk</email>
</author>
<published>2021-12-17T09:55:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-security.git/commit/?id=126860dac30d50a5894588b874ae917b0b310142'/>
<id>urn:sha1:126860dac30d50a5894588b874ae917b0b310142</id>
<content type='text'>
CONVERSION_DEPENDS hasn't been converted to the new syntax.

Fixes: a23ceef ("dm-verity-img.bbclass: more overided fixups")

Signed-off-by: Kristian Klausen &lt;kristian@klausen.dk&gt;
Signed-off-by: Armin Kuster &lt;akuster808@gmail.com&gt;
</content>
</entry>
</feed>
