[lkml]   [2018]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH RESEND] exec: don't force_sigsegv processes with a pending fatal signal
We were seeing unexplained segfaults in coreutils processes and other
basic utilities that we tracked down to binfmt_elf failing to load
segments for Digging further, the actual problem seems to occur
when a process gets sigkilled while it is still being loaded by the
kernel. In our case when _do_page_fault goes for a retry it will return
early as it first checks for fatal_signal_pending(), so load_elf_interp
also returns with error and as a result search_binary_handler will
force_sigsegv() which is pretty confusing as nothing actually failed

Fixes: 19d860a140be ("handle suicide on late failure exits in execve() in search_binary_handler()")
Signed-off-by: Ivan Delalande <>
fs/exec.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/exec.c b/fs/exec.c
index bdd0eacefdf5..6e8007edbb2d 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1656,7 +1656,8 @@ int search_binary_handler(struct linux_binprm *bprm)
if (retval < 0 && !bprm->mm) {
/* we got to flush_old_exec() and failed after it */
- force_sigsegv(SIGSEGV, current);
+ if (!fatal_signal_pending(current))
+ force_sigsegv(SIGSEGV, current);
return retval;
if (retval != -ENOEXEC || !bprm->file) {
 \ /
  Last update: 2018-07-31 02:57    [W:0.058 / U:7.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site