Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp295373pxb; Sat, 21 Aug 2021 02:54:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0xoTRs426UeOfxdOd1sW7te1bngDy/aZoo9Uai6I2+fwKOztUoKothHqdJDjfqgfcmfHs X-Received: by 2002:a92:d3c1:: with SMTP id c1mr16775611ilh.194.1629539692435; Sat, 21 Aug 2021 02:54:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629539692; cv=none; d=google.com; s=arc-20160816; b=OvK2z1yPE8od5WGoPRvxGiES1gmwOVmHoEfweAH9MAOiJ9zCwj44py/nGUCsqbbg63 H9+4zj7oQvcgr6G3I1bWkucn6nz5uzEBO26ztCJxnzhKl2R1EFdUyJfNONh6YHOMaS/R 0jzIH154JjbhAUhDj5LExJh7xHSBfax0HOb7sMEa4PoOast9k65id7p7kCAGnNibjAxQ yMvTBPYDHdfSfuhqb2O1QJAe0sCy9/F+euKakPrxiYT0EM4ppOT1Tlms21HBmKjlEkjH QHsFw6YEyuz04yXlQZxZBFK7w7zwpMf4YMKKieb+0uxksLIO5mMNb4qn/juUtTz+zwEI H2Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=Y57GtzrZWeeTPJ78+9nrSwsndvqJZvRgIIBIs0jNakM=; b=FEouDu30JVQvl2or0N99oHp33nn2QItZ3L/ciSWsrFAIsdDox541ON7SdPhWtMKcpU F8fccnL1CIb0YEvC8zQDw8HZ3FW0/RHbY91RqyKXgBUd/MNF8RCJ7esVHxsf7ViCkovV 8KjB+ypDQEOUUMzxurhtpwSzmsCbeZTvDPp64hzydn+uEWHkFo0cdWRns5tck6XtBZhx ydG6Ehk3tofxu1txJ5dofXcy1TC8C3JqwKXx1zFMSFJ8lUlt46eFxM3NmAO+HYhol3Eh ttEMERLGEcB+tB+4IAR/ot0Fc7vt2+IgMKN72LQ3H6FwUgg5SKW8AAVJcr74D9zy1APg bKkg== ARC-Authentication-Results: i=1; mx.google.com; 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 y12si11176966ilu.84.2021.08.21.02.54.39; Sat, 21 Aug 2021 02:54:52 -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; 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 S233907AbhHUJxd (ORCPT + 99 others); Sat, 21 Aug 2021 05:53:33 -0400 Received: from cloud48395.mywhc.ca ([173.209.37.211]:58828 "EHLO cloud48395.mywhc.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233548AbhHUJxc (ORCPT ); Sat, 21 Aug 2021 05:53:32 -0400 Received: from modemcable064.203-130-66.mc.videotron.ca ([66.130.203.64]:43168 helo=[192.168.1.179]) by cloud48395.mywhc.ca with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mHNgJ-00016f-Of; Sat, 21 Aug 2021 05:52:51 -0400 Message-ID: <57f28a37c6bffacdadd4d98a7c6abc258dd752d4.camel@trillion01.com> Subject: Re: [PATCH] coredump: Limit what can interrupt coredumps From: Olivier Langlois To: Jens Axboe , Tony Battersby , "Eric W. Biederman" , Oleg Nesterov Cc: Linus Torvalds , Linux Kernel Mailing List , linux-fsdevel , io-uring , Alexander Viro , "Pavel Begunkov>" Date: Sat, 21 Aug 2021 05:52:50 -0400 In-Reply-To: <24c795c6-4ec4-518e-bf9b-860207eee8c7@kernel.dk> References: <198e912402486f66214146d4eabad8cb3f010a8e.camel@trillion01.com> <87eeda7nqe.fsf@disp2133> <87pmwt6biw.fsf@disp2133> <87czst5yxh.fsf_-_@disp2133> <87y2bh4jg5.fsf@disp2133> <87sg1p4h0g.fsf_-_@disp2133> <20210614141032.GA13677@redhat.com> <87pmwmn5m0.fsf@disp2133> <4d93d0600e4a9590a48d320c5a7dd4c54d66f095.camel@trillion01.com> <8af373ec-9609-35a4-f185-f9bdc63d39b7@cybernetics.com> <9d194813-ecb1-2fe4-70aa-75faf4e144ad@kernel.dk> <0bc38b13-5a7e-8620-6dce-18731f15467e@kernel.dk> <24c795c6-4ec4-518e-bf9b-860207eee8c7@kernel.dk> Organization: Trillion01 Inc Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cloud48395.mywhc.ca X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - trillion01.com X-Get-Message-Sender-Via: cloud48395.mywhc.ca: authenticated_id: olivier@trillion01.com X-Authenticated-Sender: cloud48395.mywhc.ca: olivier@trillion01.com X-Source: X-Source-Args: X-Source-Dir: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2021-08-17 at 12:24 -0600, Jens Axboe wrote: > > And assuming that works, then I suspect this one would fix your issue > even with a piped core dump: > > diff --git a/fs/coredump.c b/fs/coredump.c > index 07afb5ddb1c4..852737a9ccbf 100644 > --- a/fs/coredump.c > +++ b/fs/coredump.c > @@ -41,6 +41,7 @@ > ?#include > ?#include > ?#include > +#include > ? > ?#include > ?#include > @@ -603,6 +604,7 @@ void do_coredump(const kernel_siginfo_t *siginfo) > ????????}; > ? > ????????audit_core_dumps(siginfo->si_signo); > +???????io_uring_task_cancel(); > ? > ????????binfmt = mm->binfmt; > ????????if (!binfmt || !binfmt->core_dump) > That is what my patch is doing. Function call is inserted at a different place... I am not sure if one location is better than the other or if it matters at all but there is an extra change required to make it work... diff --git a/fs/coredump.c b/fs/coredump.c index 07afb5ddb1c4..614fe7a54c1a 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -625,6 +626,8 @@ void do_coredump(const kernel_siginfo_t *siginfo) need_suid_safe = true; } + io_uring_task_cancel(); + retval = coredump_wait(siginfo->si_signo, &core_state); if (retval < 0) goto fail_creds;