BPF List
 help / color / mirror / Atom feed
From: Vineet Gupta <vineet.gupta@linux.dev>
To: sashiko-reviews@lists.linux.dev
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next] selftests/bpf: Sanitize traffic monitor log file names
Date: Thu, 6 Aug 2026 14:37:18 -0700	[thread overview]
Message-ID: <fcfe4ed2-5c04-45df-a4b0-27d1bfddf986@linux.dev> (raw)
In-Reply-To: <20260806211740.E9F851F000E9@smtp.kernel.org>

On 8/6/26 2:17 PM, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
> - [Medium] The backslash character `\` is missing from the sanitization string, leaving artifact names vulnerable to rejection by GitHub Actions.
> - [Low] The newly introduced multi-line comment violates the BPF subsystem's strict comment style guidelines.
> --
>
> --- Patch [1]: [PATCH bpf-next] selftests/bpf: Sanitize traffic monitor log file names ---
> commit 4eb40c6024aab5f28e7a52af3fba116cbdeff427
> Author: Vineet Gupta <vineet.gupta@linux.dev>
>
> selftests/bpf: Sanitize traffic monitor log file names
>
> The traffic monitor names its capture logs after the test and subtest
> being run, replacing '/' and ' ' so the result is usable as a file name.
> This patch replaces the whole set of awkward characters in one pass to
> fix artifact upload failures in CI systems like GitHub Actions.
>
> Link: https://github.com/kernel-patches/vmtest/actions/runs/30710914503/job/91399011388 [1]
>
>> diff --git a/tools/testing/selftests/bpf/network_helpers.c b/tools/testing/selftests/bpf/network_helpers.c
>> index db935a9d9fc1a..3818cec354a0d 100644
>> --- a/tools/testing/selftests/bpf/network_helpers.c
>> +++ b/tools/testing/selftests/bpf/network_helpers.c
>> @@ -1142,10 +1142,13 @@ static void encode_test_name(char *buf, size_t len, const char *test_name, const
>>   		snprintf(buf, len, "%s__%s", test_name, subtest_name);
>>   	else
>>   		snprintf(buf, len, "%s", test_name);
>> -	while ((p = strchr(buf, '/')))
>> -		*p = '_';
>> -	while ((p = strchr(buf, ' ')))
>> -		*p = '_';
>> +	/* Test names are free form, so replace anything that is awkward in a
>> +	 * file name. Besides the path separator, this covers the characters
>> +	 * rejected by CI systems collecting these logs as artifacts.
>> +	 */
> [Severity: Low]
> This isn't a bug, but does this multi-line comment in encode_test_name()
> conflict with the BPF subsystem's comment style guidelines? The opening /*
> is typically expected to be placed on its own line.

It follows the pre-existing convention in this file and for netdev in 
general.
I can fix if maintainers prefer that.

>> +	for (p = buf; *p; p++)
>> +		if (strchr("/ \":<>|*?\r\n", *p))
> [Severity: Medium]
> Since this is meant to cover characters rejected by CI systems like GitHub
> Actions, should the backslash character '\\' also be included in this
> sanitization string?
>
> If a test or subtest name contains a backslash, it appears the artifact
> upload could still fail.

The original intention was parity with libbpf-ci: 
run-vmtest/normalize-paths-for-github.sh but agree adding the backslash 
makes it more robust.

Thx,
-Vineet

  reply	other threads:[~2026-08-06 21:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06 21:11 [PATCH bpf-next] selftests/bpf: Sanitize traffic monitor log file names Vineet Gupta
2026-08-06 21:17 ` sashiko-bot
2026-08-06 21:37   ` Vineet Gupta [this message]
2026-08-06 21:53 ` Ihor Solodrai
2026-08-06 21:57   ` Vineet Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fcfe4ed2-5c04-45df-a4b0-27d1bfddf986@linux.dev \
    --to=vineet.gupta@linux.dev \
    --cc=bpf@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox