Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 297185 Details for
Bug 329499
dev-lang/python-2.6 'rwx' mmap() calls prevent loading of ctypes module (possibly others) under new PaX kernels
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
libffi part of the fix (3.0.10)
libffi-3.0.10-honor-PROT_EXEC-restrictions.patch (text/plain), 1.34 KB, created by
Pavel Labushev
on 2011-12-28 10:37:18 UTC
(
hide
)
Description:
libffi part of the fix (3.0.10)
Filename:
MIME Type:
Creator:
Pavel Labushev
Created:
2011-12-28 10:37:18 UTC
Size:
1.34 KB
patch
obsolete
>--- a/src/closures.c >+++ b/src/closures.c >@@ -458,29 +458,19 @@ dlmmap (void *start, size_t length, int > printf ("mapping in %zi\n", length); > #endif > >- if (execfd == -1 && !is_selinux_enabled ()) >+ ptr = mmap (start, length, prot | PROT_EXEC, flags, fd, offset); >+ if (ptr != MFAIL || (errno != EPERM && errno != EACCES)) > { >- ptr = mmap (start, length, prot | PROT_EXEC, flags, fd, offset); >- >- if (ptr != MFAIL || (errno != EPERM && errno != EACCES)) >- /* Cool, no need to mess with separate segments. */ >- return ptr; >- >- /* If MREMAP_DUP is ever introduced and implemented, try mmap >- with ((prot & ~PROT_WRITE) | PROT_EXEC) and mremap with >- MREMAP_DUP and prot at this point. */ >+ return ptr; > } >- >- if (execsize == 0 || execfd == -1) >+ else > { >- pthread_mutex_lock (&open_temp_exec_file_mutex); >- ptr = dlmmap_locked (start, length, prot, flags, offset); >- pthread_mutex_unlock (&open_temp_exec_file_mutex); >- >- return ptr; >+ /* Retry without PROT_EXEC. This should work in most cases. */ >+ ptr = mmap (start, length, prot, flags, fd, offset); >+ if (ptr != MFAIL || (errno != EPERM && errno != EACCES)) >+ return ptr; > } >- >- return dlmmap_locked (start, length, prot, flags, offset); >+ return MFAIL; > } > > /* Release memory at the given address, as well as the corresponding
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 329499
:
239871
|
239875
|
240887
|
240889
|
240891
|
288671
|
297183
| 297185 |
298441
|
298841
|
304207
|
308707
|
308711