From 27cdd4f67785759202b3bb193713031ab4a81019 Mon Sep 17 00:00:00 2001 From: Peter van Vugt Date: Tue, 21 Apr 2026 12:04:58 -0700 Subject: [PATCH 1/2] gh-148850: Fix msan false positive in os.getrandom --- Modules/posixmodule.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index e5ce487723b25b..c07d0f89d4e6f0 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -17195,6 +17195,10 @@ os_getrandom_impl(PyObject *module, Py_ssize_t size, int flags) goto error; } +#ifdef _Py_MEMORY_SANITIZER + __msan_unpoison(data, size); +#endif + return PyBytesWriter_FinishWithSize(writer, n); error: From ca5db2bfdfcaaa6c074578a81b1d0ddd448bb4f9 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Tue, 21 Apr 2026 19:29:30 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2026-04-21-19-29-29.gh-issue-148850.MSH0J_.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Core_and_Builtins/2026-04-21-19-29-29.gh-issue-148850.MSH0J_.rst diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2026-04-21-19-29-29.gh-issue-148850.MSH0J_.rst b/Misc/NEWS.d/next/Core_and_Builtins/2026-04-21-19-29-29.gh-issue-148850.MSH0J_.rst new file mode 100644 index 00000000000000..324d1610310158 --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2026-04-21-19-29-29.gh-issue-148850.MSH0J_.rst @@ -0,0 +1 @@ +Fix the memory sanitizer false positive in :func:`os.getrandom`.