Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2205396pxa; Mon, 3 Aug 2020 10:00:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7BEws7Bu+J6qvROXuKl6AekYKQs0tzyQNiIF30qKDJCrHOH+bYPBRQttxsAylQ7bfw8UH X-Received: by 2002:a17:906:2784:: with SMTP id j4mr7818023ejc.96.1596474047771; Mon, 03 Aug 2020 10:00:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596474047; cv=none; d=google.com; s=arc-20160816; b=lpvUVr3k26Q8sa9pRzc33FxyYi6XS8ykMdfbxomwK4Mrf3EqmceipPXDgI8tb/b1h6 xvTkfpR6CIBFYmnNdnhtaHNTi3U/GV6XC2dh+EJQ/P+mQghy/u7WUuRr9ALV5PE2NgIA m4sDg09eRPngqFRR/6fZpbcxb+mSBRiZRFCfsfCAFPl0KiBlTDTZXoEW5fgXCArc3dnS WNS3stVJqcqBBrJjzz0FTkwgGJxo6cT6Fkn42D3T1idtTCYYDigMZsvdNa1NgJVb2UY4 aiR0P8L5hZJWWp5LbI/Ir4s5Um2SFSApx+fdKhJWdY/FvyHXC1fKBidrbhBN0rba13u0 k7jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature:dkim-filter; bh=xPQidYuoj27KLcDBCgI71AQFyVVUOYWMoSSTSHUPbW8=; b=gy2aoY80lKtlb5etO5MNy70mDDLSJYzQkyhhf3vXZXw1/aVnFNMb4PaoEHO8CZfAYp j9c5jGvdz3AqdW+RJK0oTnToQwjk3QnsdyuX2RhK3wrf/xYqDIBs/Ef7ZPmuNToE9R8k Sr9iasH5cdzqbT8iL4+wYRHqTs0FpmCAbwQn8u4wxdlUhmHZdQXmFjL/kkFlKdP9ijMh Bj2VSmdGCRDmt79vh09oGGaM4YZ1ccgjFC7yS2NScJIan5t0QSYo4GTsH9qgsApLpSdn m40QuFUwUbvyxAlSfNXNzbEgRKzJ7C3bZZeCp2enMPoRuhKYY/1tVbMRP+SiJ3sz/7hq 6Vpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=aFVPc1Gu; 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=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i13si1897418ejv.279.2020.08.03.10.00.25; Mon, 03 Aug 2020 10:00:47 -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=@linux.microsoft.com header.s=default header.b=aFVPc1Gu; 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=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728127AbgHCRAH (ORCPT + 99 others); Mon, 3 Aug 2020 13:00:07 -0400 Received: from linux.microsoft.com ([13.77.154.182]:50684 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726802AbgHCRAG (ORCPT ); Mon, 3 Aug 2020 13:00:06 -0400 Received: from [192.168.254.32] (unknown [47.187.206.220]) by linux.microsoft.com (Postfix) with ESMTPSA id 78F6120B4908; Mon, 3 Aug 2020 10:00:05 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 78F6120B4908 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1596474006; bh=xPQidYuoj27KLcDBCgI71AQFyVVUOYWMoSSTSHUPbW8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=aFVPc1Gu41xtINHxdFGnzfv2HBq0EGEd0iH8amloyMh8tYfeAU7clLOSMb6TuEJmU hfVT4JzlCTZI9FgI54InEHWWr99xf3Egvr+DSd/z2OzTw7yIg+2Z6TOublxySEu1T5 rUlm/3leT/O5FXJfSA+UW2fG5vVktd6bCmKVR4as= Subject: Re: [PATCH v1 0/4] [RFC] Implement Trampoline File Descriptor To: David Laight , 'Mark Rutland' Cc: Andy Lutomirski , Kernel Hardening , Linux API , linux-arm-kernel , Linux FS Devel , linux-integrity , LKML , LSM List , Oleg Nesterov , X86 ML References: <20200728131050.24443-1-madvenka@linux.microsoft.com> <6540b4b7-3f70-adbf-c922-43886599713a@linux.microsoft.com> <46a1adef-65f0-bd5e-0b17-54856fb7e7ee@linux.microsoft.com> <20200731183146.GD67415@C02TD0UTHF1T.local> <7fdc102e-75ea-6d91-d2a3-7fe8c91802ce@linux.microsoft.com> From: "Madhavan T. Venkataraman" Message-ID: Date: Mon, 3 Aug 2020 12:00:04 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/3/20 11:57 AM, David Laight wrote: > From: Madhavan T. Venkataraman >> Sent: 03 August 2020 17:03 >> >> On 8/3/20 3:27 AM, David Laight wrote: >>> From: Mark Rutland >>>> Sent: 31 July 2020 19:32 >>> ... >>>>> It requires PC-relative data references. I have not worked on all architectures. >>>>> So, I need to study this. But do all ISAs support PC-relative data references? >>>> Not all do, but pretty much any recent ISA will as it's a practical >>>> necessity for fast position-independent code. >>> i386 has neither PC-relative addressing nor moves from %pc. >>> The cpu architecture knows that the sequence: >>> call 1f >>> 1: pop %reg >>> is used to get the %pc value so is treated specially so that >>> it doesn't 'trash' the return stack. >>> >>> So PIC code isn't too bad, but you have to use the correct >>> sequence. >> Is that true only for 32-bit systems only? I thought RIP-relative addressing was >> introduced in 64-bit mode. Please confirm. > I said i386 not amd64 or x86-64. I am sorry. My bad. > > So yes, 64bit code has PC-relative addressing. > But I'm pretty sure it has no other way to get the PC itself > except using call - certainly nothing in the 'usual' instructions. OK. Madhavan