]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-148178: Validate remote debug offset tables on load (GH-148187) (#148577)
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Mon, 4 May 2026 21:43:43 +0000 (22:43 +0100)
committerGitHub <noreply@github.com>
Mon, 4 May 2026 21:43:43 +0000 (22:43 +0100)
commit316f6265b7f9ca4ffed5346b747475ef1943f35d
tree90e8807383110a83f09861df5693710e02d47025
parent690b2bb6159c1f58d5907df14a3a243c6a46e7ce
[3.14] gh-148178: Validate remote debug offset tables on load (GH-148187) (#148577)

Treat the debug offset tables read from a target process as untrusted input
and validate them before the unwinder uses any reported sizes or offsets.

Add a shared validator in debug_offsets_validation.h and run it once when
_Py_DebugOffsets is loaded and once when AsyncioDebug is loaded. The checks
cover section sizes used for fixed local buffers and every offset that is
later dereferenced against a local buffer or local object view. This keeps
the bounds checks out of the sampling hot path while rejecting malformed
tables up front.
(cherry picked from commit 289fd2c97a7e5aecb8b69f94f5e838ccfeee7e67)
Misc/NEWS.d/next/Security/2026-04-06-13-55-00.gh-issue-148178.Rs7kLm.rst [new file with mode: 0644]
Modules/_remote_debugging_module.c