<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/testing/selftests/bpf/progs/test_snprintf.c, branch linux-6.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2021-08-15T07:19:10Z</updated>
<entry>
<title>selftest/bpf: Extend the bpf_snprintf() test for "%c".</title>
<updated>2021-08-15T07:19:10Z</updated>
<author>
<name>Kuniyuki Iwashima</name>
<email>kuniyu@amazon.co.jp</email>
</author>
<published>2021-08-14T01:57:18Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ce547335d4a42e645320402b24aeadb39531f73c'/>
<id>urn:sha1:ce547335d4a42e645320402b24aeadb39531f73c</id>
<content type='text'>
This patch adds various "positive" patterns for "%c" and two "negative"
patterns for wide character.

Signed-off-by: Kuniyuki Iwashima &lt;kuniyu@amazon.co.jp&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210814015718.42704-5-kuniyu@amazon.co.jp
</content>
</entry>
<entry>
<title>libbpf: Move BPF_SEQ_PRINTF and BPF_SNPRINTF to bpf_helpers.h</title>
<updated>2021-05-26T17:45:41Z</updated>
<author>
<name>Florent Revest</name>
<email>revest@chromium.org</email>
</author>
<published>2021-05-26T16:46:43Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d6a6a55518c16040a369360255b355b7a2a261de'/>
<id>urn:sha1:d6a6a55518c16040a369360255b355b7a2a261de</id>
<content type='text'>
These macros are convenient wrappers around the bpf_seq_printf and
bpf_snprintf helpers. They are currently provided by bpf_tracing.h which
targets low level tracing primitives. bpf_helpers.h is a better fit.

The __bpf_narg and __bpf_apply are needed in both files and provided
twice. __bpf_empty isn't used anywhere and is removed from bpf_tracing.h

Reported-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Florent Revest &lt;revest@chromium.org&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210526164643.2881368-1-revest@chromium.org
</content>
</entry>
<entry>
<title>selftests/bpf: Fix the snprintf test</title>
<updated>2021-04-30T17:36:59Z</updated>
<author>
<name>Florent Revest</name>
<email>revest@chromium.org</email>
</author>
<published>2021-04-28T15:25:01Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f80f88f0e2f2ef9cd805fad1bbf676b0ecd4b55c'/>
<id>urn:sha1:f80f88f0e2f2ef9cd805fad1bbf676b0ecd4b55c</id>
<content type='text'>
The BPF program for the snprintf selftest runs on all syscall entries.
On busy multicore systems this can cause concurrency issues.

For example it was observed that sometimes the userspace part of the
test reads "    4 0000" instead of "    4 000" (extra '0' at the end)
which seems to happen just before snprintf on another core sets
end[-1] = '\0'.

This patch adds a pid filter to the test to ensure that no
bpf_snprintf() will write over the test's output buffers while the
userspace reads the values.

Fixes: c2e39c6bdc7e ("selftests/bpf: Add a series of tests for bpf_snprintf")
Reported-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Florent Revest &lt;revest@chromium.org&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210428152501.1024509-1-revest@chromium.org
</content>
</entry>
<entry>
<title>selftests/bpf: Add a series of tests for bpf_snprintf</title>
<updated>2021-04-19T22:27:37Z</updated>
<author>
<name>Florent Revest</name>
<email>revest@chromium.org</email>
</author>
<published>2021-04-19T15:52:43Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c2e39c6bdc7eb48459ec1d34d4f27eb82299f4b7'/>
<id>urn:sha1:c2e39c6bdc7eb48459ec1d34d4f27eb82299f4b7</id>
<content type='text'>
The "positive" part tests all format specifiers when things go well.

The "negative" part makes sure that incorrect format strings fail at
load time.

Signed-off-by: Florent Revest &lt;revest@chromium.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210419155243.1632274-7-revest@chromium.org
</content>
</entry>
</feed>
