Skip to content

Commit bb9e7a6

Browse files
Patch curl to fix CVE-2025-0665, CVE-2025-0167, CVE-2025-0725 [High] (#12350)
1 parent d31c91c commit bb9e7a6

File tree

8 files changed

+562
-15
lines changed

8 files changed

+562
-15
lines changed

SPECS/curl/CVE-2025-0167.patch

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
From eb239c24ea6ab8d2f1f3190572cdc6b646341cb0 Mon Sep 17 00:00:00 2001
2+
From: Kanishk-Bansal <[email protected]>
3+
Date: Thu, 13 Feb 2025 19:53:56 +0000
4+
Subject: [PATCH] CVE-2025-0167
5+
Upstream source: https://github.com/curl/curl/commit/0e120c5b925e8ca75d5319e
6+
---
7+
lib/netrc.c | 15 ++++++++++-----
8+
1 file changed, 10 insertions(+), 5 deletions(-)
9+
10+
diff --git a/lib/netrc.c b/lib/netrc.c
11+
index d5ee3c0..b5002fb 100644
12+
--- a/lib/netrc.c
13+
+++ b/lib/netrc.c
14+
@@ -309,11 +309,16 @@ static int parsenetrc(struct store_netrc *store,
15+
16+
out:
17+
Curl_dyn_free(&token);
18+
- if(!retcode && !password && our_login) {
19+
- /* success without a password, set a blank one */
20+
- password = strdup("");
21+
- if(!password)
22+
- retcode = 1; /* out of memory */
23+
+ if(!retcode) {
24+
+ if(!password && our_login) {
25+
+ /* success without a password, set a blank one */
26+
+ password = strdup("");
27+
+ if(!password)
28+
+ retcode = 1; /* out of memory */
29+
+ }
30+
+ else if(!login && !password)
31+
+ /* a default with no credentials */
32+
+ retcode = NETRC_FILE_MISSING;
33+
}
34+
if(!retcode) {
35+
/* success */
36+
--
37+
2.45.2
38+

SPECS/curl/CVE-2025-0665.patch

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
From ff5091aa9f73802e894b1cbdf24ab84e103200e2 Mon Sep 17 00:00:00 2001
2+
From: Andy Pan <[email protected]>
3+
Date: Thu, 12 Dec 2024 12:48:56 +0000
4+
Subject: [PATCH] async-thread: avoid closing eventfd twice
5+
6+
When employing eventfd for socketpair, there is only one file
7+
descriptor. Closing that fd twice might result in fd corruption.
8+
Thus, we should avoid closing the eventfd twice, following the
9+
pattern in lib/multi.c.
10+
11+
Fixes #15725
12+
Closes #15727
13+
Reported-by: Christian Heusel
14+
---
15+
lib/asyn-thread.c | 2 ++
16+
1 file changed, 2 insertions(+)
17+
18+
diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c
19+
index a58e4b790494..32d496b107cb 100644
20+
--- a/lib/asyn-thread.c
21+
+++ b/lib/asyn-thread.c
22+
@@ -195,9 +195,11 @@ void destroy_thread_sync_data(struct thread_sync_data *tsd)
23+
* close one end of the socket pair (may be done in resolver thread);
24+
* the other end (for reading) is always closed in the parent thread.
25+
*/
26+
+#ifndef USE_EVENTFD
27+
if(tsd->sock_pair[1] != CURL_SOCKET_BAD) {
28+
wakeup_close(tsd->sock_pair[1]);
29+
}
30+
+#endif
31+
#endif
32+
memset(tsd, 0, sizeof(*tsd));
33+
}

0 commit comments

Comments
 (0)