Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17695228ybl; Thu, 2 Jan 2020 10:13:16 -0800 (PST) X-Google-Smtp-Source: APXvYqwGQ98B7wiDobfARaSGoRYFfmCxlXmdGYOobQK+pWItNQaRviw1/obdnblVjmlIrycWNVaZ X-Received: by 2002:aca:a849:: with SMTP id r70mr2811831oie.28.1577988796646; Thu, 02 Jan 2020 10:13:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577988796; cv=none; d=google.com; s=arc-20160816; b=wyLHP4bi08JGKKcdjR1T3jfp8Wi0xmRrWJhd1e7BUoy6tg4Qmsej7tL7PCrGXUd7Tx Xc1gfaU9LWtH4tD9jEHVtjqdJmFfKMSUE5ndVG6OAXdiesOfhIcoSYVFwtytTYXc6g9E x7n9+rVqXG7UFWCnoJmGeqkC/6dfNOMvi1j26a1YNrqjnJsBvtIwfPeh80pmoxVaa5wk 8GLDrUt2NmNLiiQwzjzXDbqvEH3OxwlFKIIKqAUSBuUytdLA+9i4N+Rbr7x1MtdMUrQ1 i2GA5eXjpZVT3Y7xH1QBBfK2Vb9kZpBnu/Ygdjaee9qeqbG++yY6M/ncTOgmQse34usU laMw== 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=G4B69CgR2hMEJoGPYDS+fTptoUmDU6jmImXGlqfDsqo=; b=mfg5glBB6a/YT3UugitUl24gY5VTUmi9qo3h77rm+eTNxUIDMQ8rKnO749zPd3szfW 6hRgZBcYbOZeuhhaGCCWJnaV1Iqfg0O6HZ5pldSoulyqn9aEQ3pdpIx0qv0p4EJaJqjI 3vKvdGEzNJFPGEl9FPwgEujTFTXUxp9Ih4h7WTUm+c0xQwhcOy417u1Hm4MZEFJFuMUG 5Q1wnpsLAVQn3poIMOS/Lk4CDHKHjLzMaz+BU7em/noOwB8/STP2pEkL29s1NGyDSZ/Z GViqTMox1qRJpvxT6wQhCBuA18fIq5OimIQc9X2N/ucnpKR/f4gw3lpJPo8RFwmTE8T1 AzuQ== 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 f3si27033930oia.264.2020.01.02.10.13.03; Thu, 02 Jan 2020 10:13:16 -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 S1727998AbgABSLU (ORCPT + 99 others); Thu, 2 Jan 2020 13:11:20 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:42685 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727864AbgABSLU (ORCPT ); Thu, 2 Jan 2020 13:11:20 -0500 Received: from [172.58.107.60] (helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1in4wH-0008Hv-Hu; Thu, 02 Jan 2020 18:11:18 +0000 Date: Thu, 2 Jan 2020 19:11:13 +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: <20200102181112.rc3vnxxm2erl36ep@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. The series looks straightforward to me but I'd like a few Acks from some of the arch maintainers before taking this. Acked-by: Christian Brauner