Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp681070pxf; Thu, 1 Apr 2021 10:46:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzctnDbZuLWhMN+xsMIb8ReKo5sYW9J9vOFuyYNf265/9WEi+cwi7sNr//IM6RvvmOzaz9U X-Received: by 2002:aa7:d1cd:: with SMTP id g13mr11140161edp.369.1617299204097; Thu, 01 Apr 2021 10:46:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617299204; cv=none; d=google.com; s=arc-20160816; b=jbPxIH9F05KlDqtaJVbGgHuAuyoHa56YqM2RRV6LB1Xx7xayAEzSW9FPbm/SZDLbaX /Y+WjE0oNOa+8eZJ1wMy+IEOCW11/x1QtecWVJXCb+fzuWAsYHLYeb19I3sBY7PxH8oS ycUORqjq8jtGaj3gBemN+vhKoDy++yNx7t4V7CZ+AKh58FhDvXON7xUs4XYt/6jWYRUi soffnkkKtPqi9O3gb2Q/fVrzUSyuBoOfoxxZQQgozLRxFNAUCYnXeGAt+AVgfN1XMGjf PAJ/b5V3ug9g204D+hpBbtyAOVjpmGckuX9ZVzfqmU7jpM05A3MZjg66O2T7Q+Ng/h/X 56CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to:dkim-signature; bh=m/fhQBoIS2Ry4FN35jTMDrpVXQElvBfJuR2zw8YjBR8=; b=dIFRk5CUk84k0J400f0jOKrQbLcJmSDfzJtui67f0znORjKMfgafRduBz7QPNyouCt p+vTSrNjdJus+XMTrot4PGpf1A6r0yfSwxOXnkg7cmBi8ChPVGQldzqbWVjlslQkyopc 5iyS793L5GaiL5m41Kg8Ye2aRwPNB0phVFUv/G19FEi/RPo2v/x5CHohZcg0BYj88tUY Sp+tn/pcrrf/YJj/9TgJjKIGug4SsHLchxF8JQcEa1BanqGjy9Pz3CVrufwY1QN2JKBL LvmqWmXwefoj7q5FHnYJMQzcq+mDMzndKxRIolWGyl/NWznNrd7omB9uMaxSyz6D/oh1 ormA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samba.org header.s=42 header.b="rjM/JiaS"; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=samba.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u20si4521387ejr.511.2021.04.01.10.46.21; Thu, 01 Apr 2021 10:46:44 -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=@samba.org header.s=42 header.b="rjM/JiaS"; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=samba.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236367AbhDARo0 (ORCPT + 99 others); Thu, 1 Apr 2021 13:44:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234574AbhDARiF (ORCPT ); Thu, 1 Apr 2021 13:38:05 -0400 Received: from hr2.samba.org (hr2.samba.org [IPv6:2a01:4f8:192:486::2:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BB4CC02FE94; Thu, 1 Apr 2021 09:00:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=samba.org; s=42; h=Date:Message-ID:From:Cc:To; bh=m/fhQBoIS2Ry4FN35jTMDrpVXQElvBfJuR2zw8YjBR8=; b=rjM/JiaSCTDtwzRn1bvABQ1ETe ESRd9Axo3R60B+iHazD05eaRpyJagq1NfzDf1+A3kZJBP7tDY33G9L0KtQz78lnyfCeVWizBZk0Y+ L1GPrVCHtHWPRJOi6+7pGZdCQhlBgYdDq9Z7BuVwIBOMK7GkLZiznxtR2G4aPPCwHzrhTmRrxujWO XMhmTpPC2LKD8FnU8Q1jn6BkU8qjTyYqdNFLLk0fD7nwXUdDQ8qTZrfBpKVxXaRY7fSRJiNAUFA0S eSJCmLldPegdfFcRVYBQYOYmH9n0khNekPsLqstFxpxohWyj+hEGDBm6QQ10JGCtAtZ/opQGojC5N UXssgbHlMBR4T7I7fy68avXlhlHnyArnMuOee3LQKmjCo6SSDnHvoogfVCjxXY/+1stFrcN/dvBb6 TGhq6M9viPslWohIqtZpsEnu9zUaI2/wX6IpDa95Q9quzetuDIgNL1o22rC6iz1+mzu1UmxoUEBqj o7I+cLYX+oSeRdjLQmV3LSdU; Received: from [127.0.0.2] (localhost [127.0.0.1]) by hr2.samba.org with esmtpsa (TLS1.3:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim) id 1lRzkW-00080B-18; Thu, 01 Apr 2021 16:00:48 +0000 To: Linus Torvalds Cc: Jens Axboe , io-uring , "Eric W. Biederman" , Oleg Nesterov , Linux Kernel Mailing List References: <20210326003928.978750-1-axboe@kernel.dk> <8efd9977-003b-be65-8ae2-4b04d8dd1224@samba.org> <358c5225-c23f-de08-65cb-ca3349793c0e@samba.org> <5bb47c3a-2990-e4c4-69c6-1b5d1749a241@samba.org> From: Stefan Metzmacher Subject: Re: [PATCH 0/6] Allow signals for IO threads Message-ID: <2d8a73ef-2f18-6872-bad1-a34deb20f641@samba.org> Date: Thu, 1 Apr 2021 18:00:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 01.04.21 um 17:39 schrieb Linus Torvalds: > On Thu, Apr 1, 2021 at 7:58 AM Stefan Metzmacher wrote: >> >>> >>> Ok, the following makes gdb happy again: >>> >>> --- a/arch/x86/kernel/process.c >>> +++ b/arch/x86/kernel/process.c >>> @@ -163,6 +163,8 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, unsigned long arg, >>> /* Kernel thread ? */ >>> if (unlikely(p->flags & (PF_KTHREAD | PF_IO_WORKER))) { >>> memset(childregs, 0, sizeof(struct pt_regs)); >>> + if (p->flags & PF_IO_WORKER) >>> + childregs->cs = current_pt_regs()->cs; >>> kthread_frame_init(frame, sp, arg); >>> return 0; >>> } >> >> Would it be possible to fix this remaining problem before 5.12 final? > > Please not that way. > > But doing something like > > childregs->cs = __USER_CS; > childregs->ss = __USER_DS; > childregs->ds = __USER_DS; > childregs->es = __USER_DS; > > might make sense (just do it unconditionally, rather than making it > special to PF_IO_WORKER). > > Does that make gdb happy too? I haven't tried it, but it seems gdb tries to use PTRACE_PEEKUSR against the last thread tid listed under /proc//tasks/ in order to get the architecture for the userspace application, so my naive assumption would be that it wouldn't allow the detection of a 32-bit application using a 64-bit kernel. metze