Skip to content

umbrella: mgr: fix PyObject leak in the remote() pickle calls - #69858

Merged
batrick merged 1 commit into
ceph:umbrellafrom
tchaikov:wip-77776-umbrella
Aug 3, 2026
Merged

batrick merged 1 commit into
ceph:umbrellafrom
tchaikov:wip-77776-umbrella

Conversation

@tchaikov

@tchaikov tchaikov commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

dispatch_remote() and ceph_dispatch_remote() invoke pickle.loads/dumps via
PyObject_CallMethodObjArgs(pmodule, PyUnicode_FromString("loads"), ...). The
method-name string created by PyUnicode_FromString is a new reference that
CallMethodObjArgs does not steal, and it was never released, so every cross
-module remote() call leaked three PyUnicode objects on the active mgr.

Use PyObject_CallMethod(pmodule, "loads", "(O)", arg), which takes the method
name as a C string and manages it internally, so there is nothing to leak.
The "(O)" format wraps the argument in a one-tuple so it reaches the callee as
a single object. A bare "O" passes the argument through directly, and when it
is a tuple (as remote()'s *args always is, including the empty tuple from a
no-argument call) PyObject_CallMethod unpacks it and calls dumps() with the
wrong arguments, e.g. dumps() with none.

Fixes: https://tracker.ceph.com/issues/77724
Signed-off-by: Kefu Chai <[email protected]>
(cherry picked from commit 8ae44f6)
@tchaikov
tchaikov requested a review from a team as a code owner July 1, 2026 05:17
@tchaikov tchaikov added this to the umbrella milestone Jul 1, 2026
@tchaikov tchaikov added the core label Jul 1, 2026
@github-actions github-actions Bot added mgr releng-audit-pass Release engineering: passed backport verification audit. labels Jul 1, 2026
@tchaikov

tchaikov commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@mheler could you help review this change?

@tchaikov
tchaikov requested a review from mheler July 9, 2026 04:53
@batrick

batrick commented Jul 20, 2026

Copy link
Copy Markdown
Member

jenkins test api

@yuriw

yuriw commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-yuri8-testing-20260721.164157-umbrella.

@JonBailey1993

Copy link
Copy Markdown
Contributor

@batrick batrick removed the releng-audit-pass Release engineering: passed backport verification audit. label Aug 3, 2026
@github-actions github-actions Bot added the releng-audit-pass Release engineering: passed backport verification audit. label Aug 3, 2026
@batrick
batrick merged commit 677282e into ceph:umbrella Aug 3, 2026
11 of 12 checks passed
@batrick batrick modified the milestones: umbrella, v21.1.1 Aug 3, 2026
@tchaikov
tchaikov deleted the wip-77776-umbrella branch August 4, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core mgr needs-qa releng-audit-pass Release engineering: passed backport verification audit. wip-yuri8-testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants