summary refs log tree commit diff
path: root/posix/Makefile
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2016-01-29 11:43:40 -0200
committerAdhemerval Zanella <adhemerval.zanella@linaro.com>2016-03-07 00:21:36 -0300
commitf83bb9b8e97656ae0d3e2a31e859363e2d4d5832 (patch)
tree3360c4505fee657945315275c1a23d2347c52c08 /posix/Makefile
parentfee9eb6200f0e44a4b684903bc47fde36d46f1a5 (diff)
downloadglibc-f83bb9b8e97656ae0d3e2a31e859363e2d4d5832.tar.gz
glibc-f83bb9b8e97656ae0d3e2a31e859363e2d4d5832.tar.xz
glibc-f83bb9b8e97656ae0d3e2a31e859363e2d4d5832.zip
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.
Diffstat (limited to 'posix/Makefile')
0 files changed, 0 insertions, 0 deletions