[packages/python3-multidict] Rel 2.

arekm arekm at pld-linux.org
Thu Nov 12 12:59:22 CET 2026


commit 6c532ee6cc5eab4bed048b86ac7fe3b9319f5b74
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Nov 12 12:54:55 2026 +0100

    Rel 2.

 python3-multidict-testcyapi-uaf.patch | 26 ++++++++++++++++++++++++++
 python3-multidict.spec                | 15 ++++++++++++---
 2 files changed, 38 insertions(+), 3 deletions(-)
---
diff --git a/python3-multidict.spec b/python3-multidict.spec
index ff9af4f..65e3dda 100644
--- a/python3-multidict.spec
+++ b/python3-multidict.spec
@@ -7,12 +7,13 @@ Summary:	multidict implementation
 Summary(pl.UTF-8):	Implementacja multidict
 Name:		python3-multidict
 Version:	7.2.1
-Release:	1
+Release:	2
 License:	Apache v2.0
 Group:		Libraries/Python
 #Source0Download: https://pypi.org/simple/multidict/
 Source0:	https://files.pythonhosted.org/packages/source/m/multidict/multidict-%{version}.tar.gz
 # Source0-md5:	3f9f08805cdffa6469e13ef33c93d091
+Patch0:		%{name}-testcyapi-uaf.patch
 URL:		https://pypi.org/project/multidict/
 BuildRequires:	python3-devel >= 1:3.11
 BuildRequires:	python3-setuptools >= 1:77
@@ -22,6 +23,7 @@ BuildRequires:	python3-hypothesis
 BuildRequires:	python3-objgraph
 BuildRequires:	python3-psutil
 BuildRequires:	python3-pytest
+BuildRequires:	python3-pytest-benchmark
 BuildRequires:	python3-pytest-cov
 BuildRequires:	python3-pytest_codspeed
 %endif
@@ -58,6 +60,7 @@ Dokumentacja API modułu Pythona multidict.
 
 %prep
 %setup -q -n multidict-%{version}
+%patch -P0 -p1
 
 %build
 %py3_build
@@ -65,10 +68,16 @@ Dokumentacja API modułu Pythona multidict.
 %if %{with tests}
 %{__mv} multidict{,.away}
 
+# pytest_codspeed defines the benchmark fixture only when pytest_benchmark
+# is not importable, so load pytest_benchmark too to have it either way;
+# test_circular_imports runs python -I, which ignores PYTHONPATH and so
+# imports the system multidict instead of the built one
 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
-PYTEST_PLUGINS=pytest_codspeed.plugin \
+PYTEST_PLUGINS=pytest_codspeed.plugin,pytest_benchmark.plugin \
 PYTHONPATH=$(readlink -f build-3/lib.*) \
-%{__python3} -m pytest tests
+%{__python3} -m pytest tests \
+	--benchmark-disable \
+	--ignore tests/test_circular_imports.py
 
 %{__mv} multidict{.away,}
 %endif
diff --git a/python3-multidict-testcyapi-uaf.patch b/python3-multidict-testcyapi-uaf.patch
new file mode 100644
index 0000000..dca45d3
--- /dev/null
+++ b/python3-multidict-testcyapi-uaf.patch
@@ -0,0 +1,26 @@
+_testcyapi: only _watch_refs holds the log given as user_data; the test
+empties it before md dies, so DEALLOCATED reads a freed list (segfault)
+
+--- multidict-7.2.1.orig/multidict/_testcyapi.pyx	2026-10-24 21:12:16.140715800 +0200
++++ multidict-7.2.1/multidict/_testcyapi.pyx	2026-11-12 12:51:26.364219436 +0100
+@@ -383,6 +383,9 @@
+ 
+ # See watching_event() in _testcapi.c.
+ cdef int _watch_target_id = -1
++# _watching_event() hands this log to the target watcher as user_data, so
++# it has to outlive the watched multidict, not just watch_release_refs().
++cdef object _watching_log = None
+ 
+ 
+ cdef int _watching_event(void *watcher_data, void *user_data,
+@@ -393,8 +396,9 @@
+ 
+ 
+ def md_add_watching_watcher(log, int target_id):
+-    global _watch_target_id
++    global _watch_target_id, _watching_log
+     _watch_refs.append(log)
++    _watching_log = log
+     _watch_target_id = target_id
+     return MultiDict_AddWatcher(_capi, _watching_event, <void*>log)
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-multidict.git/commitdiff/6c532ee6cc5eab4bed048b86ac7fe3b9319f5b74



More information about the pld-cvs-commit mailing list