[PATCH] Fix segfault in maybe_script_execute.

Stefan Liebler stli@linux.ibm.com
Fri Sep 7 10:33:00 GMT 2018


On 09/07/2018 09:57 AM, Adhemerval Zanella wrote:
> Thanks for the patch, could you check if we need to backport this fix to older releases as well?
> 
As far as I've seen, maybe_script_execute was introduced with commit 
"posix: New Linux posix_spawn{p} implementation" 
(https://sourceware.org/git/?p=glibc.git;a=commit;h=9ff72da471a509a8c19791efe469f47fa6977410)
=> first release was glibc 2.24.

Should it be backported to all versions: glibc 2.24 ... 2.28?

Bye
Stefan

> Inviato da iPhone
> 
>> Il giorno 06 set 2018, alle ore 13:30, Stefan Liebler <stli@linux.ibm.com> ha scritto:
>>
>>> On 09/06/2018 12:33 PM, Andreas Schwab wrote:
>>>> On Sep 06 2018, Stefan Liebler <stli@linux.ibm.com> wrote:
>>>> commit 03a8c686eab8e12b4c478e7606963db6a72f6f0e
>>>> Author: Stefan Liebler <stli@linux.ibm.com>
>>>> Date:   Thu Sep 6 12:27:38 2018 +0200
>>>>
>>>>      Fix segfault in maybe_script_execute.
>>>>           If glibc is built with gcc 8 and -march=z900,
>>>>      the testcase posix/tst-spawn4-compat crashes with a segfault.
>>>>           In function maybe_script_execute, the new_argv array is dynamically
>>>>      initialized on stack with (argc + 1) elements.
>>>>      The function wants to add _PATH_BSHELL as the first argument
>>>>      and writes out of bounds of new_argv.
>>>>      There is an off-by-one because maybe_script_execute fails to count
>>>>      the terminating NULL when sizing new_argv.
>>>>           ChangeLog:
>>>>                   * sysdeps/unix/sysv/linux/spawni.c (maybe_script_execute):
>>>>              Increment size of new_argv by one.
>>> Ok, thanks.
>>> Andreas.
>>
>> Committed.
>>
>> Thanks.
>> Stefan
>>
> 



More information about the Libc-alpha mailing list