On Thu, Jan 27, 2011 at 01:54:20PM +0100, Pierre Ynard wrote:
> reassign 611195 libc6
> tags 611195 + patch
> thanks
> 
> > so there you have it in a nutshell. probably the quickest 'fix' is to
> > at least add a check for mprotect's return value
> 
> I wrote a patch that should fix the segfault. I couldn't test it because
> I don't have an appropriate environment to rebuild eglibc and test the
> issue.
> 
> 
> --- elf/dl-load.c     2011-01-26 22:02:02.000000000 +0100
> +++ elf/dl-load.c     2011-01-26 22:30:22.000000000 +0100
> @@ -1398,7 +1398,11 @@
>         if (__builtin_expect (p + s <= relro_end, 1))
>           {
>             /* The variable lies in the region protected by RELRO.  */
> -           __mprotect ((void *) p, s, PROT_READ|PROT_WRITE);
> +           if (__mprotect ((void *) p, s, PROT_READ|PROT_WRITE) < 0)
> +             {
> +               errstring = N_("cannot change memory protections");
> +               goto call_lose_errno;
> +             }
>             __stack_prot |= PROT_READ|PROT_WRITE|PROT_EXEC;
>             __mprotect ((void *) p, s, PROT_READ);
>           }
> 
> 

Given the patch has been refused by upstream glibc, could you please
send it to patc...@eglibc.org with an explanation how what it does, and
stating that it has been refused in glibc?

I am going to apply it in debian, but I don't want to keep it eternally,
so it has to be merged some way.

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurel...@aurel32.net                 http://www.aurel32.net



-- 
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20110226103505.ga11...@volta.aurel32.net

Reply via email to