<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/lib/efi_loader/efi_file.c, branch next</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>efi_loader: Prevent dereferencing NULL pointer</title>
<updated>2025-07-03T08:32:49+00:00</updated>
<author>
<name>Andrew Goodbody</name>
<email>andrew.goodbody@linaro.org</email>
</author>
<published>2025-07-02T10:01:36+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=9d95a35715fcb8e81ee423e31273489a47ed1563'/>
<id>9d95a35715fcb8e81ee423e31273489a47ed1563</id>
<content type='text'>
Taking the first goto error: in file_open could either result in an
attempt to dereference fh when NULL or else free fh-&gt;path which has
not been assigned to and so will be unknown. Avoid both of these
problems by passing path to free instead of fh-&gt;path.

This issue found by Smatch.

Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Reviewed-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
Signed-off-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Taking the first goto error: in file_open could either result in an
attempt to dereference fh when NULL or else free fh-&gt;path which has
not been assigned to and so will be unknown. Avoid both of these
problems by passing path to free instead of fh-&gt;path.

This issue found by Smatch.

Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Reviewed-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
Signed-off-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>efi_loader: support file rename in SetInfo()</title>
<updated>2025-03-07T17:50:22+00:00</updated>
<author>
<name>Gabriel Dalimonte</name>
<email>gabriel.dalimonte@gmail.com</email>
</author>
<published>2025-02-17T18:26:47+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0165e1a8bd80ee91216e901064bfd4b0ca7f623a'/>
<id>0165e1a8bd80ee91216e901064bfd4b0ca7f623a</id>
<content type='text'>
Following the UEFI specification. The specification did not seem to
delineate if file_name was explicitly a file name only, or could
include paths to move the file to a different directory. The more
generous interpretation of supporting paths was selected.

Signed-off-by: Gabriel Dalimonte &lt;gabriel.dalimonte@gmail.com&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Following the UEFI specification. The specification did not seem to
delineate if file_name was explicitly a file name only, or could
include paths to move the file to a different directory. The more
generous interpretation of supporting paths was selected.

Signed-off-by: Gabriel Dalimonte &lt;gabriel.dalimonte@gmail.com&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>efi_loader: move path out of file_handle</title>
<updated>2025-03-07T17:50:22+00:00</updated>
<author>
<name>Gabriel Dalimonte</name>
<email>gabriel.dalimonte@gmail.com</email>
</author>
<published>2025-02-17T18:26:46+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8465ee528b84f242e403a3c6e67dab5b244bacc8'/>
<id>8465ee528b84f242e403a3c6e67dab5b244bacc8</id>
<content type='text'>
In order to support renaming via SetInfo(), path must allow for longer
values than what was originally present when file_handle was allocated.

Signed-off-by: Gabriel Dalimonte &lt;gabriel.dalimonte@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In order to support renaming via SetInfo(), path must allow for longer
values than what was originally present when file_handle was allocated.

Signed-off-by: Gabriel Dalimonte &lt;gabriel.dalimonte@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>efi_loader: use LOGC_EFI consistently</title>
<updated>2025-01-26T10:06:56+00:00</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2025-01-16T19:26:59+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e9c34fab18a9a0022b36729afd8e262e062764e2'/>
<id>e9c34fab18a9a0022b36729afd8e262e062764e2</id>
<content type='text'>
The log category should be LOGC_EFI all over the EFI sub-system.

Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The log category should be LOGC_EFI all over the EFI sub-system.

Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>efi_loader: fix GetInfo and SetInfo</title>
<updated>2024-11-01T19:37:58+00:00</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2024-10-26T06:40:47+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8b1d6fcc9082c9eea590408e4675c45671107cd7'/>
<id>8b1d6fcc9082c9eea590408e4675c45671107cd7</id>
<content type='text'>
* Some of our file system drivers cannot report a file size for
  directories. Use a dummy value in this case.
* For SetInfo the UEFI spec requires to ignore the file size field.

Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Some of our file system drivers cannot report a file size for
  directories. Use a dummy value in this case.
* For SetInfo the UEFI spec requires to ignore the file size field.

Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>efi_loader: fix some function descriptions</title>
<updated>2024-09-21T08:54:42+00:00</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2024-09-18T21:37:28+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=58da850c87240c397242ebd47341c69aa6278119'/>
<id>58da850c87240c397242ebd47341c69aa6278119</id>
<content type='text'>
* The function name must be provided in the description.
* The function name must match the name used in the description.

Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* The function name must be provided in the description.
* The function name must match the name used in the description.

Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>efi_loader: Remove &lt;common.h&gt;</title>
<updated>2023-12-21T13:54:37+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2023-12-14T18:16:55+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c38cb227d39f8ce9983df8051f31dcc8466f311e'/>
<id>c38cb227d39f8ce9983df8051f31dcc8466f311e</id>
<content type='text'>
We largely do not need &lt;common.h&gt; in these files, so drop it. The only
exception here is that efi_freestanding.c needs &lt;linux/types.h&gt; and had
been getting that via &lt;common.h&gt;.

Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We largely do not need &lt;common.h&gt; in these files, so drop it. The only
exception here is that efi_freestanding.c needs &lt;linux/types.h&gt; and had
been getting that via &lt;common.h&gt;.

Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>efi_loader: catch out of memory in file_open</title>
<updated>2023-08-03T07:21:03+00:00</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2023-07-30T12:06:06+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=405b736e817bbca360b2fd3329953d3980585df2'/>
<id>405b736e817bbca360b2fd3329953d3980585df2</id>
<content type='text'>
If calloc() return NULL, don't dereference it.

Fixes: 2a92080d8c44 ("efi_loader: add file/filesys support")
Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If calloc() return NULL, don't dereference it.

Fixes: 2a92080d8c44 ("efi_loader: add file/filesys support")
Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>efi_loader: error handling in efi_disk_add_dev</title>
<updated>2023-08-03T07:21:03+00:00</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2023-07-30T12:03:53+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=cff7700170c2eb9d8059acbc2a5664ee9c8a8a9b'/>
<id>cff7700170c2eb9d8059acbc2a5664ee9c8a8a9b</id>
<content type='text'>
* If an error occurs in efi_disk_add_dev(), don't leak resources.
* If calloc() fails while creating the file system protocol interface,
  signal an error.
* Rename efi_simple_file_system() to efi_create_simple_file_system().
* Drop a little helpful debug message.

Fixes: 2a92080d8c44 ("efi_loader: add file/filesys support")
Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* If an error occurs in efi_disk_add_dev(), don't leak resources.
* If calloc() fails while creating the file system protocol interface,
  signal an error.
* Rename efi_simple_file_system() to efi_create_simple_file_system().
* Drop a little helpful debug message.

Fixes: 2a92080d8c44 ("efi_loader: add file/filesys support")
Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>efi_loader: replace a u16_strdup with alloc + memcpy</title>
<updated>2022-11-16T07:34:06+00:00</updated>
<author>
<name>Ilias Apalodimas</name>
<email>ilias.apalodimas@linaro.org</email>
</author>
<published>2022-11-11T18:04:31+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=a930d69baa958d5f308b3910187c5f3c083fe171'/>
<id>a930d69baa958d5f308b3910187c5f3c083fe171</id>
<content type='text'>
Heinrich reports that on RISC-V unaligned access is emulated by OpenSBI
which is very slow.  Performance wise it's better if we skip the calls
to u16_strdup() -- which in turn calls u16_strsize() and just allocate/copy the
memory directly.  The access to dp.length may still be unaligned, but that's
way less than what u16_strsize() would do

Signed-off-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Use malloc() instead of calloc().
Reviewed-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Heinrich reports that on RISC-V unaligned access is emulated by OpenSBI
which is very slow.  Performance wise it's better if we skip the calls
to u16_strdup() -- which in turn calls u16_strsize() and just allocate/copy the
memory directly.  The access to dp.length may still be unaligned, but that's
way less than what u16_strsize() would do

Signed-off-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Use malloc() instead of calloc().
Reviewed-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
