<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/testing/selftests/nolibc, branch linux-6.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-10-10T10:00:25Z</updated>
<entry>
<title>selftests/nolibc: avoid passing NULL to printf("%s")</title>
<updated>2024-10-10T10:00:25Z</updated>
<author>
<name>Thomas Weißschuh</name>
</author>
<published>2024-08-07T21:51:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c07e212bb2ce1c362dd3a3516475fa0813f1967a'/>
<id>urn:sha1:c07e212bb2ce1c362dd3a3516475fa0813f1967a</id>
<content type='text'>
[ Upstream commit f1a58f61d88642ae1e6e97e9d72d73bc70a93cb8 ]

Clang on higher optimization levels detects that NULL is passed to
printf("%s") and warns about it.
While printf() from nolibc gracefully handles that NULL,
it is undefined behavior as per POSIX, so the warning is reasonable.
Avoid the warning by transforming NULL into a non-NULL placeholder.

Reviewed-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Acked-by: Willy Tarreau &lt;w@1wt.eu&gt;
Link: https://lore.kernel.org/r/20240807-nolibc-llvm-v2-8-c20f2f5fc7c2@weissschuh.net
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/nolibc: fix printf format mismatch in expect_str_buf_eq()</title>
<updated>2024-08-03T07:00:33Z</updated>
<author>
<name>Thomas Weißschuh</name>
</author>
<published>2024-05-27T16:15:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9291f9de77e10e3fb10be8eadaba0a9235eec551'/>
<id>urn:sha1:9291f9de77e10e3fb10be8eadaba0a9235eec551</id>
<content type='text'>
commit 92098b1c10cb29bcc6fa0908a766dc9e16b1e889 upstream.

Fix the following compiler warning on 32bit:

  i386-linux-gcc -Os -fno-ident -fno-asynchronous-unwind-tables -std=c89 -W -Wall -Wextra -fno-stack-protector -m32 -mstack-protector-guard=global -fstack-protector-all  -o nolibc-test \
    -nostdlib -nostdinc -static -Isysroot/i386/include nolibc-test.c nolibc-test-linkage.c -lgcc
  nolibc-test.c: In function 'expect_str_buf_eq':
  nolibc-test.c:610:30: error: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
    610 |         llen += printf(" = %lu &lt;%s&gt; ", expr, buf);
        |                            ~~^         ~~~~
        |                              |         |
        |                              |         size_t {aka unsigned int}
        |                              long unsigned int
        |                            %u

Fixes: 1063649cf531 ("selftests/nolibc: Add tests for strlcat() and strlcpy()")
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tools/nolibc: add support for uname(2)</title>
<updated>2024-04-14T18:28:54Z</updated>
<author>
<name>Thomas Weißschuh</name>
</author>
<published>2024-04-13T23:45:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0adab2b6b7336fb6ee3c6456a432dad3b1d25647'/>
<id>urn:sha1:0adab2b6b7336fb6ee3c6456a432dad3b1d25647</id>
<content type='text'>
All supported kernels are assumed to use struct new_utsname.
This is validated in test_uname().

uname(2) can for example be used in ksft_min_kernel_version() from the
kernels selftest framework.

Link: https://lore.kernel.org/lkml/20240412123536.GA32444@redhat.com/
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Acked-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>selftests/nolibc: Add tests for strlcat() and strlcpy()</title>
<updated>2024-04-10T21:19:02Z</updated>
<author>
<name>Rodrigo Campos</name>
</author>
<published>2024-02-18T19:51:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1063649cf531c276740b7f011df2eed82227ba92'/>
<id>urn:sha1:1063649cf531c276740b7f011df2eed82227ba92</id>
<content type='text'>
I've verified that the tests matches libbsd's strlcat()/strlcpy()
implementation.

Please note that as strlcat()/strlcpy() are not part of the libc, the
tests are only compiled when using nolibc.

Signed-off-by: Rodrigo Campos &lt;rodrigo@sdfg.com.ar&gt;
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
</content>
</entry>
<entry>
<title>selftests/nolibc: disable coredump via setrlimit</title>
<updated>2023-12-11T21:38:37Z</updated>
<author>
<name>Thomas Weißschuh</name>
</author>
<published>2023-11-22T22:49:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d543d9ddf593b1f4cb1d57d9ac0ad279fe18adaf'/>
<id>urn:sha1:d543d9ddf593b1f4cb1d57d9ac0ad279fe18adaf</id>
<content type='text'>
qemu-user does has its own implementation of coredumping.
That implementation does not respect the call to
prctl(PR_SET_DUMPABLE, 0) in run_protection().
This leads to a coredump for every test run under qemu-user.

Use also setrlimit() to inhibit coredump creation which is respected by
qemu-user.

Link: https://lore.kernel.org/qemu-devel/20231115-qemu-user-dumpable-v1-2-edbe7f0fbb02@t-8ch.de/
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Link: https://lore.kernel.org/lkml/20231123-nolibc-rlimit-v1-3-a428b131de2a@weissschuh.net/
Acked-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>tools/nolibc: add support for getrlimit/setrlimit</title>
<updated>2023-12-11T21:38:35Z</updated>
<author>
<name>Thomas Weißschuh</name>
</author>
<published>2023-11-22T22:49:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a0bb5f88fc3d72bc92c24a631f2c7794362efac1'/>
<id>urn:sha1:a0bb5f88fc3d72bc92c24a631f2c7794362efac1</id>
<content type='text'>
The implementation uses the prlimit64 systemcall as that is available on
all architectures.

Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Link: https://lore.kernel.org/lkml/20231123-nolibc-rlimit-v1-2-a428b131de2a@weissschuh.net/
Acked-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>tools/nolibc: drop duplicated testcase ioctl_tiocinq</title>
<updated>2023-12-11T21:38:33Z</updated>
<author>
<name>Thomas Weißschuh</name>
</author>
<published>2023-11-25T10:54:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=825f404776b4f9d5f4a35545ea2d258bb16c0d4e'/>
<id>urn:sha1:825f404776b4f9d5f4a35545ea2d258bb16c0d4e</id>
<content type='text'>
The same testcase is present on the line above.

Fixes: b4844fa0bdb4 ("selftests/nolibc: implement a few tests for various syscalls")
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
</content>
</entry>
<entry>
<title>selftests/nolibc: make result alignment more robust</title>
<updated>2023-12-11T21:38:31Z</updated>
<author>
<name>Thomas Weißschuh</name>
</author>
<published>2023-11-22T07:27:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b9e64724cd8aeca9e7ab4523a92ccf2ba0cd1de2'/>
<id>urn:sha1:b9e64724cd8aeca9e7ab4523a92ccf2ba0cd1de2</id>
<content type='text'>
Move the check of the existing length into the function so it can't be
forgotten by the caller.

Also hardcode the padding character as only spaces are ever used.

Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
</content>
</entry>
<entry>
<title>tools/nolibc: mips: add support for PIC</title>
<updated>2023-12-11T21:38:30Z</updated>
<author>
<name>Thomas Weißschuh</name>
</author>
<published>2023-11-08T18:14:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=544102458a8d1c33f9f5f99f9bda8e2b858bcb10'/>
<id>urn:sha1:544102458a8d1c33f9f5f99f9bda8e2b858bcb10</id>
<content type='text'>
MIPS requires some extra instructions to set up the $gp register for the
with a pointer to the global data area.

This isn't needed for non-PIC builds, but this patch enables the code
unconditionally to prevent bitrot.

Also enable PIC in one of the test configurations for ongoing
validation.

Link: https://lore.kernel.org/r/20231108-nolibc-pic-v2-1-4fb0d6284757@weissschuh.net
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
</content>
</entry>
<entry>
<title>selftests/nolibc: run-tests.sh: enable testing via qemu-user</title>
<updated>2023-12-11T21:38:29Z</updated>
<author>
<name>Thomas Weißschuh</name>
</author>
<published>2077-09-15T00:13:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8bcf9a485541fe0079483162496db1add932689b'/>
<id>urn:sha1:8bcf9a485541fe0079483162496db1add932689b</id>
<content type='text'>
qemu-user is faster than a full system test.

Link: https://lore.kernel.org/r/20770915-nolibc-run-user-v1-2-3caec61726dc@weissschuh.net
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
</content>
</entry>
</feed>
