From: linuxtestproject.agent@gmail.com
To: Brian Grech <bgrech@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] cve/icmp_rate_limit01: Lower icmp_msgs_per_sec for debug kernel reliability
Date: Wed, 22 Jul 2026 19:20:52 +0000 [thread overview]
Message-ID: <20260722192052.3975-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260722181458.2230141-1-bgrech@redhat.com>
Hi Brian,
On Wed, 22 Jul 2026, Brian Grech wrote:
> cve/icmp_rate_limit01: Lower icmp_msgs_per_sec for debug kernel reliability
> On debug kernels with CONFIG_PROVE_LOCKING or PREEMPT_RT, each socket
> operation (bind, sendto) takes ~3-4ms instead of <0.5ms on a normal
> kernel. At the default icmp_msgs_per_sec=1000, the token bucket refills
> ~371 tokens during the 371ms it takes to send 100 packets, so rate
> limiting never engages and all batches return identical error counts,
> causing a false TFAIL.
Checking net/ipv4/icmp.c (net_init_ipv4_early() /
icmp_sk_init()), the kernel default for icmp_msgs_per_sec has been
10000, not 1000, since the sysctl was introduced -- 1000 is actually
the default of the unrelated icmp_ratelimit sysctl (a millisecond
delay, not a rate). Is the "1000" default and the derived "~371
tokens in 371ms" figure meant to reference icmp_msgs_per_sec, or was
this confused with icmp_ratelimit? The direction of the fix still
holds either way, but the justification as written doesn't match the
real default.
> Lower icmp_msgs_per_sec to 10 in both the global save_restore and the
> child network namespace. At 10/sec the bucket cannot meaningfully refill
> during the send loop regardless of kernel speed, while the 2s inter-batch
> sleep still allows full credit recovery (10 * 2 = 20 = burst).
Two things don't line up here:
icmp_msgs_burst is set to 50 by this same test
(`{PATH_IPV4_ICMP_MSGS_BURST, "50", TST_SR_TBROK}`), not 20, so "20 =
burst" doesn't hold regardless of rate.
Also, icmp_global_allow() caps the elapsed interval used for the
refill calculation: `delta = min_t(u32, now - oldstamp, HZ);`, so at
most one second's worth of credit (10 tokens at this rate) is ever
added on a single check, no matter how long the real elapsed time
was. After the 2s sleep, the achievable refill is capped at 10, not
20.
Neither burst (50) nor the achievable refill (10) match the "10 * 2
= 20 = burst" statement. This likely doesn't break the practical
effect of the fix -- less refill only makes rate limiting engage
more reliably -- but is the reasoning here intentional, or should the
comment be corrected to reflect the actual kernel behavior?
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-07-22 19:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 18:14 [LTP] [PATCH] cve/icmp_rate_limit01: Lower icmp_msgs_per_sec for debug kernel reliability Brian Grech via ltp
2026-07-22 19:20 ` linuxtestproject.agent [this message]
2026-07-22 21:26 ` [LTP] [PATCH v2] " Brian Grech via ltp
2026-07-22 23:05 ` [LTP] " linuxtestproject.agent
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=20260722192052.3975-1-linuxtestproject.agent@gmail.com \
--to=linuxtestproject.agent@gmail.com \
--cc=bgrech@redhat.com \
--cc=ltp@lists.linux.it \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.