<feed xmlns='http://www.w3.org/2005/Atom'>
<title>efi-boot-shim.git/include, branch 15.5-rc2</title>
<subtitle> (mirror of https://github.com/vyos/efi-boot-shim.git)
</subtitle>
<id>https://git.amelek.net/vyos/efi-boot-shim.git/atom?h=15.5-rc2</id>
<link rel='self' href='https://git.amelek.net/vyos/efi-boot-shim.git/atom?h=15.5-rc2'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/'/>
<updated>2021-12-10T22:08:21+00:00</updated>
<entry>
<title>Minor coverity fixes</title>
<updated>2021-12-10T22:08:21+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-12-09T22:21:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=d0df9304c7a777557e1925dc9f75406ec00e6179'/>
<id>urn:sha1:d0df9304c7a777557e1925dc9f75406ec00e6179</id>
<content type='text'>
- one missing free
- one minor deadcode issue
- two unchecked allocations
- one debug hexdump of a variable we just freed

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>stdarg: use sysv varargs when we build with coverity</title>
<updated>2021-12-10T22:08:21+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-12-10T21:18:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=2e78cd93390f83648a20b5b3bb934f846537e54c'/>
<id>urn:sha1:2e78cd93390f83648a20b5b3bb934f846537e54c</id>
<content type='text'>
cov-analysis-linux64-2020.09 is a lot more successful than the older
versions at building, but it still has some... issues.  Among them, it
is of the belief that this:

void
foo(char *fmt, ...)
{
  __builtin_va_list ap;

  __builtin_ms_va_start(ap, fmt); /* &lt;- here */
  ...
}

is an uninitialized use of "ap".

This patch adds defined(__COVERITY__) to the list of criteria for using
sysv va lists, which it has no such confusion about.

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>console: add a clear_screen() primitive</title>
<updated>2021-10-12T14:40:13+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-09-16T20:46:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=35ca373d20fbeeb80aff2202077d614bc89575c0'/>
<id>urn:sha1:35ca373d20fbeeb80aff2202077d614bc89575c0</id>
<content type='text'>
Several places in e.g. MokManager and our console library use
ST-&gt;ConOut-&gt;ClearScreen directly, without checking for the existence of
a console output device.

This patch adds function to our console library to do that correctly,
instead of using the bug-prone ad hoc implementation everywhere.

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>pe: simplify generate_hash()</title>
<updated>2021-09-10T20:09:26+00:00</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2021-09-03T20:38:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=26998367eb6153cd24b6e82949d5f7874a036372'/>
<id>urn:sha1:26998367eb6153cd24b6e82949d5f7874a036372</id>
<content type='text'>
Copying the value of datasize_in to two further variables and then using
all three randomly in the code makes it hard to read.

datasize_in is never changed in generate_hash() so we can do with this
parameter alone. Rename it to datasize.

Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
</content>
</entry>
<entry>
<title>tests: add "include-fixed" GCC directory to include directories</title>
<updated>2021-09-10T20:06:22+00:00</updated>
<author>
<name>Jonas Witschel</name>
<email>diabonas@archlinux.org</email>
</author>
<published>2021-09-09T15:53:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=c1a84dc0a695782e55a97173e4f9f8a98432f9e1'/>
<id>urn:sha1:c1a84dc0a695782e55a97173e4f9f8a98432f9e1</id>
<content type='text'>
On Arch Linux, the GCC version of "limits.h" is in the "include-fixed" instead
of the "include" directory. It needs to be included in the include directories
list, otherwise attempting to compile the test suite fails with the following
error:

In file included from /usr/include/efivar/efivar-dp.h:22,
                 from /usr/include/efivar/efivar.h:238,
                 from include/test.h:51,
                 from shim.h:68,
                 from csv.c:6:
/usr/include/limits.h:124:16: fatal error: limits.h: No such file or directory
  124 | # include_next &lt;limits.h&gt;
      |                ^~~~~~~~~~
compilation terminated.
</content>
</entry>
<entry>
<title>mok: Fix memory leak in mok mirroring</title>
<updated>2021-09-07T21:05:04+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-08-04T21:47:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=35dc110c75b53ff2c8caf808abec624534f5ad20'/>
<id>urn:sha1:35dc110c75b53ff2c8caf808abec624534f5ad20</id>
<content type='text'>
Currently valgrind shows a minor issue which is not introduced in this
patch series:

==2595397==
==2595397== HEAP SUMMARY:
==2595397==     in use at exit: 16,368 bytes in 48 blocks
==2595397==   total heap usage: 6,953 allocs, 6,905 frees, 9,146,749 bytes allocated
==2595397==
==2595397== 16,368 bytes in 48 blocks are definitely lost in loss record 1 of 1
==2595397==    at 0x4845464: calloc (vg_replace_malloc.c:1117)
==2595397==    by 0x4087F2: mock_efi_allocate_pool (test.c:72)
==2595397==    by 0x4098DE: UnknownInlinedFun (misc.c:33)
==2595397==    by 0x4098DE: AllocateZeroPool (misc.c:48)
==2595397==    by 0x403D40: get_variable_attr (variables.c:301)
==2595397==    by 0x4071C4: import_one_mok_state (mok.c:831)
==2595397==    by 0x4072F4: import_mok_state (mok.c:908)
==2595397==    by 0x407FA6: test_mok_mirror_0 (test-mok-mirror.c:205)
==2595397==    by 0x4035B2: main (test-mok-mirror.c:378)
==2595397==
==2595397== LEAK SUMMARY:
==2595397==    definitely lost: 16,368 bytes in 48 blocks
==2595397==    indirectly lost: 0 bytes in 0 blocks
==2595397==      possibly lost: 0 bytes in 0 blocks
==2595397==    still reachable: 0 bytes in 0 blocks
==2595397==         suppressed: 0 bytes in 0 blocks
==2595397==

This is because we're doing get_variable_attr() on the same variable
more than once and saving the value to our variables table.  Each
additional time we do so leaks the previous one.

This patch solves the issue by not getting the variable again if it's
already set in the table, and adds a test case to check if we're doing
get_variable() of any variety on the same variable more than once.

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>tests: Add a unit test for mok mirroring</title>
<updated>2021-09-07T21:05:04+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-07-23T18:36:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=397f820b8c091ca5e3023b6dbd2f26fb256a19f0'/>
<id>urn:sha1:397f820b8c091ca5e3023b6dbd2f26fb256a19f0</id>
<content type='text'>
Test that our mok mirroring doesn't ever try to delete any variable that
it has previously created, and that it properly mirrors at least
MokList, MokListX, and SbatLevel, at least when variables actually work.

These tests will fail (rather a lot) without 7f64fd6da9458b73c4.

Currently valgrind shows a memory leak in this code which is not
introduced in this patch series.  Since all of our memory is freed on
Exit() or when kernel does ExitBootServices(), this doesn't have any
significant repercussions.

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>tests: Add config table support</title>
<updated>2021-09-07T21:05:04+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-07-26T21:29:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=63a5ae1f7c9383f43e4431316eb0c77bcb079b98'/>
<id>urn:sha1:63a5ae1f7c9383f43e4431316eb0c77bcb079b98</id>
<content type='text'>
This adds a simple implementation of ST-&gt;ConfigurationTable,
ST-&gt;NumberOfTableEntries, and BS-&gt;InstallConfigurationTable  to our test
harness.

Currently it is limited at 1024 entries, but that should be well more
than enough for any tests we've currently considered.

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>tests: model different behaviors for deleting variables</title>
<updated>2021-09-07T21:05:04+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-08-03T17:11:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=54bc72cf0abd306d96782cdfa6db7c71ff72e056'/>
<id>urn:sha1:54bc72cf0abd306d96782cdfa6db7c71ff72e056</id>
<content type='text'>
Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>tests: add a mock implementation of {Get,Set}Variable and tests for it</title>
<updated>2021-09-07T21:05:04+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-07-22T19:45:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=2c9eebcf6ddd198c5ba49d784c4536d05023c28b'/>
<id>urn:sha1:2c9eebcf6ddd198c5ba49d784c4536d05023c28b</id>
<content type='text'>
Some tests will need variables, and so we need a mock implementation of
the various calls relating to them.

This patch adds implementations for the EFI Runtime Services calls
GetVariable(), SetVariable(), GetNextVariableName(), and
QueryVariableInfo().  Additionally, it enforces tunable limits on
storage for variables, and (with only a little work) the limits can be
different for SetVariable() vs what is returned by QueryVariableInfo().
That is, it can lie to you like real systems do.

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
</feed>
