Skip to content

Commit 9cc3b99

Browse files
authored
libpcap: Backport fixes for CVE-2024-8006 (#10793)
1 parent 8b11ebd commit 9cc3b99

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

SPECS/libpcap/CVE-2024-8006.patch

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
From 1af34597acf0ad0392c16c20d35522c35126738f Mon Sep 17 00:00:00 2001
2+
From: Sudipta Pandit <[email protected]>
3+
Date: Mon, 21 Oct 2024 13:38:21 +0530
4+
Subject: [PATCH] Backport patch for CVE-2024-8006
5+
6+
Original Reference: https://github.com/the-tcpdump-group/libpcap/commit/8a633ee5b9ecd9d38a587ac9b204e2380713b0d6
7+
---
8+
pcap-new.c | 8 +++++++-
9+
1 file changed, 7 insertions(+), 1 deletion(-)
10+
11+
diff --git a/pcap-new.c b/pcap-new.c
12+
index 7c006595..eadc3c9c 100644
13+
--- a/pcap-new.c
14+
+++ b/pcap-new.c
15+
@@ -231,13 +231,19 @@ int pcap_findalldevs_ex(const char *source, struct pcap_rmtauth *auth, pcap_if_t
16+
#else
17+
/* opening the folder */
18+
unixdir= opendir(path);
19+
+ if (unixdir == NULL) {
20+
+ snprintf(errbuf, PCAP_ERRBUF_SIZE,
21+
+ "Error when listing files: does folder '%s' exist?", path);
22+
+ return -1;
23+
+ }
24+
25+
/* get the first file into it */
26+
filedata= readdir(unixdir);
27+
28+
if (filedata == NULL)
29+
{
30+
- snprintf(errbuf, PCAP_ERRBUF_SIZE, "Error when listing files: does folder '%s' exist?", path);
31+
+ snprintf(errbuf, PCAP_ERRBUF_SIZE, "Error when listing files: does folder '%s' contain files?", path);
32+
+ closedir(unixdir);
33+
return -1;
34+
}
35+
#endif
36+
--
37+
2.34.1
38+

SPECS/libpcap/libpcap.spec

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
Summary: C/C++ library for network traffic capture
22
Name: libpcap
33
Version: 1.10.1
4-
Release: 2%{?dist}
4+
Release: 3%{?dist}
55
License: BSD
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
88
Group: Networking/Libraries
99
URL: https://www.tcpdump.org/
1010
#Source0: https://github.com/the-tcpdump-group/%{name}/archive/%{name}-%{version}.tar.gz
1111
Source0: %{name}-%{name}-%{version}.tar.gz
12+
Patch0: CVE-2024-8006.patch
1213

1314
%description
1415
Libpcap provides a portable framework for low-level network
@@ -38,7 +39,7 @@ Requires: %{name}-devel = %{version}-%{release}
3839
This package contains static lib for %{name}.
3940

4041
%prep
41-
%setup -q -n %{name}-%{name}-%{version}
42+
%autosetup -p1 -n %{name}-%{name}-%{version}
4243

4344
%build
4445
%configure
@@ -77,6 +78,9 @@ make DESTDIR=%{buildroot} install
7778
%{_libdir}/*.a
7879

7980
%changelog
81+
* Mon Oct 21 2024 Sudipta Pandit <[email protected]> - 1.10.1-3
82+
- Backport patch for CVE-2024-8006
83+
8084
* Wed Dec 13 2023 Zhichun Wan <[email protected]> - 1.10.1-2
8185
- Add static library as sub package
8286

0 commit comments

Comments
 (0)