Message144351
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. |
|
Date |
User |
Action |
Args |
2011-09-20 21:00:49 | baikie | set | recipients:
+ baikie |
2011-09-20 21:00:49 | baikie | set | messageid: <1316552449.49.0.318949569142.issue13022@psf.upfronthosting.co.za> |
2011-09-20 21:00:47 | baikie | link | issue13022 messages |
2011-09-20 21:00:47 | baikie | create | |
|