<feed xmlns='http://www.w3.org/2005/Atom'>
<title>efi-boot-shim.git/lib/simple_file.c, branch rolling</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=rolling</id>
<link rel='self' href='https://git.amelek.net/vyos/efi-boot-shim.git/atom?h=rolling'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/'/>
<updated>2025-03-14T15:05:05+00:00</updated>
<entry>
<title>simple_dir_filter(): test our 'next' pointer</title>
<updated>2025-03-14T15:05:05+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2025-03-12T20:11:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=7b753820e79b5b38be59c40aaa7960eab0aae119'/>
<id>urn:sha1:7b753820e79b5b38be59c40aaa7960eab0aae119</id>
<content type='text'>
"gcc -fanalyzer" thinks that in simple_dir_filter(), we can get "next"
to be a NULL pointer even when simple_dir_read_all() return success and
we're iterating the total number of entries it claimed it returned.

I don't think this is true, but to make it stop complaining I've added
tests to that pointer that'll make it stop if it gets to the end of the
list.

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>simple_file: Use second variable to create filesystem entries</title>
<updated>2025-01-21T16:00:49+00:00</updated>
<author>
<name>Michał Żygowski</name>
<email>michal.zygowski@3mdeb.com</email>
</author>
<published>2023-12-16T12:01:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=d6076cb61297c13a0c55c0b848b85b9f31a912ac'/>
<id>urn:sha1:d6076cb61297c13a0c55c0b848b85b9f31a912ac</id>
<content type='text'>
If HandleProtocol or OpenVolume fails, the entries array will become
non-contiguous, i.e. will have NULL pointers between valid volume
names in the array. Because of that count_lines may return a lower
number of entries than expected. As a result one may not browse all
valid filesystems in the file explorer.

Add a second index variable that will increment only on successfully
created filesystem entries. As a result, count_lines should return
proper length and there won't be any lost partitions or accesses to
invalid entries.

Signed-off-by: Michał Żygowski &lt;michal.zygowski@3mdeb.com&gt;
</content>
</entry>
<entry>
<title>simple_file: Allow to form a volume name from DevicePath</title>
<updated>2025-01-21T16:00:49+00:00</updated>
<author>
<name>Michał Żygowski</name>
<email>michal.zygowski@3mdeb.com</email>
</author>
<published>2023-12-16T11:58:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=9415d3cada09f8043bb9a2c1b32fd1f909cefab0'/>
<id>urn:sha1:9415d3cada09f8043bb9a2c1b32fd1f909cefab0</id>
<content type='text'>
In case GetInfo of volume root fails, it is still possible
to form a volume name from the DevicePath. Do not skip given
SimpleFS volume handle and try to form a name from DevicePath.
That way we do not lose some filesystems from file browser.

This change already fixes the problem of a hanging platform
when trying to enroll a key from disk. However, there is still
a chance of having a non-contiguous array of entries, which
will be fixed in next commit.

Signed-off-by: Michał Żygowski &lt;michal.zygowski@3mdeb.com&gt;
</content>
</entry>
<entry>
<title>lib/simple_file.c: Allocate zeroed pool for SimpleFS entries</title>
<updated>2025-01-21T16:00:49+00:00</updated>
<author>
<name>Michał Żygowski</name>
<email>michal.zygowski@3mdeb.com</email>
</author>
<published>2023-12-16T11:45:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=dc45aa6b3ce0c54c20ed284222297cdb29baa5d5'/>
<id>urn:sha1:dc45aa6b3ce0c54c20ed284222297cdb29baa5d5</id>
<content type='text'>
The loop retrieving the SimpleFS volume labels and names may
skip some volumes if either HandleProtocol or OpenVolume or
GetInfo fails. Those skipped volumes would have uninitialized
pointers to their names in the respective entries indices. This
would lead to accessing random memory in console_select, because
count_lines would not catch the holes with non-existing entries.

On affected platforms the result is a hang of the MokManager while
trying to enroll a key from disk. The issue has been triggered on
a TianoCore EDK2 UEFIPayload based firmware for x86 platforms with
additional filesystem drivers: ExFAT, NTFS, EXT2 and EXT4.

Use AllocateZeroPool to ensure entries array will be initialized
with NULL pointers. Handling the non-existing entries will be
added in subsequent commits.

Signed-off-by: Michał Żygowski &lt;michal.zygowski@3mdeb.com&gt;
</content>
</entry>
<entry>
<title>cleanup: always use BS and RT, not gBS and gRT</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:28:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=6ea93a28759d754778e483f86f95587a01c5fee8'/>
<id>urn:sha1:6ea93a28759d754778e483f86f95587a01c5fee8</id>
<content type='text'>
This just makes one less thing we have to make sure is the same between
the test harnesses and the runtime code.

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>Restructure our includes.</title>
<updated>2021-03-10T20:54:20+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-03-09T16:42:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=f033a1da9f4c3acf7e3dfef906d01e348b6fcf42'/>
<id>urn:sha1:f033a1da9f4c3acf7e3dfef906d01e348b6fcf42</id>
<content type='text'>
This re-structures our includes so we can be sure everything is always
including all the system headers in a uniform, predictable way.

Temporarily it also adds a bunch of junk at all the places we use
variadic functions to specifically pick either the MS (cdecl) or ELF
ABIs.

I'm not 100% sure that's all correct (see later patch) but it's enough
to allow this to build.

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>Fix all the places we need UNUSED on arguments.</title>
<updated>2021-02-25T15:15:14+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-02-22T22:25:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=587b608b89def24717632fd5b3e548f2cf52c675'/>
<id>urn:sha1:587b608b89def24717632fd5b3e548f2cf52c675</id>
<content type='text'>
Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>SPDX: Clarify the attribution for James's lib/ code</title>
<updated>2021-02-16T08:12:48+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-02-14T16:22:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=dd4e3ac5fd35d851208cbbdeb5c094e24976aba8'/>
<id>urn:sha1:dd4e3ac5fd35d851208cbbdeb5c094e24976aba8</id>
<content type='text'>
At the time, this was explicitly contributed under the Tiano license,
even though the original code[0] is LGPLv2.1.

[0]: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/efitools.git

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>simple_file: fix uninitialized variable/unchecked return</title>
<updated>2020-07-24T00:53:24+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2020-07-23T03:55:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=c186bdddaa7b103aef9d4a164ac0a07499dba112'/>
<id>urn:sha1:c186bdddaa7b103aef9d4a164ac0a07499dba112</id>
<content type='text'>
Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
Upstream: pr#212
</content>
</entry>
<entry>
<title>console: Add console_print and console_print_at helpers</title>
<updated>2018-03-12T22:00:41+00:00</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2018-03-12T15:03:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=1fe31ee1b4ebf2f177d512d0301e11de0689a275'/>
<id>urn:sha1:1fe31ee1b4ebf2f177d512d0301e11de0689a275</id>
<content type='text'>
This is a preparation commit for removing the setup_console(1) calls from
MokManager and shim so that we don't force the EFI console to switch to
text-mode.

This commit replaces all direct calls to Print / PrintAt with calls to
the new helpers (no functional changes) so that we can delay calling
setup_console(1) till the first Print call in a follow-up patch.

Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
</feed>
