From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out02.mta.xmission.com (out02.mta.xmission.com [166.70.13.232]) (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 0AC7839903A for ; Mon, 29 Jun 2026 06:22:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=166.70.13.232 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782714171; cv=none; b=Iz5SwJf4WeZDqiwHPDiXyXk/P7MQlg/4ugBcGgkpyh8xZwaXAbWCPu6ukk3Vknup+66A5uht9pNm0h+cm62LcBf1js3oetM3T/eUyTxtRVi6unE3YOynj0lmNdEmCCmQ2a/dq+Y75+9X4obJX2CrGoMwYfIE4Y8DukbAIPFg37o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782714171; c=relaxed/simple; bh=SDdBjGjTAqGBgsHqSJV3ZAdjCIeVdtukv+5ZEEa9E/s=; h=From:To:Cc:In-Reply-To:References:Date:Message-ID:MIME-Version: Content-Type:Subject; b=ORMS4xjO7nhIx5rJ65h6Ao70PWCefCkGr1G6EWT6p7J3n4JFClBeQgX2sXfCWD+FRohye2OxHSL0Vj0Gqvy7rsU7BSJ5BG78S09COziERG4EY1JR/2ljLitYAcvQAFi/QfEXkorvBIzte8Ew7YpfcXv5P9dlIZC+nf3G7A8jeV8= 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=TMs9n4Fx; arc=none smtp.client-ip=166.70.13.232 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="TMs9n4Fx" 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=SDdBjGjTAqGBgsHqSJV3ZAdjCIeVdtukv+5ZEEa9E/s=; b=TMs9n4FxGk9KMsaLgoNsAV3jfO Iw2hA8FRU1aZM3l9Mb095/HqdwLjJyXrxR2pC7t9ZE0IHKfY1k8urxO5mKefKnBwC6ou/PVPLDY+h m83IqEdtd7+OrXghuKdPLXfQbCrdHftL/nnutAQ1EFLTdF2xp3ABsnSLR0yfWldT+DZg=; Received: from in01.mta.xmission.com ([166.70.13.51]:34914) by out02.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1we5O9-00CVZG-3M; Mon, 29 Jun 2026 00:22:37 -0600 Received: from ip72-198-198-28.om.om.cox.net ([72.198.198.28]:37324 helo=email.froward.int.ebiederm.org.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1we5O8-003Mxz-3N; Mon, 29 Jun 2026 00:22:36 -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 In-Reply-To: (Oleg Nesterov's message of "Sun, 28 Jun 2026 16:29:02 +0200") References: <87o6gx9rc4.fsf@email.froward.int.ebiederm.org> Date: Mon, 29 Jun 2026 01:22:28 -0500 Message-ID: <877bnh7tnf.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=1we5O8-003Mxz-3N;;;mid=<877bnh7tnf.fsf@email.froward.int.ebiederm.org>;;;hst=in01.mta.xmission.com;;;ip=72.198.198.28;;;frm=ebiederm@xmission.com;;;sPfnum=0;;;sPf=pass X-XM-AID: U2FsdGVkX1/3HFGt0q1LJL2cjZIM7Ow4iExzHtN0nz4= 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.5000] * 0.7 XMSubLong Long Subject * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] * 0.2 XM_B_SpammyWords One or more commonly used spammy words * 0.0 XM_B_AI_SPAM_COMBINATION Email matches multiple AI-related * patterns X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: *;Oleg Nesterov X-Spam-Relay-Country: X-Spam-Timing: total 536 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 11 (2.1%), b_tie_ro: 10 (1.8%), parse: 1.08 (0.2%), extract_message_metadata: 4.1 (0.8%), get_uri_detail_list: 1.96 (0.4%), tests_pri_-2000: 3.3 (0.6%), tests_pri_-1000: 2.7 (0.5%), tests_pri_-950: 1.24 (0.2%), tests_pri_-900: 1.04 (0.2%), tests_pri_-90: 195 (36.4%), check_bayes: 194 (36.1%), b_tokenize: 7 (1.3%), b_tok_get_all: 7 (1.3%), b_comp_prob: 2.5 (0.5%), b_tok_touch_all: 174 (32.4%), b_finish: 0.83 (0.2%), tests_pri_0: 295 (55.0%), check_dkim_signature: 0.52 (0.1%), check_dkim_adsp: 3.0 (0.6%), poll_dns_idle: 1.22 (0.2%), tests_pri_10: 2.9 (0.5%), tests_pri_500: 9 (1.7%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH 0/11] Short circuit delivery for coredump signals X-SA-Exim-Connect-IP: 166.70.13.51 X-SA-Exim-Rcpt-To: 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 out02.mta.xmission.com); SAEximRunCond expanded to false Oleg Nesterov writes: > Eric, > > Please rebase on top of Linus's tree, git am fails at 7/11. This was built on v7.1. Now that v7.2-rc1 is out I will be happy to rebase on top of that. > So far I didnt' try to read the individual patches, I've applied > the whole series on top of 25fe708bbc59 to avoid the conflicts, and > after the very quick glance I seem to see some problems. > > Please correct me. > > ------------------------------------------------------------------------- > complete_signal() does: > > if (sig_fatal(p, sig) && !sigismember(&t->real_blocked, sig) && > (sig == SIGKILL || !p->ptrace)) { > /* > * This signal will be fatal to the whole group. > * > * Start a group exit and wake everybody up. > * This way we don't have other threads > * running and doing things after a slower > * thread has the fatal signal pending. > */ > signal->flags = SIGNAL_GROUP_EXIT | SIGNAL_EXIT_DEQUEUE; > signal->group_exit_code = sig; > ... kill the thread group ... > > However, prepare_signal() still does: > > if (signal->flags & SIGNAL_GROUP_EXIT) { > if (signal->core_state) > return sig == SIGKILL; > /* > * The process is in the middle of dying, drop the signal. > */ > return false; > > This means that if SIGKILL comes before coredump_begin() sets signal->core_state, > it will be lost. I will reexamine that. I used to have something to deal with this case but somehow convinced myself it didn't matter. > ------------------------------------------------------------------------- > dequeue_exit_signal: > > if (signal->flags & SIGNAL_EXIT_DEQUEUE) { > struct sigpending *pending = NULL; > struct sigqueue *timer_sigq; > int signr = exit_code; > > signal->flags &= ~SIGNAL_EXIT_DEQUEUE; > > pending = sigismember(&tsk->pending.signal, signr) ? > &tsk->pending : &signal->shared_pending; > > collect_signal(signr, pending, info, &timer_sigq); > > This looks obviously wrong. 2 threads, T1 and T2. SIGSEGV is sent to T1. > T2 calls get_signal(), clears SIGNAL_EXIT_DEQUEUE and returns SIGSEGV. > But collect_signal() won't find SIGSEGV, *info will be bogus. Ugh. I deliberately allowed the cross thread dumping so that whichever thread won the race could just dump core. I failed to consider it would be a problem for per thread signals. I will have to think a little bit about how to know which queue to remove the signal from. It is tempting to always place fatal signals on the shared_pending queue. Eric