Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 372412 Details for
Bug 432520
media-libs/mesa-8.0.3: segfault in nouveau_dri (?) due to RWX mmap
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
http://cgit.freedesktop.org/mesa/mesa/patch/?id=4dd445f1cf80292f10eda53665cefc2a674d838d
mesa-mmap.patch (text/plain), 1.73 KB, created by
Nikoli
on 2014-03-11 20:31:30 UTC
(
hide
)
Description:
http://cgit.freedesktop.org/mesa/mesa/patch/?id=4dd445f1cf80292f10eda53665cefc2a674d838d
Filename:
MIME Type:
Creator:
Nikoli
Created:
2014-03-11 20:31:30 UTC
Size:
1.73 KB
patch
obsolete
>From 4dd445f1cf80292f10eda53665cefc2a674d838d Mon Sep 17 00:00:00 2001 >From: Emil Velikov <emil.l.velikov@gmail.com> >Date: Fri, 10 Jan 2014 18:00:17 +0000 >Subject: gallium/rtasm: handle mmap failures appropriately > >For a variety of reasons mmap (selinux and pax to name >a few) and can fail and with current code. This will >result in a crash in the driver, if not worse. > >This has been the case since the inception of the >gallium copy of rtasm. > >Cc: 9.1 9.2 10.0 <mesa-stable@lists.freedesktop.org> >Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73473 >Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> >Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> >--- >diff --git a/src/gallium/auxiliary/rtasm/rtasm_execmem.c b/src/gallium/auxiliary/rtasm/rtasm_execmem.c >index edc1b66..8c3dbef 100644 >--- a/src/gallium/auxiliary/rtasm/rtasm_execmem.c >+++ b/src/gallium/auxiliary/rtasm/rtasm_execmem.c >@@ -69,7 +69,7 @@ static struct mem_block *exec_heap = NULL; > static unsigned char *exec_mem = NULL; > > >-static void >+static int > init_heap(void) > { > if (!exec_heap) >@@ -79,6 +79,8 @@ init_heap(void) > exec_mem = (unsigned char *) mmap(0, EXEC_HEAP_SIZE, > PROT_EXEC | PROT_READ | PROT_WRITE, > MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); >+ >+ return (exec_mem != MAP_FAILED); > } > > >@@ -90,7 +92,8 @@ rtasm_exec_malloc(size_t size) > > pipe_mutex_lock(exec_mutex); > >- init_heap(); >+ if (!init_heap()) >+ goto bail; > > if (exec_heap) { > size = (size + 31) & ~31; /* next multiple of 32 bytes */ >@@ -101,7 +104,8 @@ rtasm_exec_malloc(size_t size) > addr = exec_mem + block->ofs; > else > debug_printf("rtasm_exec_malloc failed\n"); >- >+ >+bail: > pipe_mutex_unlock(exec_mutex); > > return addr; >-- >cgit v0.9.0.2-2-gbebe
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 432520
:
322062
| 372412