Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2976685pxa; Tue, 25 Aug 2020 08:15:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3Iah5g+fgcR89rA8ZfdLJBhus3J3KufD2UVJvXMJPPQNrgHZ8/U7+PoafiO1i1NycljjN X-Received: by 2002:aa7:d68b:: with SMTP id d11mr7636963edr.143.1598368524544; Tue, 25 Aug 2020 08:15:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598368524; cv=none; d=google.com; s=arc-20160816; b=QsQ+kmaJyPtJrTv4SqYuTRSnA/PVTPS8UDBE4P85DHqmgx8JvUbotNA4ZlMmW6iSbQ 6taNwscWy+utsLtdC3If6G0H54XRvNmCXzw+iSlyB/11fTj2ZPY22RaY7BXoYjSNlBdO RKAllN/WtRsu70Vb9vnT7L/R1uYyU4zV8PYFdC21hEFMu9PwFwkv1d3H+R3fPpaEjATp y6TsHM4+JftN3sa9KnB7OgSXO/gLT1dTSLa7GhR2BFUaISVLTX0LmvbqzGfo7x/NSSBF ZVF/VZI0ZtAuAwNwn/xSa3TABCUHkYMly5BRnSVKZfPv0ucUJapCFo9AzpvdWYeWGVNP JnmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date:dkim-signature:dkim-filter; bh=EWMm8se8kI2wXTq4mmPYDwFOsE37FUtVdOwSAlw5ftQ=; b=Zu5XyS0n2HyOKaYpjdTO+D1qopUdTUYVkUXBrcvpo8gr8JFXZvqKTnJLCJw9FrznnF YPk/bItL1xlSXyMWUDp3+0z9r8w6NUh7tfT1f7W8bi1ik5XFYYakPUpykHIqDxriE9ZF JolLTFRmj7OeQznXklBfM25QCK9xHlCXUCh14TJSW0VAfnoTOg/7CNYM0OBc1phjeBsT S7d6PjzSFRQ5zi6bqATesIpbNgjLIlZBa34W9ViRDkfBDmpgHZlZSfcTXO+WO2YOYZXF 1bMZaiN2g7S4ofwzQTSr8Fkax5Z+D3drUT1M8YN0y1c/X1T/b15YhVEX0Wt4mdNSDMOu cPQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@zytor.com header.s=2020072401 header.b=Se3cR6Eh; 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=fail (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e13si3558643ejh.635.2020.08.25.08.15.00; Tue, 25 Aug 2020 08:15:24 -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=fail header.i=@zytor.com header.s=2020072401 header.b=Se3cR6Eh; 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=fail (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726610AbgHYPOV (ORCPT + 99 others); Tue, 25 Aug 2020 11:14:21 -0400 Received: from terminus.zytor.com ([198.137.202.136]:36127 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726180AbgHYPOU (ORCPT ); Tue, 25 Aug 2020 11:14:20 -0400 Received: from [IPv6:2601:646:8600:3281:ac5a:5acb:ad61:7409] ([IPv6:2601:646:8600:3281:ac5a:5acb:ad61:7409]) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id 07PFE07C2895287 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Tue, 25 Aug 2020 08:14:00 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 07PFE07C2895287 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2020072401; t=1598368441; bh=EWMm8se8kI2wXTq4mmPYDwFOsE37FUtVdOwSAlw5ftQ=; h=Date:In-Reply-To:References:Subject:To:CC:From:From; b=Se3cR6Ehlm49FUFATgVkuAS4utwTOKJL2nqSWjh/EfqygjvSMZEntNB81gn6jSviC qipg50JEvAa2JJ81+CgoNRHDjMac5seToMTbwJC3jgzHDwZGnWgf/CgHO5uqUK5mRm gQ4F9OmTfKauqpkuGMe7AbCcybt4kC+3MkF1Key0eITEKKNhuDsWmjzq0+dMTPg9Pi iPlGtY4vxx7Qjisekr8gSF70aHv/cVASHZd39fRPBJ/ZTJ5/1/yQjqscqar2wFmepE VXwPjxy0kg4D1U1SSziMDNxLvjXsoOiU1Q1rsqu3L0FPf3LYZ8e9kJt/etVLDBdoO7 rHpNxRtH7VvrQ== Date: Tue, 25 Aug 2020 08:13:51 -0700 User-Agent: K-9 Mail for Android In-Reply-To: References: <7DF88F22-0310-40C9-9DA6-5EBCB4877933@amacapital.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system To: Andy Lutomirski CC: "Robert O'Callahan" , "Bae, Chang Seok" , Kyle Huey , Thomas Gleixner , Ingo Molnar , Andi Kleen , "Shankar, Ravi V" , LKML , "Hansen, Dave" From: hpa@zytor.com Message-ID: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On August 24, 2020 5:30:56 PM PDT, Andy Lutomirski wrot= e: >On Mon, Aug 24, 2020 at 4:52 PM H=2E Peter Anvin wrote: >> >> On 2020-08-24 14:10, Andy Lutomirski wrote: >> > >> > PTRACE_READ_SEGMENT_DESCRIPTOR to read a segment descriptor=2E >> > >> > PTRACE_SET_FS / PTRACE_SET_GS: Sets FS or GS and updates the base >accordingly=2E >> > >> > PTRACE_READ_SEGMENT_BASE: pass in a segment selector, get a base >out=2E >> > You would use this to populate the base fields=2E >> > >> > or perhaps a ptrace SETREGS variant that tries to preserve the old >> > base semantics and magically sets the bases to match the selectors >if >> > the selectors are nonzero=2E >> > >> > Do any of these choices sound preferable to any of you? >> > >> >> My suggestion would be to export the GDT and LDT as a (readonly or >mostly >> readonly) regset(s) rather than adding entirely new operations=2E We >could allow >> the LDT and the per-thread GDT entries to be written, subject to the >same >> limitations as the corresponding system calls=2E >> > >That seems useful, although we'd want to do some extensive >sanitization of the GDT=2E But maybe it's obnoxious to ask Kyle and >Robert to parse the GDT, LDT, and selector just to emulate the >demented pre-5=2E9 ptrace() behavior=2E > >--Andy We only want to allow the same access that user space gets, that's exactly= the sanitization we need=2E --=20 Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E