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 serhiy.storchaka
Recipients serhiy.storchaka
Date 2017-04-13.10:14:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1492078441.09.0.999748140134.issue30065@psf.upfronthosting.co.za>
In-reply-to
Content
_posixsubprocess.fork_exec() takes a sequence of file descriptors. It first validates it, and since the validation is passed uses it without checking for errors. But since __len__, __getitem__ and __int__ can execute user code and release GIL, errors can occur after the validation. This can cause a crash.

Proposed patch fixes this by the simplest way -- it restricts the type of a sequence to tuple and types of elements to int. Since _posixsubprocess is private module this shouldn't break third-party code.

Other issue with _posixsubprocess.fork_exec() was that it converts args to a tuple or a list and iterate it without checking if the size is changed.
History
Date User Action Args
2017-04-13 10:14:01serhiy.storchakasetrecipients: + serhiy.storchaka
2017-04-13 10:14:01serhiy.storchakasetmessageid: <1492078441.09.0.999748140134.issue30065@psf.upfronthosting.co.za>
2017-04-13 10:14:00serhiy.storchakalinkissue30065 messages
2017-04-13 10:14:00serhiy.storchakacreate