Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5296657pxj; Wed, 9 Jun 2021 14:04:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyo/fV5PZfBQZPiLplIC6aB4tPAJbTLqRwjYFRVl+UmB3FttqkJI2CXnUCYTKA4KbNDO8IM X-Received: by 2002:aa7:d14d:: with SMTP id r13mr1307277edo.212.1623272656527; Wed, 09 Jun 2021 14:04:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623272656; cv=none; d=google.com; s=arc-20160816; b=levC+bcUI328b7MZWPdH68SV0h0rC1YCfHN/jrq8ERerIjMVEAT6bprEc9Bmv86VS/ tVBYvCPMKR4I7pjIhU1mrQDYsTfsX1E6zYY7FLmH397XeLBX5nddTbN1W31Dk7jIPkg1 nMOIr2SzCTEnqwVvF9IfmtesJ74CtAX7MMCOuFDRyv/bN8YjKEqnIwEGKw8TfXBzSOul rv+66GyGP2Q3d69xaxDJGmCl35Q1kjC+pImtT+H9/zUU/V+Ib2XtPqPBRhbY4sm8jtRW zvYs5eXuT1sukI9XDClVixM+j+4/6Nv2cKfPXM72IkujtMcQBGVeAz5qiUHViQ4VKhzX /7Eg== 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=BZEKmBP4Ht5z0VhXbtNYJudMdZQxGdzTF2nwF/sJc50=; b=c0R8jXOQd8BRiEV9ZbaIdcQpCiEvMgF3KeKnNpNPsKJWDZMTMAMBwu7cS2g/igwotd QElli0o0dVC4On/uJQF3xodERtsY2O5lJ3bWzlRJY2QkFMKr696rf6cDDJzL2Ir+qF7p CU981lIMkeLKBogBezOIMyaSeeAZYRF8uAvfyxSIAeOABYwghmW8d+7iqUDjr7IzP9ph 3XBV+PGBMRYQoxqT7isf9gXE9HEstl1zFcqe/bZBlAPN6eaKbXUMZmjUSJ9+KppypY3X B8Kl+tmdKIIBl0lFtcrhxkqXEmvk2zCOq4DnXi0ypjxnITU3SE4zD20q7ZWGTRsRC5k0 qZ5w== 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 u26si684498ejz.348.2021.06.09.14.03.52; Wed, 09 Jun 2021 14:04:16 -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 S229865AbhFIVEE (ORCPT + 99 others); Wed, 9 Jun 2021 17:04:04 -0400 Received: from cloud48395.mywhc.ca ([173.209.37.211]:49874 "EHLO cloud48395.mywhc.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbhFIVED (ORCPT ); Wed, 9 Jun 2021 17:04:03 -0400 Received: from modemcable064.203-130-66.mc.videotron.ca ([66.130.203.64]:51954 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 1lr5Kw-0000ci-Vc; Wed, 09 Jun 2021 17:02:07 -0400 Message-ID: <198e912402486f66214146d4eabad8cb3f010a8e.camel@trillion01.com> Subject: Re: [RFC] coredump: Do not interrupt dump for TIF_NOTIFY_SIGNAL From: Olivier Langlois To: Linus Torvalds , "Eric W. Biederman" Cc: Linux Kernel Mailing List , linux-fsdevel , io-uring , Alexander Viro , Jens Axboe , "Pavel Begunkov>" , Oleg Nesterov Date: Wed, 09 Jun 2021 17:02:05 -0400 In-Reply-To: References: <192c9697e379bf084636a8213108be6c3b948d0b.camel@trillion01.com> <9692dbb420eef43a9775f425cb8f6f33c9ba2db9.camel@trillion01.com> <87h7i694ij.fsf_-_@disp2133> Organization: Trillion01 Inc Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 Wed, 2021-06-09 at 13:33 -0700, Linus Torvalds wrote: > 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(). I need clarify what does happen with the io_uring situation. If somehow, TIF_NOTIFY_SIGNAL wasn't cleared, I would get all the time a 0 byte size core dump because do_coredump() does check if the dump is interrupted before writing a single byte. io_uring is quite a strange animal. AFAIK, the common pattern to use a wait_queue is to insert a task into it and then put that task to sleep until the waited event occur. io_uring place tasks into wait queues and then let the the task return to user space to do some other stuff (like core dumping). I would guess that it is the main reason for it using the task_work feature. So the TIF_NOTIFY_SIGNAL does get set WHILE the core dump is written. Greetings, Olivier