From f83bb9b8e97656ae0d3e2a31e859363e2d4d5832 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Fri, 29 Jan 2016 11:43:40 -0200 Subject: posix: Remove dynamic memory allocation from execl{e,p} GLIBC execl{e,p} implementation might use malloc if the total number of arguments exceed initial assumption size (1024). This might lead to issues 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 if 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. [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. --- ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 12b88fdb3a..45fb9cad15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2016-03-07 Adhemerval Zanella + + [BZ #19534] + * posix/execl.c (execl): Remove dynamic memory allocation. + * posix/execle.c (execle): Likewise. + * posix/execlp.c (execlp): Likewise. + 2016-03-06 H.J. Lu * sysdeps/x86_64/multiarch/memcpy-avx512-no-vzeroupper.S: -- cgit v1.2.3