Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp190673ybl; Tue, 7 Jan 2020 04:36:32 -0800 (PST) X-Google-Smtp-Source: APXvYqxgV8gkpt5LfbxMdXHsbVQ+2aszhmkVOHQNbi9k7UyZ1Q4qE4vs2EugkpPo0qLv4PpkmaBs X-Received: by 2002:a05:6830:1487:: with SMTP id s7mr96253202otq.269.1578400592589; Tue, 07 Jan 2020 04:36:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578400592; cv=none; d=google.com; s=arc-20160816; b=SWBb6rF+kCyncfYstzvdLFLm0HQCrjKe/bkxtB8Wmoj8JxJ51Vx0+fUSHd0+dF/l0l mnVPE4JB2mtGlEBUJeMjfGMtI3CRb4M3/+5e/cGpu75cxYUFTLlapilwcWRfWv+vzVOz pFwQ4xEYcx2UD2keuN5Q+hroF7syptOKFBsJqOzsYq9Ko7QYBg1rvTPXJsWYJD16p8B2 9DBINh3/zJgItZWDvf1hg73zE6vqavYrIrHc3sj5oTSLY51iNtcNPtx1hFXFsXlgcEMn 0YGkgpwx1TM9oWLMBEM/SLDXfYMyx62s+WylsKpyK9KvMQ980guDsD71MaMMpL6lcqoY wh/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=8GR2Xvj2thvT6wxSfA8icN0Ia1vWLdY/LDe3U+/5XBI=; b=JsS1zMJmR+HB7sGnl6480S+B/RRjvv7B2nvG/rqryP6OSPzbpdj1Fgis0w/VmwPjZ1 UtONkc2dseKd7DH4XMOWZVv4SXv22SGSHDhrYwMUgtQxcojwd7y/XVhxUAo8gTzPxa1n Mu7s0HQLVR8X+aoh8P3dmN9TTpRtwZ1gVS9lbNDMLsJ2kRyKVD1l+DCamQtAYi/oiD37 8BBcmjgVBgUgeBj0BpONnkdlOPdRIPQyOjMLFYH1zqF0Of/IIupctPTh3mnV2Dga7HxI 6/Q1lEeRfMdkVnWw2xAdc0ZkNkFNp1PJmP8TJjmxdg2Yy4+dvyUAtzgTVojorhU1HW2q oHdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q20si36682902otn.297.2020.01.07.04.36.18; Tue, 07 Jan 2020 04:36:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727972AbgAGMee (ORCPT + 99 others); Tue, 7 Jan 2020 07:34:34 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:51838 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727177AbgAGMee (ORCPT ); Tue, 7 Jan 2020 07:34:34 -0500 Received: from ip-109-41-1-227.web.vodafone.de ([109.41.1.227] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ioo48-0001ih-2L; Tue, 07 Jan 2020 12:34:32 +0000 Date: Tue, 7 Jan 2020 13:34:35 +0100 From: Christian Brauner To: Amanieu d'Antras Cc: linux-kernel@vger.kernel.org, Christian Brauner , stable@vger.kernel.org Subject: Re: [PATCH 0/7] Fix CLONE_SETTLS with clone3 Message-ID: <20200107123434.vxfq57oah34plvjx@wittgenstein> References: <20200102172413.654385-1-amanieu@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200102172413.654385-1-amanieu@gmail.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 02, 2020 at 06:24:06PM +0100, Amanieu d'Antras wrote: > The clone3 syscall is currently broken when used with CLONE_SETTLS on all > architectures that don't have an implementation of copy_thread_tls. The old > copy_thread function handles CLONE_SETTLS by reading the new TLS value from > pt_regs containing the clone syscall parameters. Since clone3 passes the TLS > value in clone_args, this results in the TLS register being initialized to a > garbage value. > > This patch series implements copy_thread_tls on all architectures that currently > define __ARCH_WANT_SYS_CLONE3 and adds a compile-time check to ensure that any > architecture that enables clone3 in the future also implements copy_thread_tls. > > I have also included a minor fix for the arm64 uapi headers which caused > __NR_clone3 to be missing from the exported user headers. > > I have only tested this on arm64, but the copy_thread_tls implementations for > the various architectures are fairly straightforward. I've picked up this series and moved it into https://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git/log/?h=clone3_tls If I hear no objections I'll merge into into my fixes tree today or tomorrow. Thanks! Christian