➜

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.

作者 radegand
收信人 radegand, theller
日期 2010-07-26.17:02:33
SpamBayes Score 0.0026666755
Marked as misclassified 否
Message-id <1280163756.22.0.278914543931.issue9385@psf.upfronthosting.co.za>
In-reply-to
内容
Hi,

Python ctypes module creates a 'rwx' memory mapping (defined in malloc_closure.c) which causes python to crash when running under grsecurity enabled kernel and could also have a negative security impact. 

Is there any specific need for the mmap call to create an executable mapping or can it be safely removed? 

Please refer here for more information and proposed patch:
http://bugs.gentoo.org/show_bug.cgi?id=329499

The actual mmap call:
item = (ITEM *)mmap(NULL,
                            count * sizeof(ITEM),
                            PROT_READ | PROT_WRITE | PROT_EXEC,
                            MAP_PRIVATE | MAP_ANONYMOUS,
                            -1,
                            0);

There has been further investigation done by Gentoo users and work towards python handling this error gracefully rather than segfaulting. It seems that dereference at Py_XDECREF(self->restype); (line 23 of Modules/_ctypes/callbacks.c) causes the segfault.

Thanks.
历史
日期 用户 动作 参数
2010-07-26 17:02:36radegand修改recipients: + radegand, theller
2010-07-26 17:02:36radegand修改messageid: <1280163756.22.0.278914543931.issue9385@psf.upfronthosting.co.za>
2010-07-26 17:02:34radegand链接issue9385 messages
2010-07-26 17:02:33radegand创建