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 933053F23AF for ; Thu, 9 Jul 2026 12:28:14 +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=1783600096; cv=none; b=UF7wkGxQL8V0Zy9vQL6pfcRJjpDYH2y8hCtLRmNTdwMD2IKJZ3JFNxnFGO4X2ERijlkZebXqXiWS0fQ4+l2B/tzzJt0Pbf95vWhZIeywsfR7ukfH9XW1YOUV7x413Fc/tQegKr1ORs9i0oAsNYuPk89xaqg9AiImnZdVl4cOQhs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783600096; c=relaxed/simple; bh=Vp8/eVrCSFx7RBWgpDT77UWJ2+19pOjrlnS9iodg5Kc=; h=From:To:Cc:In-Reply-To:References:Date:Message-ID:MIME-Version: Content-Type:Subject; b=E53wGSmFWP7IyJB7Qj6I+aNEeC1qcSZ1MM/cHrv5EjptaejFxRbswDKh3HIvNqXrToq0y3lHZ8o8fCc12wKIK6LCF0Qbrk9x+GkQlCDQ3U5S0tOYfYzTsqFWyaPL5iuSTEcZDA5PpVScfj5DD/oBECUrSMtZgLR68r+ER80Wp7k= 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=GSASitm6; 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="GSASitm6" 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=Vp8/eVrCSFx7RBWgpDT77UWJ2+19pOjrlnS9iodg5Kc=; b=GSASitm6ruyse5YuhpbQ1k8VNT EMZTfySSuJ96hgMwh5f6yl6WVGC0WEjPRSOeQKE4yL8qyFNrYZnOgQWWAsjBHiWrZClNMf1pL4KDI 3WHa8GRzjsQ1FwQX7R4AVSujR9SWznefJxf/LxRyrzN4Vy7b2FjfLWl0lFq1cg1mC1tY=; Received: from in02.mta.xmission.com ([166.70.13.52]:44152) by out01.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1whnrR-009zvn-EP; Thu, 09 Jul 2026 06:28:13 -0600 Received: from ip72-198-198-28.om.om.cox.net ([72.198.198.28]:36298 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 1whnrQ-00BY0O-Jq; Thu, 09 Jul 2026 06:28:13 -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: (Oleg Nesterov's message of "Tue, 7 Jul 2026 13:13:27 +0200") References: <87o6gx9rc4.fsf@email.froward.int.ebiederm.org> <877bnh7tnf.fsf@email.froward.int.ebiederm.org> <877bnb4uyw.fsf_-_@email.froward.int.ebiederm.org> Date: Thu, 09 Jul 2026 07:28:06 -0500 Message-ID: <871pdcwdnt.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=1whnrQ-00BY0O-Jq;;;mid=<871pdcwdnt.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: U2FsdGVkX18+fDp8IWanZS/POHDRGO8BhlsB1Jf+EDI= X-Spam-Level: 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.4977] * 0.7 XMSubLong Long Subject * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa07 1397; Body=1 Fuz1=1 Fuz2=1] * 0.2 XM_B_SpammyWords One or more commonly used spammy words * 0.8 XM_B_SpammyWords2 Two or more commony used spammy words X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Oleg Nesterov X-Spam-Relay-Country: X-Spam-Timing: total 409 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 11 (2.8%), b_tie_ro: 10 (2.4%), parse: 1.20 (0.3%), extract_message_metadata: 3.9 (0.9%), get_uri_detail_list: 1.77 (0.4%), tests_pri_-2000: 3.1 (0.8%), tests_pri_-1000: 2.6 (0.6%), tests_pri_-950: 1.18 (0.3%), tests_pri_-900: 1.01 (0.2%), tests_pri_-90: 78 (19.1%), check_bayes: 77 (18.8%), b_tokenize: 7 (1.8%), b_tok_get_all: 8 (1.9%), b_comp_prob: 2.3 (0.6%), b_tok_touch_all: 56 (13.7%), b_finish: 0.93 (0.2%), tests_pri_0: 286 (69.8%), check_dkim_signature: 0.52 (0.1%), check_dkim_adsp: 2.4 (0.6%), poll_dns_idle: 0.55 (0.1%), tests_pri_10: 2.9 (0.7%), tests_pri_500: 8 (2.0%), rewrite_mail: 0.00 (0.0%) Subject: Re: [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 Nesterov writes: > Eric, so far I applied the whole series, and I don't see how it can > solve one of the problems I tried to fix in my series. > > Again. A task T has a pending and blocked SIGSYS. si_code = SI_USER. > (although the latter is not strictly necessary) > > force_sig_seccomp(force_coredump => true) sent to T unblocks SIGSYS > and sets SA_IMMUTABLE. > > However, __send_signal_locked() will bypass enqueue_signal() (so it > won't set SIGNAL_GROUP_EXIT) because legacy_queue() is true. This very much causes the synchronous signal not to be treated as synchronous and that is a real problem. I want to say more but don't have time now. Hopefully tomorrow. > T calls get_signal(). Now. it can dequeue another synchronous signal. > If that signal has a handler and its sa_mask includes SIGSYS, the task > can return to userspace and survive. > > No? > > Oh... And SIGKILL still can be lost, and I still think this is not > good. Two things on that score. According to my notes this fixes the much more problematic issue that coredumps of processes using io_uring have problems. With this change io_uring processes act just like everything else so those problems go away. This should allow effectively reverting commit 06af8679449d ("coredump: Limit what can interrupt coredumps"). If we want SIGKILL to be logically processed before coredump signal we can do: kernel/signal.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kernel/signal.c b/kernel/signal.c index bf45ebeb7940..048520dfcef4 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -951,6 +951,16 @@ static bool prepare_signal(int sig, struct task_struct *p, if (signal->flags & SIGNAL_GROUP_EXIT) { if (signal->core_state) return sig == SIGKILL; + else if ((signal->flags & SIGNAL_EXIT_DEQUEUE) && + (sig == SIGKILL) && + sig_kernel_coredump(signal->group_exit_code)) { + /* Let a SIGKILL before a coredump begins preempt + * a coredump signal that is about to happen. + */ + signalfd_notify(p, SIGKILL); + signal->group_exit_code = SIGKILL; + sigaddset(&signal->shared_pending.signal, SIGKILL); + } /* * The process is in the middle of dying, drop the signal. */ -- 2.41.0 Eric