Skip to content

Commit

Permalink
Add patches for CVE-2024-12254
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Dec 6, 2024
1 parent be03184 commit 2ac2626
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
24 changes: 24 additions & 0 deletions python/3.12/gh-127655-Fix-CVE-2024-12254.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 21dfa1330d26737631ac6d149c3992d38871678b Mon Sep 17 00:00:00 2001
From: "J. Nick Koston" <[email protected]>
Date: Thu, 5 Dec 2024 10:01:10 -0600
Subject: [PATCH 1/2] Ensure writelines pauses the protocol if needed

---
Lib/asyncio/selector_events.py | 1 +
1 file changed, 1 insertion(+)

diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py
index f94bf10b422..f1ab9b12d69 100644
--- a/Lib/asyncio/selector_events.py
+++ b/Lib/asyncio/selector_events.py
@@ -1175,6 +1175,7 @@ def writelines(self, list_of_data):
# If the entire buffer couldn't be written, register a write handler
if self._buffer:
self._loop._add_writer(self._sock_fd, self._write_ready)
+ self._maybe_pause_protocol()

def can_write_eof(self):
return True
--
2.39.3 (Apple Git-145)

24 changes: 24 additions & 0 deletions python/3.13/gh-127655-Fix-CVE-2024-12254.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 21dfa1330d26737631ac6d149c3992d38871678b Mon Sep 17 00:00:00 2001
From: "J. Nick Koston" <[email protected]>
Date: Thu, 5 Dec 2024 10:01:10 -0600
Subject: [PATCH 1/2] Ensure writelines pauses the protocol if needed

---
Lib/asyncio/selector_events.py | 1 +
1 file changed, 1 insertion(+)

diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py
index f94bf10b422..f1ab9b12d69 100644
--- a/Lib/asyncio/selector_events.py
+++ b/Lib/asyncio/selector_events.py
@@ -1175,6 +1175,7 @@ def writelines(self, list_of_data):
# If the entire buffer couldn't be written, register a write handler
if self._buffer:
self._loop._add_writer(self._sock_fd, self._write_ready)
+ self._maybe_pause_protocol()

def can_write_eof(self):
return True
--
2.39.3 (Apple Git-145)

0 comments on commit 2ac2626

Please sign in to comment.