<feed xmlns='http://www.w3.org/2005/Atom'>
<title>blaster4385/linux-IllusionX/tools/testing/selftests/net/tcp_ao/lib, branch v6.12.1</title>
<subtitle>Linux kernel with personal config changes for arch linux</subtitle>
<id>http://git.tablaster.dev/blaster4385/linux-IllusionX/atom?h=v6.12.1</id>
<link rel='self' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/atom?h=v6.12.1'/>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/'/>
<updated>2024-08-27T21:11:27Z</updated>
<entry>
<title>selftests/net: Add trace events matching to tcp_ao</title>
<updated>2024-08-27T21:11:27Z</updated>
<author>
<name>Dmitry Safonov</name>
<email>0x7f454c46@gmail.com</email>
</author>
<published>2024-08-23T22:04:58Z</published>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=586d87021f224b0434372f5b4418216e29b0a544'/>
<id>urn:sha1:586d87021f224b0434372f5b4418216e29b0a544</id>
<content type='text'>
Setup trace points, add a new ftrace instance in order to not interfere
with the rest of the system, filtering by net namespace cookies.
Raise a new background thread that parses trace_pipe, matches them with
the list of expected events.

Wiring up trace events to selftests provides another insight if there is
anything unexpected happining in the tcp-ao code (i.e. key rotation when
it's not expected).

Note: in real programs libtraceevent should be used instead of this
manual labor of setting ftrace up and parsing. I'm not using it here
as I don't want to have an .so library dependency that one would have to
bring into VM or DUT (Device Under Test). Please, don't copy it over
into any real world programs, that aren't tests.

Signed-off-by: Dmitry Safonov &lt;0x7f454c46@gmail.com&gt;
Link: https://patch.msgid.link/20240823-tcp-ao-selftests-upd-6-12-v4-8-05623636fe8c@gmail.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/net: Don't forget to close nsfd after switch_save_ns()</title>
<updated>2024-08-27T21:11:27Z</updated>
<author>
<name>Dmitry Safonov</name>
<email>0x7f454c46@gmail.com</email>
</author>
<published>2024-08-23T22:04:55Z</published>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=a9e1693406f96f3739611dd08518c9eda3acecfd'/>
<id>urn:sha1:a9e1693406f96f3739611dd08518c9eda3acecfd</id>
<content type='text'>
The switch_save_ns() helper suppose to help switching to another
namespace for some action and to return back to original namespace.

The fd should be closed.

Signed-off-by: Dmitry Safonov &lt;0x7f454c46@gmail.com&gt;
Link: https://patch.msgid.link/20240823-tcp-ao-selftests-upd-6-12-v4-5-05623636fe8c@gmail.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/net: Open /proc/thread-self in open_netns()</title>
<updated>2024-08-27T21:11:27Z</updated>
<author>
<name>Dmitry Safonov</name>
<email>0x7f454c46@gmail.com</email>
</author>
<published>2024-08-23T22:04:54Z</published>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=8acb1806e8c2846ae619f500a3229a325c3304f5'/>
<id>urn:sha1:8acb1806e8c2846ae619f500a3229a325c3304f5</id>
<content type='text'>
It turns to be that open_netns() is called rarely from the child-thread
and more often from parent-thread. Yet, on initialization of kconfig
checks, either of threads may reach kconfig_lock mutex first.
VRF-related checks do create a temporary ksft-check VRF in
an unshare()'d namespace and than setns() back to the original.
As original was opened from "/proc/self/ns/net", it's valid for
thread-leader (parent), but it's invalid for the child, resulting
in the following failure on tests that check has_vrfs() support:
&gt; # ok 54 TCP-AO required on socket + TCP-MD5 key: prefailed as expected: Key was rejected by service
&gt; # not ok 55 # error 381[unsigned-md5.c:24] Failed to add a VRF: -17
&gt; # not ok 56 # error 383[unsigned-md5.c:33] Failed to add a route to VRF: -22: Key was rejected by service
&gt; not ok 1 selftests: net/tcp_ao: unsigned-md5_ipv6 # exit=1

Use "/proc/thread-self/ns/net" which is valid for any thread.

Signed-off-by: Dmitry Safonov &lt;0x7f454c46@gmail.com&gt;
Link: https://patch.msgid.link/20240823-tcp-ao-selftests-upd-6-12-v4-4-05623636fe8c@gmail.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/net: Be consistent in kconfig checks</title>
<updated>2024-08-27T21:11:27Z</updated>
<author>
<name>Dmitry Safonov</name>
<email>0x7f454c46@gmail.com</email>
</author>
<published>2024-08-23T22:04:53Z</published>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=bc2468f98221a194769cac80051da6b86cc39c2f'/>
<id>urn:sha1:bc2468f98221a194769cac80051da6b86cc39c2f</id>
<content type='text'>
Most of the functions in tcp-ao lib/ return negative errno or -1 in case
of a failure. That creates inconsistencies in lib/kconfig, which saves
what was the error code. As well as the uninitialized kconfig value is
-1, which also may be the result of a check.

Define KCONFIG_UNKNOWN and save negative return code, rather than
libc-style errno.

Signed-off-by: Dmitry Safonov &lt;0x7f454c46@gmail.com&gt;
Link: https://patch.msgid.link/20240823-tcp-ao-selftests-upd-6-12-v4-3-05623636fe8c@gmail.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/net: Provide test_snprintf() helper</title>
<updated>2024-08-27T21:11:27Z</updated>
<author>
<name>Dmitry Safonov</name>
<email>0x7f454c46@gmail.com</email>
</author>
<published>2024-08-23T22:04:52Z</published>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=7053e788ded5f8ec589e4507d764d6a894780d6c'/>
<id>urn:sha1:7053e788ded5f8ec589e4507d764d6a894780d6c</id>
<content type='text'>
Instead of pre-allocating a fixed-sized buffer of TEST_MSG_BUFFER_SIZE
and printing into it, call vsnprintf() with str = NULL, which will
return the needed size of the buffer. This hack is documented in
man 3 vsnprintf.

Essentially, in C++ terms, it re-invents std::stringstream, which is
going to be used to print different tracing paths and formatted strings.
Use it straight away in __test_print() - which is thread-safe version of
printing in selftests.

Signed-off-by: Dmitry Safonov &lt;0x7f454c46@gmail.com&gt;
Link: https://patch.msgid.link/20240823-tcp-ao-selftests-upd-6-12-v4-2-05623636fe8c@gmail.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/net: Clean-up double assignment</title>
<updated>2024-08-27T21:11:26Z</updated>
<author>
<name>Dmitry Safonov</name>
<email>0x7f454c46@gmail.com</email>
</author>
<published>2024-08-23T22:04:51Z</published>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=79504a47339cd9a1574d974869aecaba838e1213'/>
<id>urn:sha1:79504a47339cd9a1574d974869aecaba838e1213</id>
<content type='text'>
Correct copy'n'paste typo: the previous line already initialises get_all
to 1.

Reported-by: Nassiri, Mohammad &lt;mnassiri@ciena.com&gt;
Closes: https://lore.kernel.org/all/DM6PR04MB4202BC58A9FD5BDD24A16E8EC56F2@DM6PR04MB4202.namprd04.prod.outlook.com/
Signed-off-by: Dmitry Safonov &lt;0x7f454c46@gmail.com&gt;
Link: https://patch.msgid.link/20240823-tcp-ao-selftests-upd-6-12-v4-1-05623636fe8c@gmail.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/tcp_ao: Printing fixes to confirm with format-security</title>
<updated>2024-04-16T11:35:06Z</updated>
<author>
<name>Dmitry Safonov</name>
<email>0x7f454c46@gmail.com</email>
</author>
<published>2024-04-13T01:42:55Z</published>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=b476c93654d748c13624f7c7d0ba191c56a8092e'/>
<id>urn:sha1:b476c93654d748c13624f7c7d0ba191c56a8092e</id>
<content type='text'>
On my new laptop with packages from nixos-unstable, gcc 12.3.0 produces
&gt; lib/setup.c: In function ‘__test_msg’:
&gt; lib/setup.c:20:9: error: format not a string literal and no format arguments [-Werror=format-security]
&gt;    20 |         ksft_print_msg(buf);
&gt;       |         ^~~~~~~~~~~~~~
&gt; lib/setup.c: In function ‘__test_ok’:
&gt; lib/setup.c:26:9: error: format not a string literal and no format arguments [-Werror=format-security]
&gt;    26 |         ksft_test_result_pass(buf);
&gt;       |         ^~~~~~~~~~~~~~~~~~~~~
&gt; lib/setup.c: In function ‘__test_fail’:
&gt; lib/setup.c:32:9: error: format not a string literal and no format arguments [-Werror=format-security]
&gt;    32 |         ksft_test_result_fail(buf);
&gt;       |         ^~~~~~~~~~~~~~~~~~~~~
&gt; lib/setup.c: In function ‘__test_xfail’:
&gt; lib/setup.c:38:9: error: format not a string literal and no format arguments [-Werror=format-security]
&gt;    38 |         ksft_test_result_xfail(buf);
&gt;       |         ^~~~~~~~~~~~~~~~~~~~~~
&gt; lib/setup.c: In function ‘__test_error’:
&gt; lib/setup.c:44:9: error: format not a string literal and no format arguments [-Werror=format-security]
&gt;    44 |         ksft_test_result_error(buf);
&gt;       |         ^~~~~~~~~~~~~~~~~~~~~~
&gt; lib/setup.c: In function ‘__test_skip’:
&gt; lib/setup.c:50:9: error: format not a string literal and no format arguments [-Werror=format-security]
&gt;    50 |         ksft_test_result_skip(buf);
&gt;       |         ^~~~~~~~~~~~~~~~~~~~~
&gt; cc1: some warnings being treated as errors

As the buffer was already pre-printed into, print it as a string
rather than a format-string.

Fixes: cfbab37b3da0 ("selftests/net: Add TCP-AO library")
Signed-off-by: Dmitry Safonov &lt;0x7f454c46@gmail.com&gt;
Reported-by: Muhammad Usama Anjum &lt;usama.anjum@collabora.com&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>selftests/tcp_ao: Fix fscanf() call for format-security</title>
<updated>2024-04-16T11:35:06Z</updated>
<author>
<name>Dmitry Safonov</name>
<email>0x7f454c46@gmail.com</email>
</author>
<published>2024-04-13T01:42:54Z</published>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=beb78cd1329d039d73487ca05633d1b92e1ab2ea'/>
<id>urn:sha1:beb78cd1329d039d73487ca05633d1b92e1ab2ea</id>
<content type='text'>
On my new laptop with packages from nixos-unstable, gcc 12.3.0 produces:
&gt; lib/proc.c: In function ‘netstat_read_type’:
&gt; lib/proc.c:89:9: error: format not a string literal and no format arguments [-Werror=format-security]
&gt;    89 |         if (fscanf(fnetstat, type-&gt;header_name) == EOF)
&gt;       |         ^~
&gt; cc1: some warnings being treated as errors

Here the selftests lib parses header name, while expectes non-space word
ending with a column.

Fixes: cfbab37b3da0 ("selftests/net: Add TCP-AO library")
Signed-off-by: Dmitry Safonov &lt;0x7f454c46@gmail.com&gt;
Reported-by: Muhammad Usama Anjum &lt;usama.anjum@collabora.com&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>selftests/net: Repair RST passive reset selftest</title>
<updated>2024-02-01T00:33:30Z</updated>
<author>
<name>Dmitry Safonov</name>
<email>dima@arista.com</email>
</author>
<published>2024-01-30T03:51:54Z</published>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=6caf3adcc877b3470e98133d52b360ebe5f7a6a3'/>
<id>urn:sha1:6caf3adcc877b3470e98133d52b360ebe5f7a6a3</id>
<content type='text'>
Currently, the test is racy and seems to not pass anymore.

In order to rectify it, aim on TCP_TW_RST.
Doesn't seem way too good with this sleep() part, but it seems as
a reasonable compromise for the test. There is a plan in-line comment on
how-to improve it, going to do it on the top, at this moment I want it
to run on netdev/patchwork selftests dashboard.

It also slightly changes tcp_ao-lib in order to get SO_ERROR propagated
to test_client_verify() return value.

Fixes: c6df7b2361d7 ("selftests/net: Add TCP-AO RST test")
Signed-off-by: Dmitry Safonov &lt;dima@arista.com&gt;
Link: https://lore.kernel.org/r/20240130-tcp-ao-test-key-mgmt-v2-3-d190430a6c60@arista.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftest/tcp-ao: Work on namespace-ified sysctl_optmem_max</title>
<updated>2024-01-02T13:27:48Z</updated>
<author>
<name>Dmitry Safonov</name>
<email>dima@arista.com</email>
</author>
<published>2023-12-22T01:59:07Z</published>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=80057b2080a8f80b93c6f7b474909ccda8a21b09'/>
<id>urn:sha1:80057b2080a8f80b93c6f7b474909ccda8a21b09</id>
<content type='text'>
Since commit f5769faeec36 ("net: Namespace-ify sysctl_optmem_max")
optmem_max is per-netns, so need of switching to root namespace.
It seems trivial to keep the old logic working, so going to keep it for
a while (at least, until kernel with netns-optmem_max will be release).

Currently, there is a test that checks that optmem_max limit applies to
TCP-AO keys and a little benchmark that measures linked-list TCP-AO keys
scaling, those are fixed by this.

Cc: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: Dmitry Safonov &lt;dima@arista.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
