- Add 00398-fix-stack-overwrite-on-32-bit-in-perf-map-test-harness-gh-104811-104823.patch gh#python/cpython#104811 - Refresh all patches - Update to 3.12.0b1: Full changelog can be found here https://docs.python.org/dev/whatsnew/changelog.html#python-3-12-0-beta-1 OBS-URL: https://build.opensuse.org/request/show/1090373 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python312?expand=0&rev=7
44 lines
1.4 KiB
Diff
44 lines
1.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Carl Meyer <carl@oddbird.net>
|
|
Date: Tue, 23 May 2023 16:04:31 -0600
|
|
Subject: [PATCH] 00398: fix stack overwrite on 32-bit in perf map test harness
|
|
(#104811)
|
|
|
|
---
|
|
Modules/_testinternalcapi.c | 13 +++++++++----
|
|
1 file changed, 9 insertions(+), 4 deletions(-)
|
|
|
|
Index: Python-3.12.0b1/Modules/_testinternalcapi.c
|
|
===================================================================
|
|
--- Python-3.12.0b1.orig/Modules/_testinternalcapi.c
|
|
+++ Python-3.12.0b1/Modules/_testinternalcapi.c
|
|
@@ -762,19 +762,24 @@ clear_extension(PyObject *self, PyObject
|
|
static PyObject *
|
|
write_perf_map_entry(PyObject *self, PyObject *args)
|
|
{
|
|
+ PyObject *code_addr_v;
|
|
const void *code_addr;
|
|
unsigned int code_size;
|
|
const char *entry_name;
|
|
|
|
- if (!PyArg_ParseTuple(args, "KIs", &code_addr, &code_size, &entry_name))
|
|
+ if (!PyArg_ParseTuple(args, "OIs", &code_addr_v, &code_size, &entry_name))
|
|
return NULL;
|
|
+ code_addr = PyLong_AsVoidPtr(code_addr_v);
|
|
+ if (code_addr == NULL) {
|
|
+ return NULL;
|
|
+ }
|
|
|
|
int ret = PyUnstable_WritePerfMapEntry(code_addr, code_size, entry_name);
|
|
- if (ret == -1) {
|
|
- PyErr_SetString(PyExc_OSError, "Failed to write performance map entry");
|
|
+ if (ret < 0) {
|
|
+ PyErr_SetFromErrno(PyExc_OSError);
|
|
return NULL;
|
|
}
|
|
- return Py_BuildValue("i", ret);
|
|
+ return PyLong_FromLong(ret);
|
|
}
|
|
|
|
static PyObject *
|