Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 208180 Details for
Bug 290249
sys-apps/sandbox deadlocks if other library interposes mmap() and calls open() in it
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
libsandbox-mmap.patch
libsandbox-mmap.patch (text/plain), 1.90 KB, created by
SpanKY
on 2009-10-25 08:59:44 UTC
(
hide
)
Description:
libsandbox-mmap.patch
Filename:
MIME Type:
Creator:
SpanKY
Created:
2009-10-25 08:59:44 UTC
Size:
1.90 KB
patch
obsolete
>diff --git a/libsandbox/libsandbox.h b/libsandbox/libsandbox.h >index 28154c5..dc847cb 100644 >--- a/libsandbox/libsandbox.h >+++ b/libsandbox/libsandbox.h >@@ -52,6 +52,8 @@ bool before_syscall_access(int, int, const char *, const char *, int); > bool before_syscall_open_int(int, int, const char *, const char *, int); > bool before_syscall_open_char(int, int, const char *, const char *, const char *); > >+void *get_dlsym(const char *symname, const char *symver); >+ > extern char sandbox_lib[SB_PATH_MAX]; > extern bool sandbox_on; > extern pid_t trace_pid; >diff --git a/libsandbox/memory.c b/libsandbox/memory.c >index 05e9691..0d312a4 100644 >--- a/libsandbox/memory.c >+++ b/libsandbox/memory.c >@@ -15,6 +15,24 @@ > #include "libsandbox.h" > #include "sbutil.h" > >+/* Well screw me sideways, someone decided to override mmap() #290249 */ >+static void *(*_sb_mmap)(void *addr, size_t length, int prot, int flags, int fd, off_t offset); >+static void *sb_mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) >+{ >+ if (!_sb_mmap) >+ _sb_mmap = get_dlsym("mmap", NULL); >+ return _sb_mmap(addr, length, prot, flags, fd, offset); >+} >+#define mmap sb_mmap >+static int (*_sb_munmap)(void *addr, size_t length); >+static int sb_munmap(void *addr, size_t length) >+{ >+ if (!_sb_munmap) >+ _sb_munmap = get_dlsym("munmap", NULL); >+ return _sb_munmap(addr, length); >+} >+#define munmap sb_munmap >+ > #define SB_MALLOC_TO_MMAP(ptr) ((void*)(((size_t*)ptr) - 1)) > #define SB_MMAP_TO_MALLOC(ptr) ((void*)(((size_t*)ptr) + 1)) > #define SB_MALLOC_TO_SIZE(ptr) (*((size_t*)SB_MALLOC_TO_MMAP(ptr))) >diff --git a/libsandbox/wrappers.c b/libsandbox/wrappers.c >index 6094f51..97ee176 100644 >--- a/libsandbox/wrappers.c >+++ b/libsandbox/wrappers.c >@@ -21,7 +21,7 @@ > > static void *libc_handle = NULL; > >-static void *get_dlsym(const char *symname, const char *symver) >+void *get_dlsym(const char *symname, const char *symver) > { > void *symaddr = NULL; >
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 290249
: 208180