From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out01.mta.xmission.com (out01.mta.xmission.com [166.70.13.231]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5608B1A6835 for ; Fri, 3 Jul 2026 21:36:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=166.70.13.231 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783114561; cv=none; b=b2OD7ELuT6Db0cOtqNhzDbADPkPM7v1i9CXdlFBFN+7FE+4cTa+3YKeqNdqC/kAQC2EZyKy2tgmkLYbFAD/627pBnMbykBS+xtUc3Z20OZshu0CiNMd/2siygVA2ykXniMvAqJUk/+OGldpit8TO1k1gKNkTeZEUeibhyWOUv6k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783114561; c=relaxed/simple; bh=N6mgDqzQqpeu+oRsTDys/ErPy54hWeHcu6l5ZN021ZU=; h=From:To:Cc:In-Reply-To:References:Date:Message-ID:MIME-Version: Content-Type:Subject; b=RY85GNzFFQrbGgGHmQetUDGAmNP0g2n2BIwpitZv3h6Un30tfNH4bNGyY9Dk9KG8+/Zh0Gcg392Zo25HOfWoKqgVB7h2qEnNXC36qNeb+VFppya5CcfLbyvkGKL4qZmjmDRHu5kzbGadqf89HI4RI6V2sASybRGe28xYBo707V0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=xmission.com; spf=pass smtp.mailfrom=xmission.com; dkim=pass (1024-bit key) header.d=xmission.com header.i=@xmission.com header.b=cIdQwVHK; arc=none smtp.client-ip=166.70.13.231 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=xmission.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xmission.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=xmission.com header.i=@xmission.com header.b="cIdQwVHK" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=simple/simple; d=xmission.com; s=xmission; h=Subject:Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=N6mgDqzQqpeu+oRsTDys/ErPy54hWeHcu6l5ZN021ZU=; b=cIdQwVHKycTh80hiCzOK1xm+u1 z9rZll9lg3W7gtDT9aVPIxFkPJkRhP5I1Qwz+FxKgvn6tILFFb8wIrFtW2sutHv+6I/5bH/4d5+Pe z1hbbpGuvSTG7aXcF32VvtQ4BJ/UOamnq/elwOn4F1NcBatty2GkZHzTXkeFWtEKqa4M=; Received: from in02.mta.xmission.com ([166.70.13.52]:53858) by out01.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1wflYF-00HE65-DE; Fri, 03 Jul 2026 15:35:59 -0600 Received: from ip72-198-198-28.om.om.cox.net ([72.198.198.28]:57556 helo=email.froward.int.ebiederm.org.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1wflYE-000eeD-HG; Fri, 03 Jul 2026 15:35:59 -0600 From: "Eric W. Biederman" To: Oleg Nesterov Cc: Andrew Morton , Andy Lutomirski , Kees Cook , Kusaram Devineni , Peter Zijlstra , Thomas Gleixner , Will Drewry , linux-kernel@vger.kernel.org, Linus Torvalds , Christian Brauner In-Reply-To: <877bnh7tnf.fsf@email.froward.int.ebiederm.org> (Eric W. Biederman's message of "Mon, 29 Jun 2026 01:22:28 -0500") References: <87o6gx9rc4.fsf@email.froward.int.ebiederm.org> <877bnh7tnf.fsf@email.froward.int.ebiederm.org> Date: Fri, 03 Jul 2026 16:35:51 -0500 Message-ID: <877bnb4uyw.fsf_-_@email.froward.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1wflYE-000eeD-HG;;;mid=<877bnb4uyw.fsf_-_@email.froward.int.ebiederm.org>;;;hst=in02.mta.xmission.com;;;ip=72.198.198.28;;;frm=ebiederm@xmission.com;;;sPfnum=0;;;sPf=pass X-XM-AID: U2FsdGVkX1/sY0cb++XFzruJtc3ooBdDigvAIncHmRc= X-Spam-Level: X-Spam-Virus: No X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.1 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4960] * 0.7 XMSubLong Long Subject * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa03 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa03 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Oleg Nesterov X-Spam-Relay-Country: X-Spam-Timing: total 450 ms - load_scoreonly_sql: 0.03 (0.0%), signal_user_changed: 4.3 (0.9%), b_tie_ro: 2.9 (0.6%), parse: 1.14 (0.3%), extract_message_metadata: 4.7 (1.0%), get_uri_detail_list: 2.2 (0.5%), tests_pri_-2000: 2.4 (0.5%), tests_pri_-1000: 2.2 (0.5%), tests_pri_-950: 1.04 (0.2%), tests_pri_-900: 0.85 (0.2%), tests_pri_-90: 71 (15.8%), check_bayes: 70 (15.5%), b_tokenize: 6 (1.3%), b_tok_get_all: 8 (1.7%), b_comp_prob: 1.97 (0.4%), b_tok_touch_all: 51 (11.4%), b_finish: 0.67 (0.2%), tests_pri_0: 344 (76.5%), check_dkim_signature: 0.41 (0.1%), check_dkim_adsp: 3.0 (0.7%), poll_dns_idle: 1.75 (0.4%), tests_pri_10: 2.9 (0.6%), tests_pri_500: 7 (1.7%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH v2 00/14] Short circuit delivery for coredump signals X-SA-Exim-Connect-IP: 166.70.13.52 X-SA-Exim-Rcpt-To: brauner@kernel.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, wad@chromium.org, tglx@kernel.org, peterz@infradead.org, kusaram@devineni.in, kees@kernel.org, luto@kernel.org, akpm@linux-foundation.org, oleg@redhat.com X-SA-Exim-Mail-From: ebiederm@xmission.com X-SA-Exim-Scanned: No (on out01.mta.xmission.com); SAEximRunCond expanded to false Oleg's recent patchset tweaking how force_sig_info works has inspired me to finally push through and update the signal handling to have proper short circuit deliver for coredump signals. Everything is just simpler when coredumps are not such a large special case. What makes this tricky is coredumps have had their own process shoot-down logic similar to but separate and different from everything else in the kernel. The bulk of this set of changes is merging the process shoot-down logic that is used for signals and the logic for coredumps. So the same process shoot-down logic can be shared. With the shoot-down logic sorted the rest is quite straight forward. Oleg when reviewing the first version of this set of changes noticed that dequeue_exit_signal did not properly handle thread local signal that trigger a coredump. To resolve this I have added a few more cleanups so that I can detect a fatal signal as it is being enqueued and place it in the shared signal queue. One of those cleanups is a rewrite of detecting if a signal can be delivered immediately when sent aka short circuit delivery. The processing of signals that will be ignored and signals that will cause a process to exit without returning to userspace (such as SIGKILL) are both enhanced. This set of changes is against v7.2-rc1 fs/coredump.c | 161 +++++++++++++++++---------------- include/linux/coredump.h | 4 + include/linux/sched/signal.h | 2 + include/linux/sched/task.h | 1 - include/linux/signal_types.h | 3 - include/uapi/asm-generic/signal-defs.h | 1 - kernel/exit.c | 41 ++------- kernel/signal.c | 119 +++++++++++++++--------- mm/oom_kill.c | 2 +- 9 files changed, 171 insertions(+), 163 deletions(-) Eric W. Biederman (14): signal: Generalize posixtimer_queue_sigqueue into enqueue_signal signal: Factor out sig_blocked from sig_ignored signal: More accurate ignoring of signals based on sig_can_short_circuit signal: Use sig_can_short_circuit to improve fatal signal delivery signal: Compute the exit_code in get_signal signal: In get_signal call do_exit when it is unnecessary to shoot down threads signal: Bring down all threads when handling a non-coredump fatal signal signal: Move stopping for the coredump from do_exit into get_signal signal: Move audit_core_dumps from do_coredump into get_signal coredump: In zap_threads complete startup if there is no need to wait signal: Use the thread killing in get_signal for coredumps exit: Make do_group_exit static signal: Dequeue fatal signals signal: Short circuit deliver coredump signals fs/coredump.c | 153 ++++++++++++++------------- include/linux/coredump.h | 4 + include/linux/sched/signal.h | 2 + include/linux/sched/task.h | 1 - kernel/exit.c | 41 ++------ kernel/signal.c | 246 +++++++++++++++++++++++++++++-------------- mm/oom_kill.c | 2 +- 7 files changed, 260 insertions(+), 189 deletions(-)