From: Oleg Nesterov Date: Tue, 30 Apr 2013 22:28:13 +0000 (-0700) Subject: coredump: sanitize the setting of signal->group_exit_code X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~88^2~41 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=acdedd99b0f3bff9b4bb2103a6b1268c03d1f963;p=pandora-kernel.git coredump: sanitize the setting of signal->group_exit_code Now that the coredumping process can be SIGKILL'ed, the setting of ->group_exit_code in do_coredump() can race with complete_signal() and SIGKILL or 0x80 can be "lost", or wait(status) can report status == SIGKILL | 0x80. But the main problem is that it is not clear to me what should we do if binfmt->core_dump() succeeds but SIGKILL was sent, that is why this patch comes as a separate change. This patch adds 0x80 if ->core_dump() succeeds and the process was not killed. But perhaps we can (should?) re-set ->group_exit_code changed by SIGKILL back to "siginfo->si_signo |= 0x80" in case when core_dumped == T. Signed-off-by: Oleg Nesterov Tested-by: Mandeep Singh Baines Cc: Ingo Molnar Cc: Neil Horman Cc: "Rafael J. Wysocki" Cc: Roland McGrath Cc: Tejun Heo Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed