grub2/grub-core
Dimitri John Ledkov 82fbd3f55c osdep/unix/exec: Avoid atexit() handlers when child execvp() fails
The functions grub_util_exec_pipe() and grub_util_exec_pipe_stderr()
currently call execvp(). If the call fails for any reason, the child
currently calls exit(127). This in turn executes the parents
atexit() handlers from the forked child, and then the same handlers
are called again from parent. This is usually not desired, and can
lead to deadlocks, and undesired behavior. So, change the exit() calls
to _exit() calls to avoid calling atexit() handlers from child.

Fixes: e75cf4a58 (unix exec: avoid atexit handlers when child exits)

Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Bug-Debian: https://bugs.debian.org/983435
Last-Update: 2021-06-14

Patch-Name: osdep-exec-avoid-atexit-when-child-exits.patch
2021-06-14 00:34:57 +01:00
..
boot Add configure option to reduce visual clutter at boot time 2020-03-07 12:21:23 +00:00
bus calloc: Use calloc() at most places 2020-07-24 22:42:16 +01:00
commands malloc: Use overflow checking primitives where we do complex allocations 2020-07-24 22:42:22 +01:00
disk lvm: fix two more potential data-dependent alloc overflows 2020-07-24 22:44:04 +01:00
efiemu calloc: Use calloc() at most places 2020-07-24 22:42:16 +01:00
font font: Do not load more than one NAME section 2020-07-24 22:42:33 +01:00
fs hfsplus: fix two more overflows 2020-07-24 22:43:59 +01:00
gdb i386, x86_64, ppc: fix switch fallthrough cases with GCC7 2017-04-04 19:23:55 +03:00
gettext Silence error messages when translations are unavailable 2019-07-09 11:42:33 +01:00
gfxmenu gfxmenu: Fix double free in load_image() 2020-07-24 22:42:38 +01:00
hello * grub-core/commands/gptsync.c: Fix typographic quoting. 2012-03-03 13:05:08 +01:00
hook * grub-core/hook/datehook.c (grub_read_hook_datetime): Small stylistic 2011-11-11 21:03:49 +01:00
io calloc: Use calloc() at most places 2020-07-24 22:42:16 +01:00
kern efi: Fix use-after-free in halt/reboot path 2020-07-24 22:45:03 +01:00
lib efi: Fix use-after-free in halt/reboot path 2020-07-24 22:45:03 +01:00
loader linux: Fix integer overflows in initrd size handling 2020-07-26 23:38:07 +01:00
mmap calloc: Use calloc() at most places 2020-07-24 22:42:16 +01:00
net bootp: Improve allocation handling in parse_dhcp6_option 2020-07-26 23:38:34 +01:00
normal malloc: Use overflow checking primitives where we do complex allocations 2020-07-24 22:42:22 +01:00
osdep osdep/unix/exec: Avoid atexit() handlers when child execvp() fails 2021-06-14 00:34:57 +01:00
partmap calloc: Use calloc() at most places 2020-07-24 22:42:16 +01:00
parttool * grub-core/net/http.c: Add TRANSLATORS comments. 2012-03-05 16:42:26 +01:00
script script: Avoid a use-after-free when redefining a function during execution 2020-07-24 22:43:45 +01:00
term term: Fix overflow on user inputs 2020-07-24 22:42:56 +01:00
tests calloc: Use calloc() at most places 2020-07-24 22:42:16 +01:00
video malloc: Use overflow checking primitives where we do complex allocations 2020-07-24 22:42:22 +01:00
gdb_grub.in * grub-core/gdb_grub.in: Fix overflow and wrong field. 2013-10-14 03:40:20 +02:00
genemuinit.sh use MODULE_FILES for genemuinit* instead of MOD_FILES 2014-01-18 23:15:40 +04:00
genemuinitheader.sh use MODULE_FILES for genemuinit* instead of MOD_FILES 2014-01-18 23:15:40 +04:00
genmod.sh.in .mod files: Strip annobin annotations and .eh_frame, and their relocations 2018-03-05 14:08:22 +01:00
genmoddep.awk enforcing fixup 2017-08-14 16:27:10 +02:00
gensyminfo.sh.in Fix shebang for termux. 2017-05-03 12:49:31 +02:00
gensymlist.sh Make 'make check' work on emu. 2013-04-27 02:00:16 +02:00
gentrigtables.c * grub-core/gentrigtables.c: Make tables const. 2013-03-01 11:15:09 +01:00
gmodule.pl.in * grub-core/gmodule.pl.in: Accept newer binutils which output 2014-09-21 18:23:23 +02:00
Makefile.am RISC-V: Add to build system 2019-02-25 14:02:05 +01:00
Makefile.core.am Import grub2_2.04~rc1.orig.tar.xz 2019-05-14 10:20:03 +01:00
Makefile.core.def Add configure option to enable gfxpayload=keep dynamically 2020-03-07 12:21:23 +00:00
Makefile.gcry.def Import grub2_2.02~beta3.orig.tar.xz 2016-09-18 17:40:00 +01:00
Makefile.in Import grub2_2.04~rc1.orig.tar.xz 2019-05-14 10:20:03 +01:00
modinfo.sh.in Fix shebang for termux. 2017-05-03 12:49:31 +02:00
unidata.c Import grub2_2.02~beta3.orig.tar.xz 2016-09-18 17:40:00 +01:00