This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author baikie
Recipients baikie
Date 2011-09-20.21:00:46
SpamBayes Score 2.3625104e-09
Marked as misclassified No
Message-id <1316552449.49.0.318949569142.issue13022@psf.upfronthosting.co.za>
In-reply-to
Content
The function _multiprocessing.recvfd() calls recvmsg() and
expects to receive a file descriptor in an SCM_RIGHTS control
message, but doesn't check that such a control message is
actually present.  So if the sender sends data without an
accompanying file descriptor, recvfd() will the return the
integer value of the uninitialized CMSG_DATA() buffer.

The attached recvfd-check.diff checks for a complete control
message of the correct type, and raises RuntimeError if it isn't
there.  This matches the behaviour of the proposed pure-Python
implementation at issue #12981.

The patch includes a test case, but like the other recently-added
tests for the function, it isn't guarded against
multiprocessing.reduction being unavailable.  Issue #12981 has a
patch "skip_reduction.diff" (already in 3.3) to fix this, and I'm
attaching recvfd-skip-reduction-fix.diff to apply on top of it
and guard the new test case as well.
History
Date User Action Args
2011-09-20 21:00:49baikiesetrecipients: + baikie
2011-09-20 21:00:49baikiesetmessageid: <1316552449.49.0.318949569142.issue13022@psf.upfronthosting.co.za>
2011-09-20 21:00:47baikielinkissue13022 messages
2011-09-20 21:00:47baikiecreate