<feed xmlns='http://www.w3.org/2005/Atom'>
<title>opensbi.git/lib/sbi/tests/sbi_ecall_test.c, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/opensbi.git/atom/lib/sbi/tests/sbi_ecall_test.c?h=master</id>
<link rel='self' href='http://cgit.235523.xyz/opensbi.git/atom/lib/sbi/tests/sbi_ecall_test.c?h=master'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/'/>
<updated>2026-08-31T12:38:50Z</updated>
<entry>
<title>lib: sbi: clamp sbi_ecall_get_extensions_str buffer offset</title>
<updated>2026-08-31T12:38:50Z</updated>
<author>
<name>Yudistira Putra</name>
<email>pyudistira519@gmail.com</email>
</author>
<published>2026-07-19T10:11:25Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=f95648d3955d72f77e13315a990a6135303978a5'/>
<id>urn:sha1:f95648d3955d72f77e13315a990a6135303978a5</id>
<content type='text'>
sbi_ecall_get_extensions_str() advanced offset by the nominal extension
name length without checking remaining capacity. When the caller buffer
was smaller than the concatenated extension list, offset could pass
exts_str_size, so (exts_str_size - offset) became negative and was
passed to sbi_snprintf() as a large u32, and the trailing NUL write
could step past the caller buffer.

The helper can write beyond a caller-provided destination when the
registered extension list exceeds the supplied capacity.

Mirror the guard already used by sbi_hart_get_extensions_str(): stop
appending when the next name would not fit. Add an SBIUNIT regression
that registers several extensions into a 16-byte buffer with a redzone
and verifies no out-of-bounds write.

Closes: https://github.com/riscv-software-src/opensbi/issues/416
Signed-off-by: Yudistira Putra &lt;pyudistira519@gmail.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Link: https://lore.kernel.org/r/20260719101125.190314-1-pyudistira519@gmail.com
Signed-off-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: add tests for sbi_ecall functionality</title>
<updated>2025-03-23T11:26:54Z</updated>
<author>
<name>Akshay Behl</name>
<email>akshaybehl231@gmail.com</email>
</author>
<published>2025-03-23T11:18:51Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=0b78665a6c51a7b8b6da31e05590e6fd810d07e2'/>
<id>urn:sha1:0b78665a6c51a7b8b6da31e05590e6fd810d07e2</id>
<content type='text'>
This patch adds unit tests for verifying the sbi_ecall version,
impid handling, and extension registration functions. The tests
ensure that the extension registration and unregistration work
as expected.

Signed-off-by: Akshay Behl &lt;akshaybehl231@gmail.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
</feed>
