Skip to content

Commit

Permalink
tcpreplay: Add fix for CVE-2020-24265 and CVE-2020-24266
Browse files Browse the repository at this point in the history
Add below patch to fix CVE-2020-24265 and CVE-2020-24266
CVE-2020-24265-and-CVE-2020-24266.patch
Link: appneta/tcpreplay@d311085

Signed-off-by: Akash Hadke <akash.hadke@kpit.com>
Signed-off-by: Akash Hadke <hadkeakash4@gmail.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
  • Loading branch information
Akash Hadke authored and akuster committed Mar 27, 2022
1 parent 9aaa031 commit a09ddd7
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From d3110859064b15408dbca1294dc7e31c2208504d Mon Sep 17 00:00:00 2001
From: Gabriel Ganne <gabriel.ganne@gmail.com>
Date: Mon, 3 Aug 2020 08:26:38 +0200
Subject: [PATCH] fix heap-buffer-overflow when DLT_JUNIPER_ETHER

The test logic on datalen was inverted.

Processing truncated packats should now raise a warning like the
following:
Warning: <pcap> was captured using a snaplen of 4 bytes. This may mean you have truncated packets.

Fixes #616 #617

CVE: CVE-2020-24265
CVE: CVE-2020-24266
Upstream-Status: Backport [https://github.com/appneta/tcpreplay/commit/d3110859064b15408dbca1294dc7e31c2208504d]

Signed-off-by: Gabriel Ganne <gabriel.ganne@gmail.com>
Signed-off-by: Akash Hadke <akash.hadke@kpit.com>
Signed-off-by: Akash Hadke <hadkeakash4@gmail.com>
---
src/common/get.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/get.c b/src/common/get.c
index f9ee92d3..0517bf0a 100644
--- a/src/common/get.c
+++ b/src/common/get.c
@@ -178,7 +178,7 @@ get_l2len(const u_char *pktdata, const int datalen, const int datalink)
break;

case DLT_JUNIPER_ETHER:
- if (datalen >= 5) {
+ if (datalen < 5) {
l2_len = -1;
break;
}
3 changes: 2 additions & 1 deletion meta-networking/recipes-support/tcpreplay/tcpreplay_4.3.3.bb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ SECTION = "net"
LICENSE = "GPLv3"
LIC_FILES_CHKSUM = "file://docs/LICENSE;md5=890b830b22fd632e9ffd996df20338f8"

SRC_URI = "https://github.com/appneta/tcpreplay/releases/download/v${PV}/tcpreplay-${PV}.tar.gz"
SRC_URI = "https://github.com/appneta/tcpreplay/releases/download/v${PV}/tcpreplay-${PV}.tar.gz \
file://CVE-2020-24265-and-CVE-2020-24266.patch"

SRC_URI[md5sum] = "53b52bf64f0b6b9443428e657b37bc6b"
SRC_URI[sha256sum] = "ed2402caa9434ff5c74b2e7b31178c73e7c7c5c4ea1e1d0e2e39a7dc46958fde"
Expand Down

0 comments on commit a09ddd7

Please sign in to comment.