-
Notifications
You must be signed in to change notification settings - Fork 546
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch cmake for CVE-2023-28320 (#9946)
Co-authored-by: Zhichun Wan <[email protected]> Co-authored-by: jslobodzian <[email protected]>
- Loading branch information
1 parent
6a8cead
commit 45d3f41
Showing
4 changed files
with
87 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
From def1a172f3a5ac13c3cd5687d2a352262b02e358 Mon Sep 17 00:00:00 2001 | ||
From: Zhichun Wan <[email protected]> | ||
Date: Fri, 26 Jul 2024 22:30:10 +0000 | ||
Subject: [PATCH] patches | ||
|
||
--- | ||
Utilities/cmcurl/lib/hostip.c | 19 +++++++++++++++---- | ||
1 file changed, 15 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/Utilities/cmcurl/lib/hostip.c b/Utilities/cmcurl/lib/hostip.c | ||
index e0e3cfc2..a763ad84 100644 | ||
--- a/Utilities/cmcurl/lib/hostip.c | ||
+++ b/Utilities/cmcurl/lib/hostip.c | ||
@@ -72,12 +72,19 @@ | ||
#include <SystemConfiguration/SCDynamicStoreCopySpecific.h> | ||
#endif | ||
|
||
-#if defined(CURLRES_SYNCH) && \ | ||
- defined(HAVE_ALARM) && defined(SIGALRM) && defined(HAVE_SIGSETJMP) | ||
+#if defined(CURLRES_SYNCH) && \ | ||
+ defined(HAVE_ALARM) && \ | ||
+ defined(SIGALRM) && \ | ||
+ defined(HAVE_SIGSETJMP) && \ | ||
+ defined(GLOBAL_INIT_IS_THREADSAFE) | ||
/* alarm-based timeouts can only be used with all the dependencies satisfied */ | ||
#define USE_ALARM_TIMEOUT | ||
#endif | ||
|
||
+#ifdef USE_ALARM_TIMEOUT | ||
+#include "easy_lock.h" | ||
+#endif | ||
+ | ||
#define MAX_HOSTCACHE_LEN (255 + 7) /* max FQDN + colon + port number + zero */ | ||
|
||
/* | ||
@@ -249,11 +256,12 @@ void Curl_hostcache_prune(struct Curl_easy *data) | ||
Curl_share_unlock(data, CURL_LOCK_DATA_DNS); | ||
} | ||
|
||
-#ifdef HAVE_SIGSETJMP | ||
+#ifdef USE_ALARM_TIMEOUT | ||
/* Beware this is a global and unique instance. This is used to store the | ||
return address that we can jump back to from inside a signal handler. This | ||
is not thread-safe stuff. */ | ||
sigjmp_buf curl_jmpenv; | ||
+curl_simple_lock curl_jmpenv_lock; | ||
#endif | ||
|
||
/* lookup address, returns entry if found and not stale */ | ||
@@ -640,7 +648,6 @@ enum resolve_t Curl_resolv(struct Curl_easy *data, | ||
static | ||
void alarmfunc(int sig) | ||
{ | ||
- /* this is for "-ansi -Wall -pedantic" to stop complaining! (rabe) */ | ||
(void)sig; | ||
siglongjmp(curl_jmpenv, 1); | ||
} | ||
@@ -720,6 +727,8 @@ enum resolve_t Curl_resolv_timeout(struct Curl_easy *data, | ||
This should be the last thing we do before calling Curl_resolv(), | ||
as otherwise we'd have to worry about variables that get modified | ||
before we invoke Curl_resolv() (and thus use "volatile"). */ | ||
+ curl_simple_lock_lock(&curl_jmpenv_lock); | ||
+ | ||
if(sigsetjmp(curl_jmpenv, 1)) { | ||
/* this is coming from a siglongjmp() after an alarm signal */ | ||
failf(data, "name lookup timed out"); | ||
@@ -788,6 +797,8 @@ clean_up: | ||
#endif | ||
#endif /* HAVE_SIGACTION */ | ||
|
||
+ curl_simple_lock_unlock(&curl_jmpenv_lock); | ||
+ | ||
/* switch back the alarm() to either zero or to what it was before minus | ||
the time we spent until now! */ | ||
if(prev_alarm) { | ||
-- | ||
2.39.4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
Summary: Cmake | ||
Name: cmake | ||
Version: 3.21.4 | ||
Release: 10%{?dist} | ||
Release: 11%{?dist} | ||
License: BSD AND LGPLv2+ | ||
Vendor: Microsoft Corporation | ||
Distribution: Mariner | ||
|
@@ -20,6 +20,7 @@ Patch5: CVE-2023-35945.patch | |
Patch6: CVE-2023-38545.patch | ||
Patch7: CVE-2023-38546.patch | ||
Patch8: cve-2023-44487.patch | ||
Patch9: CVE-2023-28320.patch | ||
BuildRequires: bzip2 | ||
BuildRequires: bzip2-devel | ||
BuildRequires: curl | ||
|
@@ -85,6 +86,9 @@ bin/ctest --force-new-ctest-process --rerun-failed --output-on-failure | |
%{_prefix}/doc/%{name}-*/* | ||
|
||
%changelog | ||
* Fri Jul 26 2024 Zhichun Wan <[email protected]> - 3.21.4-11 | ||
- Patch CVE-2023-28320.patch | ||
|
||
* Thu Oct 19 2023 Dan Streetman <[email protected]> - 3.21.4-10 | ||
- Patch vendored nghttp2 for CVE-2023-44487 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters