Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp870745rwb; Wed, 26 Jul 2023 04:23:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlEWQ2U4JHbYI/6EXDpU0P5sjQRcyNmEx/ZJWgHzyT17EUV/10XPWMpM9KGiy8K5XIz1zyMG X-Received: by 2002:aa7:ccd0:0:b0:522:79e8:e51b with SMTP id y16-20020aa7ccd0000000b0052279e8e51bmr666543edt.32.1690370637571; Wed, 26 Jul 2023 04:23:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690370637; cv=none; d=google.com; s=arc-20160816; b=Pi5khcU9CJHr8nAcDw4rK6NOcDAppQABq62wJOYdbVOvEsAwjjUrhba4QkrvuB512l oyQI7XA3gNDY/EgbU+AllfWpGHkhxwS1Gd2k+ShDTXCnFWKb2kTvFgVr4ZApDHALZ6dS /KjKaF+XGvR/wKYbwIWB5IfD4pgle9Wm+zJXYfW3Ci/AnGfI/3WjuW7s6Q2cSecye9gs b9NlEul14vlCeWXFpuKwITwHtS2vqYsIBQmUTK9nsEZFf6xGcOjCNjnSH1pVMxNsbZ/Y 5sSvGu6wcNgHFY8vFp9C5iC1DjF0hVRIBxQMvmfG/4go26oEiQ2lb2cfMDgwYd9qNwP0 Q7sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=CD423ngnFhs1Ys1W6GXmpNI8GFlt4nmPDuatVVp+QCE=; fh=luzKk2E01FOSMsP5L3qtoxip1Ni8MsZ/zvZAnkzKwSI=; b=vD9BInHuCwKYLP+k/7zg93xtv2xdjiKLYysMbdZAoPnFow3D3HicDtUNd/3dm2rR5W yu28R5b8F1S/MDnzx7ugppxkV/XrRSjIs7YXrwUpeo93r8R4iNYmsYfkzMIKQA2wO7XR Jb7Gh97V1Yrgqsbj5z/qZROwxL8RNiG8Yu2hPcX9s2Ya41Ha7r0NjCjNETixhFLAXUwe no6sikuGcE7BCxgYt6l6mYosjlAHqIBW2mxTY1dlm5dFGxedQwcgrbHwuq3YML54A18l onEcjZZm8sH6fL5eb3aYlJc4Xl4kUWQFnpI8ikgs+C60UlT52Ki/HS46m7THqBhFu/J6 yC+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="IvXoQ/Y+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d22-20020a056402079600b0052241ef59b6si3048128edy.317.2023.07.26.04.23.32; Wed, 26 Jul 2023 04:23:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="IvXoQ/Y+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230094AbjGZJaX (ORCPT + 99 others); Wed, 26 Jul 2023 05:30:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232540AbjGZJ3w (ORCPT ); Wed, 26 Jul 2023 05:29:52 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3F751BC8 for ; Wed, 26 Jul 2023 02:27:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690363657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CD423ngnFhs1Ys1W6GXmpNI8GFlt4nmPDuatVVp+QCE=; b=IvXoQ/Y+iEy+oVZyg1VyMkZtrzT7arr4VtZFqN1YgBgpbZ68nSSRZaYkTk1wDIM5G2S7tt 7Lz/iaATyUOjB/hpYdf3FvpkMiWi8qSe5EQCdCQHBY03ebeRob66Mbf13oJa7FRsGlMLVm TRDTqfjsP0OWtiHUJ3+Q7mNcyzHGvBc= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-306-Zum8lK-hNsOVSkF38OwIvg-1; Wed, 26 Jul 2023 05:27:35 -0400 X-MC-Unique: Zum8lK-hNsOVSkF38OwIvg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 08F811C09043; Wed, 26 Jul 2023 09:27:35 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.226.116]) by smtp.corp.redhat.com (Postfix) with SMTP id 126852166B26; Wed, 26 Jul 2023 09:27:32 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 26 Jul 2023 11:26:56 +0200 (CEST) Date: Wed, 26 Jul 2023 11:26:53 +0200 From: Oleg Nesterov To: Linus Torvalds Cc: Fiona Ebner , "Eric W. Biederman" , akpm@linux-foundation.org, Thomas Lamprecht , Wolfgang Bumiller , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: segfaults of processes while being killed after commit "mm: make the page fault mmap locking killable" Message-ID: <20230726092652.GA7943@redhat.com> References: <8d063a26-43f5-0bb7-3203-c6a04dc159f8@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/25, Linus Torvalds wrote: > > What exactly made you notice? Is it just the logging from > 'show_unhandled_signals' being set? > > Because the actual signal itself, from the > > force_sig_fault(SIGSEGV, si_code, (void __user *)address); > > in __bad_area_nosemaphore() should be overridden by the fact that a > lethal signal was already pending. Yes, SIGSEGV won't be even delivered, prepare_signal() returns F if SIGNAL_GROUP_EXIT is set. > But let's add a couple of signal people rather than the mm people to > the participants. Eric, Oleg - would not an existing fatal signal take > precedence over a new SIGSEGV? I obviously thought it did, but looking > at 'get_signal()' and the signal delivery, I don't actually see any > code to that effect. See /* Has this task already been marked for death? */ if ((signal->flags & SIGNAL_GROUP_EXIT) || signal->group_exec_task) { clear_siginfo(&ksig->info); ksig->info.si_signo = signr = SIGKILL; sigdelset(¤t->pending.signal, SIGKILL); trace_signal_deliver(SIGKILL, SEND_SIG_NOINFO, &sighand->action[SIGKILL - 1]); recalc_sigpending(); goto fatal; } in get_signal(). So yes, get_signal() returns SIGKILL if fatal_signal_pending() == T which implies SIGNAL_GROUP_EXIT. I think your patch is fine. Oleg.