Linux Test Project
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: "Martin Doucha" <mdoucha@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] icmp_rate_limit01: Fix rate limit change on older kernels
Date: Wed, 06 May 2026 09:12:53 +0000	[thread overview]
Message-ID: <69fb0616.df0a0220.22cc2d.40d2@mx.google.com> (raw)
In-Reply-To: <20260429121129.21911-1-mdoucha@suse.cz>

Hi Martin,

> The icmp_msgs_burst sysfile was added to non-root namespaces in kernel
> v6.12. Older kernels allow changing the value only from the root
> namespace. Set the global limit first, then change the test namespace
> limit as well if needed.
> 
> Fixes: 3c4c712f1f9b ("cve: icmp_rate_limit: set icmp_msgs_burst within network namespace")
> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
> ---
>  testcases/cve/icmp_rate_limit01.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/testcases/cve/icmp_rate_limit01.c b/testcases/cve/icmp_rate_limit01.c
> index 5193c5dfd..37bc71cb8 100644
> --- a/testcases/cve/icmp_rate_limit01.c
> +++ b/testcases/cve/icmp_rate_limit01.c
> @@ -62,7 +62,12 @@ static void setup(void)
>  	/* Do NOT close this FD, or both interfaces will be destroyed */
>  	childns = SAFE_OPEN("/proc/self/ns/net", O_RDONLY);
>  
> -	SAFE_FILE_PRINTF("/proc/sys/net/ipv4/icmp_msgs_burst", "50");
> +	/*
> +	 * Set namespace local rate limit if needed. The global limit might
> +	 * be ignored otherwise.
> +	 */
> +	if (!access("/proc/sys/net/ipv4/icmp_msgs_burst", F_OK))
> +		SAFE_FILE_PRINTF("/proc/sys/net/ipv4/icmp_msgs_burst", "50");
>  
>  	/* Configure child namespace */
>  	CREATE_VETH_PAIR("ltp_veth1", "ltp_veth2");
> @@ -257,6 +262,7 @@ static struct tst_test test = {
>  	},
>  	.save_restore = (const struct tst_path_val[]) {
>  		{"/proc/sys/user/max_user_namespaces", "1024", TST_SR_SKIP},
> +		{"/proc/sys/net/ipv4/icmp_msgs_burst", "50", TST_SR_TBROK},

Shouldn't we use TST_SR_SKIP_MISSING here instead of TBROK?

Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

      parent reply	other threads:[~2026-05-06  9:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29 12:11 [LTP] [PATCH] icmp_rate_limit01: Fix rate limit change on older kernels Martin Doucha
2026-04-29 12:26 ` [LTP] " linuxtestproject.agent
2026-05-06  9:12 ` Andrea Cervesato via ltp [this message]

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=69fb0616.df0a0220.22cc2d.40d2@mx.google.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.com \
    --cc=mdoucha@suse.cz \
    /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