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 F269D2EDD6C for ; Mon, 29 Jun 2026 17:45:23 +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=1782755125; cv=none; b=DGeTFM8fGvtkSkge8VF1Xomw7zKvAbuTz2AKvBX/KPrK/bTV1rRdPmnJrOKMrAGyGAEN5Mks5El8VmPHXWsNMK2d08jyArp1AXlou48YqaBCaHHPpGn4oOSZLBwixx01jP/AApjqw3tEIGoqQIeQsoKprrhgKzYSC/LJnXfsR2Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782755125; c=relaxed/simple; bh=tReSFwce+0UQ0jveA1kuzMoRKCnASmmoyAiwyH25vGY=; h=From:To:Cc:In-Reply-To:References:Date:Message-ID:MIME-Version: Content-Type:Subject; b=P6j2ExccwlsFUNl2LpbjB1o93KVrJS3V6DJ8zTLSviv2St941SyQTnW51gJfxKc88mLHIwWfTzPV9SfJyR79GJLEi5jXnuyTFw2c7zL7/Fbz4gS8bd1LLJ2st1Th5II5Z1eOyx77JWsWeir4SPQX93coCUqPVuZHNsDDl+vfmHQ= 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=hCA8uey2; 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="hCA8uey2" 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=tReSFwce+0UQ0jveA1kuzMoRKCnASmmoyAiwyH25vGY=; b=hCA8uey2rqyxEj0d5XsNFidJ68 F4QYY1ILFfrjzoLzY00vZcI1nN2ipL75RVaaG79S/NFHe9oUMCpuQbujestcD/2rsVgi9HQujWZii Z8tkEh26z6rsK+1OZXXvZz74766J7Pro2RCjhMBGJQCXloPoOEGOajujmz3GXXQcBlxE=; Received: from in02.mta.xmission.com ([166.70.13.52]:36892) by out02.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1weG2s-00DNlP-8Z; Mon, 29 Jun 2026 11:45:22 -0600 Received: from ip72-198-198-28.om.om.cox.net ([72.198.198.28]:40418 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 1weG2r-009GnR-AL; Mon, 29 Jun 2026 11:45:21 -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: <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: Mon, 29 Jun 2026 12:45:15 -0500 Message-ID: <875x315jh0.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=1weG2r-009GnR-AL;;;mid=<875x315jh0.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: U2FsdGVkX195lIEKesyI02Dl6HRypxw1ZJIxa9oCidE= 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.5002] * 1.5 XMNoVowels Alpha-numberic number with no vowels * 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 * [sa05 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 XM_B_AI_SPAM_COMBINATION Email matches multiple AI-related * patterns X-Spam-DCC: XMission; sa05 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: *;Oleg Nesterov X-Spam-Relay-Country: X-Spam-Timing: total 503 ms - load_scoreonly_sql: 0.40 (0.1%), signal_user_changed: 14 (2.9%), b_tie_ro: 12 (2.3%), parse: 1.73 (0.3%), extract_message_metadata: 24 (4.7%), get_uri_detail_list: 3.9 (0.8%), tests_pri_-2000: 19 (3.8%), tests_pri_-1000: 3.7 (0.7%), tests_pri_-950: 1.70 (0.3%), tests_pri_-900: 1.38 (0.3%), tests_pri_-90: 66 (13.1%), check_bayes: 64 (12.6%), b_tokenize: 10 (2.0%), b_tok_get_all: 9 (1.8%), b_comp_prob: 3.2 (0.6%), b_tok_touch_all: 38 (7.5%), b_finish: 0.95 (0.2%), tests_pri_0: 357 (70.9%), check_dkim_signature: 0.86 (0.2%), check_dkim_adsp: 3.6 (0.7%), poll_dns_idle: 0.92 (0.2%), tests_pri_10: 2.1 (0.4%), tests_pri_500: 8 (1.6%), 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.52 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 "Eric W. Biederman" writes: > 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. I was thinking of another related problem. In this case loosing SIGKILL before coredump_begin seems fine. The process is already dying of a signal. The only point of supporting SIGKILL at all during a coredump is because writing the coredump out can be slow. So SIGKILL in that case just aborts the coredump. If the coredump hasn't started an abort seems pointless. I can think of ways to tweak the logic but I can't imagine anything reliably working until the code reaches coredump_begin, and TIF_SIGPENDING is cleared. Do you know of something where userspace actually depends upon killing a coredump before it even starts? If not I don't imagine it is worth spending any time on this corner case. ... There is another corner case I just noticed. When force_sig_info_to_task is passed HANDLER_EXIT today get_signal skips ptrace stops when SA_IMMUTABLE is set. My change did not short circuit deliver those signals when the process was ptraced so my last change removing SA_IMMUTABLE was premature. Eric