From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3868EC433E0 for ; Mon, 3 Aug 2020 16:03:51 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id 8C994206DA for ; Mon, 3 Aug 2020 16:03:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="QHf+d+ad" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8C994206DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-19536-kernel-hardening=archiver.kernel.org@lists.openwall.com Received: (qmail 24238 invoked by uid 550); 3 Aug 2020 16:03:45 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Received: (qmail 24186 invoked from network); 3 Aug 2020 16:03:34 -0000 DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 09D5E20B4908 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1596470602; bh=ZiO52alLmnpxT7j4anLU5ZigsjFuPb9HBovKSoPQQ3w=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=QHf+d+adyjmFUMw8F6KIhtFl2KmvTj4vBrSymSBr/2bDq/bWh9j06EOVn5++PivQ+ voHvs0Lb2zIfoJuBfpScJ2evOehCf7CU8vfsuxDIGF7QhHjz3poDRcCPaEONbsDGN9 dqsnbvmNS9ytmBh/6/eiWhI5Hsbb5iwXGxjz1OIg= 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> From: "Madhavan T. Venkataraman" Message-ID: <7fdc102e-75ea-6d91-d2a3-7fe8c91802ce@linux.microsoft.com> Date: Mon, 3 Aug 2020 11:03:21 -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 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. Madhavan