Skip to contentSkip to conversation

cve: icmp_rate_limit: Make sure icmp_msgs_burst = 50

PATCH In review Cyril Hrubis 3 participants 3 messages Mar 12 – Mar 16

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cve: icmp_rate_limit: Make sure icmp_msgs_burst = 50

The test is written with an assumption that the burst for icmp message is 50 since it sends 100 messages in a batch and expects the kernel to go over the limit. The easiest way how to fix the test is to set the sysctl to 50 before the test and restore it later.

---
 testcases/cve/icmp_rate_limit01.c | 1 +
 1 file changed, 1 insertion(+)
testcases/cve/icmp_rate_limit01.c +1 -0
index 0305ad095..78480cea6 100644
@@ -255,6 +255,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},
 		{}
 	},
 	.tags = (const struct tst_tag[]) {
Signature · 5 lines
2.52.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v1 1/1
#1 lore raw

Hi,
yes, that's the best fix. Thank you.

Quoted 23 lines · Cyril Hrubis

The test is written with an assumption that the burst for icmp message is 50 since it sends 100 messages in a batch and expects the kernel to go over the limit. The easiest way how to fix the test is to set the sysctl to 50 before the test and restore it later.

---
  testcases/cve/icmp_rate_limit01.c | 1 +
  1 file changed, 1 insertion(+)
testcases/cve/icmp_rate_limit01.c +1 -0
index 0305ad095..78480cea6 100644
@@ -255,6 +255,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},
  		{}
  	},
  	.tags = (const struct tst_tag[]) {
Signature · 10 lines
Martin Doucha   [email protected]
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw

Hi Cyril, Martin,

Quoted 2 lines

Hi,
yes, that's the best fix. Thank you.

Also LGTM.
Merged.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp