Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5278790pxj; Wed, 9 Jun 2021 13:35:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxe47/y5vkhi+kD9v2hue3wMTRIuq9aoLjkU1pHMzEewYKJH+++DznyCSJx+5L5cu/lkgbL X-Received: by 2002:a17:906:bcd5:: with SMTP id lw21mr1475450ejb.346.1623270956538; Wed, 09 Jun 2021 13:35:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623270956; cv=none; d=google.com; s=arc-20160816; b=hyiVmzFvfg3jfwma7Zk3xDDXghbcJrImLDwcRX2aSN4nXNFLPMOV5Hhw9yzuFGn6jz nxovlW1CDRtm6/JXWtpqdVjNAbcAR45qmH38+54uy07Q7oSRugt9PIStnNr+NLYvZ0nf qdqZjZK6psHQFt/HUgePn4M8VrZidAkS5ktNyEIba1g5W8DMACpKRIEa0wm0I2WzSKIF a4Y5Y8d6HAwg4soX46dSKxu4yd3zygXyGacYR42i/vJMyhu58+z3OO8cxqiQQkS+akMb BfNxhi/5E0+rQOXLhn2E375KuVe3K1Fw6LQIpFgHh0d9ok99uqbHmRH8gffwQa5Xw55f iIzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HKOE8BadJeo+YL8tRU0iYJhaHWhLziwYQepJorZ98hY=; b=drIWLPJnMrym0IbSKLxKlxp5c5NsFCr0NkR9p7Gu8/ps36oT102RHgE4onu16T9udv ATHUn0rl3k/QYJS9o1QNwnc9AP3RhOaH7PpqVUdNBqv9+n5nTAOVNjKVSd13ExCz/SvQ idOfHJvkAH/e5UNLs+YFhpWQnwYRcwjnak77LJqOrbIYXOTwtRKKk63HDPFNtr12uktw Ux5qVPUwzdg/eIlO/r9ikutbkg9dTAtcF+u0+bQuA46s5x44WDnCgb88Q8UaKSRB6xQs fFkbpj/djSlpKLP2sRl3np6CT49MhMtAyvDug5s+lloURXmemZzt6yBlyEkjxCsDBHBD k4xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=UBP8J6oY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l18si524213edc.264.2021.06.09.13.35.33; Wed, 09 Jun 2021 13:35:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=UBP8J6oY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229676AbhFIUgI (ORCPT + 99 others); Wed, 9 Jun 2021 16:36:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbhFIUgF (ORCPT ); Wed, 9 Jun 2021 16:36:05 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7B9FC061574 for ; Wed, 9 Jun 2021 13:33:56 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id r14so1518512ljd.10 for ; Wed, 09 Jun 2021 13:33:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HKOE8BadJeo+YL8tRU0iYJhaHWhLziwYQepJorZ98hY=; b=UBP8J6oYchq2ROBkKb/OBl2yhXz9+41fIVP2jys4OwQsSgcG7GA3wC9CyITc1BANel 6pUPf1o7H/jAprU3hJI9Orap/rRnTmgpIpJfaXDu+lmLVs+eno55vuWfJKvk061XOrqM lIKlhsHcRIejWytT4LUfn+BysOlyh7R4deQ6Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HKOE8BadJeo+YL8tRU0iYJhaHWhLziwYQepJorZ98hY=; b=GR4ucuq0nvf/uOBsCOCIWGuCQy68DXnoKY2uP/JjNsWVRP56qUFxNLLXhirmWM5Pxz xkn7zRxT1JolYpyJYtUjYdKmL19I8lpe3uK/vV0Xgnp44vs1ZU5dlUSwr5HDhZ9/pBAf /ue4ZzlCdkLHiyjDx89Rha+OYfZSuaxSKF57jUXU+Sjigx8K+x14+iNF+/IWTtjP3hHW bJsb/B8lZJ+i2Aj/7VZeHWW0iTzh9elDznm75l9/2VhiO2RQKun3JvYRRHqrVxEmaXsh WfXERs036rNdy8xsmMM4/tbmTFd2VmRhjkRWcBODUM9S4Zc/s5J7csfVywwbXAFKUSj0 B+JA== X-Gm-Message-State: AOAM532VoqLtPpTjc0z9wBa4gq22qdCvv6m+oUU7/F0RHfLDwj9Kllcp RVpGW0aI7+Jswo1MWypRIy+gGKAlJgnYjmgokgI= X-Received: by 2002:a2e:9544:: with SMTP id t4mr1221957ljh.474.1623270835118; Wed, 09 Jun 2021 13:33:55 -0700 (PDT) Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com. [209.85.208.175]) by smtp.gmail.com with ESMTPSA id i124sm86389lfd.62.2021.06.09.13.33.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Jun 2021 13:33:53 -0700 (PDT) Received: by mail-lj1-f175.google.com with SMTP id n17so1570708ljg.2 for ; Wed, 09 Jun 2021 13:33:52 -0700 (PDT) X-Received: by 2002:a2e:9644:: with SMTP id z4mr1178053ljh.507.1623270832349; Wed, 09 Jun 2021 13:33:52 -0700 (PDT) MIME-Version: 1.0 References: <192c9697e379bf084636a8213108be6c3b948d0b.camel@trillion01.com> <9692dbb420eef43a9775f425cb8f6f33c9ba2db9.camel@trillion01.com> <87h7i694ij.fsf_-_@disp2133> In-Reply-To: <87h7i694ij.fsf_-_@disp2133> From: Linus Torvalds Date: Wed, 9 Jun 2021 13:33:36 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC] coredump: Do not interrupt dump for TIF_NOTIFY_SIGNAL To: "Eric W. Biederman" Cc: Linux Kernel Mailing List , linux-fsdevel , io-uring , Alexander Viro , Olivier Langlois , Jens Axboe , "Pavel Begunkov>" , Oleg Nesterov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 9, 2021 at 1:17 PM Eric W. Biederman wrote: >> > In short the coredump code deliberately supports being interrupted by > SIGKILL, and depends upon prepare_signal to filter out all other > signals. Hmm. I have to say, that looks like the core reason for the bug: if you want to be interrupted by a fatal signal, you shouldn't use signal_pending(), you should use fatal_signal_pending(). Now, the fact that we haven't cleared TIF_NOTIFY_SIGNAL for the first signal is clearly the immediate cause of this, but at the same time I really get the feeling that that coredump aborting code should always had used fatal_signal_pending(). We do want to be able to abort core-dumps (stuck network filesystems is the traditional reason), but the fact that it used signal_pending() looks buggy. In fact, the very comment in that dump_interrupted() function seems to acknowledge that signal_pending() is all kinds of silly. So regardless of the fact that io_uring does seem to have messed up this part of signals, I think the fix is not to change signal_pending() to task_sigpending(), but to just do what the comment suggests we should do. But also: > With the io_uring code comes an extra test in signal_pending > for TIF_NOTIFY_SIGNAL (which is something about asking a task to run > task_work_run). Jens, is this still relevant? Maybe we can revert that whole series now, and make the confusing difference between signal_pending() and task_sigpending() go away again? Linus