Skip to contentSkip to conversation

Add test for CVE 2020-25705

PATCH New Martin Doucha 2 participants 2 messages May 27, 2021 – May 28, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 Add test for CVE 2020-25705

Fixes #742

---

Changes since v1: New patch

Changes since v2: Added missing gitignore and runfile entry for the new test

Changes since v3:
- rename test from cve-2020-25705 to icmp_rate_limit01
- add #include <time.h> to fix compilation on older systems
- use docparser tag for test description
- change some magic numbers to named constants
- comment cleanup

I've tried several alternatives to the sleep() call in packet_batch() but none of them work. Trying to receive errors too early will cause kernel to silently discard some of them and the test will either randomly pass on a vulnerable system or fail on a fixed one. 2-second sleep() is the minimum for reliable results.

 runtest/cve                       |   1 +
 testcases/cve/.gitignore          |   1 +
 testcases/cve/icmp_rate_limit01.c | 272 ++++++++++++++++++++++++++++++
 3 files changed, 274 insertions(+)
 create mode 100644 testcases/cve/icmp_rate_limit01.c
runtest/cve +1 -0
index 3beb88bb0..9da58d524 100644
@@ -60,5 +60,6 @@ cve-2019-8912 af_alg07
 cve-2020-11494 pty04
 cve-2020-14386 sendto03
 cve-2020-14416 pty03
+cve-2020-25705 icmp_rate_limit01
 cve-2020-29373 io_uring02
 cve-2021-3444 bpf_prog05
testcases/cve/.gitignore +1 -0
index 01a3e4c8f..eb0a8b37d 100644
@@ -10,3 +10,4 @@ stack_clash
 cve-2017-17052
 cve-2017-16939
 cve-2017-17053
+icmp_rate_limit01
testcases/cve/icmp_rate_limit01.c new file +272 -0

272 lines not on this page · raw message

Signature · 1 line
2.31.1