Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4737037pxj; Tue, 25 May 2021 15:22:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSHt9FiyXGsvHHe6vY0HHysdP3Fw40ibuQt7oA/alQSETdsFLlfu6bqy9CgVqZuy+hFwF0 X-Received: by 2002:a17:906:eb0c:: with SMTP id mb12mr30743650ejb.109.1621981356917; Tue, 25 May 2021 15:22:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621981356; cv=none; d=google.com; s=arc-20160816; b=vVNtaRJVP+o0wIVn77FjelwhgF1cqlI675QRpFq6vbTvib+z9OzpDEDsygB6S/MTgO 0YsvNxT2ifibN0sSI8buWhnc5gyO9wpXfqbk6gG3JiAFByswMuW65VCRbSwACDi2Qb9S DQtLRmbTf/n7MBGdQIXmXHUMsPhv5/GHjpREBaTSlh4onTblhhpUe+F3UoJTT2C8miUp LvBczQGf1UUWS6B5IYsHY8pp+GpG3o0eUaa6qiBkt0EincXb90MIgC6t7r25CQ8LPxHK x2CPjBnn/bBIRVcKwoSBPkoGPq4C+C50QxnA9Or3pECt84ugd0pL4jnlzfxhHpKVPSDu piDQ== 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=UO4cRIk5qquAAjOKheXAwwNGBIjXVGT0/M7rIHH9/TM=; b=UVdfkh1ZCBQKW+vKopHJFz4kYDBbh42M2svwiaK2A6pvMT+HoRqFiHqdXUogKTDLlz gjvJIDx7hSS5wgLFVUjEdfHJo9bWaTwuJIFm75QxESNwcO24GP40xxo9AwKat+dtdqy2 6wAIuskdySsyn5XtV07P6WDvrGzAtzKMQaXRSHdS3fJF27hJVMWvaxaJWDEt/bERysqZ YrM14vkzvPHEh09BBj1uwZY8JuM4/IUrUZR/8AajlIibkFQU9LmPfAn2J+TfTc2IyTVf oQV9yq0c4GHVcPXLwf5xYEi4GOTob8VZukQz92VGRMmIbMXqGXsgLN5FKKhrNtJzAU0q 88hQ== 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 cc28si17741625edb.100.2021.05.25.15.22.14; Tue, 25 May 2021 15:22:36 -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 S232657AbhEYTlc (ORCPT + 99 others); Tue, 25 May 2021 15:41:32 -0400 Received: from cloud48395.mywhc.ca ([173.209.37.211]:38844 "EHLO cloud48395.mywhc.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229962AbhEYTlb (ORCPT ); Tue, 25 May 2021 15:41:31 -0400 Received: from modemcable064.203-130-66.mc.videotron.ca ([66.130.203.64]:52976 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 1llcuF-0005XG-9z; Tue, 25 May 2021 15:39:59 -0400 Message-ID: Subject: Re: [PATCH] io_thread/x86: don't reset 'cs', 'ss', 'ds' and 'es' registers for io_threads From: Olivier Langlois To: Jens Axboe , Linus Torvalds Cc: Stefan Metzmacher , Thomas Gleixner , Andy Lutomirski , Linux Kernel Mailing List , io-uring , the arch/x86 maintainers Date: Tue, 25 May 2021 15:39:57 -0400 In-Reply-To: <4390e9fb839ebc0581083fc4fa7a82606432c0c0.camel@trillion01.com> References: <8735v3ex3h.ffs@nanos.tec.linutronix.de> <3C41339D-29A2-4AB1-958F-19DB0A92D8D7@amacapital.net> <8735v3jujv.ffs@nanos.tec.linutronix.de> <12710fda-1732-ee55-9ac1-0df9882aa71b@samba.org> <59ea3b5a-d7b3-b62e-cc83-1f32a83c4ac2@kernel.dk> <17471c9fec18765449ef3a5a4cddc23561b97f52.camel@trillion01.com> <3df541c3-728c-c63d-eaeb-a4c382e01f0b@kernel.dk> <4390e9fb839ebc0581083fc4fa7a82606432c0c0.camel@trillion01.com> Organization: Trillion01 Inc Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.1 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 Fri, 2021-05-21 at 03:31 -0400, Olivier Langlois wrote: > > However, I can reproduce it at will with my real program. So as Linus > has suggested, I'll investigate by searching where the PF_IO_WORKER is > used. > > I'll keep the list updated if I discover something. > I think that I am about to stumble into the key to unravel the mystery of my core dump generation issue. I am going ask you a quick question and it is very likely to trigger an ahah moment... To what value is the task_struct mm field is set to for the io-wkr threads? If I look in the create_io_thread() function, I can see that CLONE_VM isn't set... There are still some fuzzy areas in my io_uring inner design understanding but I would think that the io-wrk threads must use the user process mm at some point in order to be able to fill in the user provided buffers... This notion appears to be central when creating a coredump... Only tasks having the same mm than the one receiving the SIGSEGV will be zapped... in zap_threads(): for_each_thread(g, p) { if (unlikely(!p->mm)) continue; if (unlikely(p->mm == mm)) { lock_task_sighand(p, &flags); nr += zap_process(p, exit_code, SIGNAL_GROUP_E XIT); unlock_task_sighand(p, &flags); } break; }