This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/19534] execle, execlp may use malloc


https://sourceware.org/bugzilla/show_bug.cgi?id=19534

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, rth/execl has been created
        at  81e2801f2a185a7e9e21c15176270d99da5ebc6e (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=81e2801f2a185a7e9e21c15176270d99da5ebc6e

commit 81e2801f2a185a7e9e21c15176270d99da5ebc6e
Author: Richard Henderson <rth@twiddle.net>
Date:   Tue Feb 9 13:43:08 2016 +1100

    alpha: Implement execl{,e,p} without double stack allocation

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4577d8457637adac28ed34bc3f9ce0a936dc786e

commit 4577d8457637adac28ed34bc3f9ce0a936dc786e
Author: Richard Henderson <rth@twiddle.net>
Date:   Tue Feb 9 15:19:32 2016 +1100

    x32: Implement execl{,e,p} without double stack allocation

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=072dce81771f971f49f2480630842a2874a2c860

commit 072dce81771f971f49f2480630842a2874a2c860
Author: Richard Henderson <rth@twiddle.net>
Date:   Tue Feb 9 13:12:33 2016 +1100

    i386: Implement execl{,e,p} without double stack allocation

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=447f711575e70c09fd883f28d86e175993025277

commit 447f711575e70c09fd883f28d86e175993025277
Author: Richard Henderson <rth@twiddle.net>
Date:   Tue Feb 9 12:53:17 2016 +1100

    x86_64: Implement execl{,e,p} without double stack allocation

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f685eeedc6d7baf1bf822ef058e06bc1bcae4541

commit f685eeedc6d7baf1bf822ef058e06bc1bcae4541
Author: Richard Henderson <rth@twiddle.net>
Date:   Tue Feb 9 11:53:32 2016 +1100

    Move posix/execl files to sysdeps/

    This will allow them to be overridable.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c4c95c53bbb6d41b56ad56921f1e14fa43b3e997

commit c4c95c53bbb6d41b56ad56921f1e14fa43b3e997
Author: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
Date:   Mon Feb 1 14:21:03 2016 -0200

    posix: Remove dynamic memory allocation from execl{e,p}

    GLIBC execl{e,p} implementation might use malloc if the total number of i
    arguments exceed initial assumption size (1024).  This might lead to
    issue in two situations:

    1. execl/execle is stated to be async-signal-safe by POSIX [1].  However
       if execl is used in a signal handler with a large argument set (that
       may call malloc internally) and the resulting call fails, it might
       lead malloc in the program in a bad state.

    2. If the functions are used in a vfork/clone(VFORK) situation it also
       might issue malloc internal bad state.

    This patch fixes it by using stack allocation instead.  It also fixes
    BZ#19534.

    Tested on x86_64.

    Changes from previous version:

    - Remove arbitrary limit on stack allocation for argument handling
      (it is arbitrary and does no impose any limit since it does not
      consider current stack size neither stack size limit).

    [1]
http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html

        [BZ #19534]
        * posix/execl.c (execl): Remove dynamic memory allocation.
        * posix/execle.c (execle): Likewise.
        * posix/execlp.c (execlp): Likewise.
    Message-Id:
<1454343665-1706-2-git-send-email-adhemerval.zanella@linaro.org>

-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]