Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3934211ybv; Tue, 25 Feb 2020 09:57:43 -0800 (PST) X-Google-Smtp-Source: APXvYqyQetpbKyNxzuqBaIYbz6XepMj4eOmSBtEolxukf09vgS883UfzjvmiwjUhiXfg5t/COsCV X-Received: by 2002:a9d:2264:: with SMTP id o91mr34359664ota.328.1582653463562; Tue, 25 Feb 2020 09:57:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582653463; cv=none; d=google.com; s=arc-20160816; b=EqBSssj/a1qJLJ9rzA6JjffOFlKg8AK8VtI1+sq7ubIVvlonETBwKuxZkzTv1KRKT1 QCuX6eMVSZNou5BCdHhP+LPIdJcttNBgMAXr6xevvipwsk+rYo0ImMoeng9gpy8qaCMI IuYoAP36csSrKE70ltz0UaLlh7cvOTO//Iem5F8k8y1K5mV+h3yBu+gOl5ZxMepOALp5 JIf39VwZjfwSqQgugfv9LoRmh+xpzgrcROh8GLHRKQlEV9oY2IuNSez2jp1Khjr3Z5+9 J4CP+IJFg3cRSx53S+JdYxofGhHi1/1t1n22y1TQ4ygpAR1No5yWCKCl3Rw/tX5bKsNe cOEA== 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:date:from:dkim-signature; bh=xRRmwcNUsR+GhcUjy9+SyPV6XEYtfd5D5Ja+YQokWiA=; b=fQTgTSrzDl+IEhIJQUyVAVdxIO4HisBsOKUw8v5j0i/MoQK9fvcP1LPRGJaWL+1TPv DYlhDrHRY88tznJelIhLduLlHBnovDpJHSBcO70jQxpq1tqfHVAwi0MCZlbhUzXN1rD+ Au2Dk94EDWlanBAPgDTs9X/j2gwVe5MapCOeIEHxZeMiiP0E3e0hJXhFkYTjNIShLN6q nK6vvWGWTSqYg/6mKnBm0iCY2es7sm8Gn0yUSv35aV54ehFMrJI2KXN0MTAhwjFxqsDd XtfiLhUv8eaPzWfOIkN4sZwzw/O7fSOFtn7JKBElbswVbbLBxoHP8uOw/G6k/q/0X8KZ B7ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Le1Nz8N5; 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 t128si6772867oie.176.2020.02.25.09.57.31; Tue, 25 Feb 2020 09:57:43 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Le1Nz8N5; 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 S1731180AbgBYRt6 (ORCPT + 99 others); Tue, 25 Feb 2020 12:49:58 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:43518 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731017AbgBYRt5 (ORCPT ); Tue, 25 Feb 2020 12:49:57 -0500 Received: by mail-qt1-f196.google.com with SMTP id g21so228909qtq.10 for ; Tue, 25 Feb 2020 09:49:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xRRmwcNUsR+GhcUjy9+SyPV6XEYtfd5D5Ja+YQokWiA=; b=Le1Nz8N5wJimx6Cq77znmKci4x87K/gkTCkMfK1j7bJ8Fv9ymgm/XdiSiOnPcw59Uw rLt/1/ZWyfPowrtLXK1HsrBUNyO7hODU7ZiV/uvlIkSSg+i8Fr+zjxZ4w+DPEe74w7fn Zf6eXtWvTOQnAMfHADwvdXdfpmgR1iX4ijn446/439PzTmMu+JjT6M99asMiUWlI4ioc FyiGlNwsZOT9MUA/7uMaUcqfyjRPMSBEaBRs92XACg/xV5HOCOPGbjeFQUrwfIR8F0R7 m8/NWnpniNXJAuTgdF+aFLOsWCOZCNNSALWVB641OGBBw7N8SkAD154cauwtYpJJ9W7Q K1Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=xRRmwcNUsR+GhcUjy9+SyPV6XEYtfd5D5Ja+YQokWiA=; b=KbpelOtPrVIX7QCt2+TPhRM3Kd7GeAqu/ulcYAAngsAF8Nd6jyddbxyQeQE5Cymrcw OGqGisFONKXy8S8pFM93CuenNkx9APpkCpnpQM3p6arZe6GvP7fPxJb92lAmsoTyL/CC Uc3U1Mct5V+GajLZhLqjE/+N32I5EWEMNHFkoGkGkGyDrmECN/RM1O4eRscj4nK7SdOG 3I6TLgwOCRpOZ+/XhoredS5cxbsOfC7R445IzzsaGixmlZXchfoqBN10wthrelQYFWIT 73cuiNYQrz51qe6Tcf5ikRJaumal44SINTKGYpM+7vAt56xMKfdO1lZspGD/fy3nBjye 8UCQ== X-Gm-Message-State: APjAAAWQyMs21N6Y+aSPzmwxAP5XQurJJvB3PPzjqW8Bo9Rrf94X7sT9 53+Rs7OG72qArM07Lst2mvc= X-Received: by 2002:ac8:1308:: with SMTP id e8mr56613876qtj.242.1582652995139; Tue, 25 Feb 2020 09:49:55 -0800 (PST) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id o17sm7919334qtj.80.2020.02.25.09.49.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2020 09:49:55 -0800 (PST) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Tue, 25 Feb 2020 12:49:53 -0500 To: Kristen Carlson Accardi Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, arjan@linux.intel.com, keescook@chromium.org, rick.p.edgecombe@intel.com, x86@kernel.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com Subject: Re: [RFC PATCH 08/11] x86: Add support for finer grained KASLR Message-ID: <20200225174951.GA1373392@rani.riverdale.lan> References: <20200205223950.1212394-1-kristen@linux.intel.com> <20200205223950.1212394-9-kristen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200205223950.1212394-9-kristen@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 05, 2020 at 02:39:47PM -0800, Kristen Carlson Accardi wrote: > At boot time, find all the function sections that have separate .text > sections, shuffle them, and then copy them to new locations. Adjust > any relocations accordingly. > > Signed-off-by: Kristen Carlson Accardi > --- > arch/x86/boot/compressed/Makefile | 1 + > arch/x86/boot/compressed/fgkaslr.c | 751 +++++++++++++++++++++++ > arch/x86/boot/compressed/misc.c | 106 +++- > arch/x86/boot/compressed/misc.h | 26 + > arch/x86/boot/compressed/vmlinux.symbols | 15 + > arch/x86/include/asm/boot.h | 15 +- > arch/x86/include/asm/kaslr.h | 1 + > arch/x86/lib/kaslr.c | 15 + > scripts/kallsyms.c | 14 +- > scripts/link-vmlinux.sh | 4 + > 10 files changed, 939 insertions(+), 9 deletions(-) > create mode 100644 arch/x86/boot/compressed/fgkaslr.c > create mode 100644 arch/x86/boot/compressed/vmlinux.symbols > > diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile > index b7e5ea757ef4..60d4c4e59c05 100644 > --- a/arch/x86/boot/compressed/Makefile > +++ b/arch/x86/boot/compressed/Makefile > @@ -122,6 +122,7 @@ OBJCOPYFLAGS_vmlinux.bin := -R .comment -S > > ifdef CONFIG_FG_KASLR > RELOCS_ARGS += --fg-kaslr > + OBJCOPYFLAGS += --keep-symbols=$(obj)/vmlinux.symbols I think this should be $(srctree)/$(src) rather than $(obj)? Using a separate build directory fails currently.