Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1759644ybk; Thu, 21 May 2020 14:44:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvqcSPxFc/WUW11iMBvqCnWjZYO+pkKItUWvE98QCuLmAtszeM4bxpvgcwTZarPuXB6nVO X-Received: by 2002:a05:6402:8c1:: with SMTP id d1mr636820edz.265.1590097484132; Thu, 21 May 2020 14:44:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590097484; cv=none; d=google.com; s=arc-20160816; b=hqsAJvEO26drvVy8ndRnB05niSXhZiAGFZjFsoinKoEws2YxxSwAvt577EY/3HP+2p ToixDRL2OjPYwRPvSqXMiO8JhlqkHexblGtLTcbwPpi0z4KjGxX06HbumIRU9dzNjeJf w/8Slt2im/avUJ00ogC97uHXFc3meN91PdPcYgEkFz2Qf+F4apWsuky+EjqQLJ0gDJZv elSVGGrVW5ulo0VLuyFHp3bTltkznloACT+UOXtwJBjl0p0xSR+InrSKABpiny7HquG/ Be+e8SfQtfz8DLn9EX+Y3QiIt8/9QrmH4SlsbeHIOyRInxCq22PfWYqLKZPsAAutegW3 adZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:ironport-sdr:ironport-sdr; bh=SxwHTby8dCQ6uAgU/mlyFrmcC5TNSEJXbYnPyCtUM5Y=; b=0f1ZvWbyWKBDAH3c+E5yncnT1OUyGj3CRiKErD01H0FGMwtpOIHl7fR3L8kHo+pb2V jtq/0sr+ynkSTlSKBepBSRECfOB+xF8ednuaiY/FcsrGdgRiPoe8r+OtBmP/LHlVFgoK tFLl6GKpKxQsbc4DbC+txhHjbdRgYQqyybyovq70Wbz+faAdxBQaJBvZWRjcgjmAO69Y pukadlUdVWMP9yKAnVKF5/UY22AduNLwEWjQ9fqIhtFNhChiLDZWW1bw74meyMkRznln kLdsr5OYwz3LqFXnGmfUQnwezaHUbs2Bv2bKobTfWmgXzVbNrgxV7bCHHkHbOHT3KqvR 3VXA== ARC-Authentication-Results: i=1; mx.google.com; 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t8si3919678ejs.266.2020.05.21.14.44.20; Thu, 21 May 2020 14:44:44 -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; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729172AbgEUVnB (ORCPT + 99 others); Thu, 21 May 2020 17:43:01 -0400 Received: from mga14.intel.com ([192.55.52.115]:45314 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726814AbgEUVnB (ORCPT ); Thu, 21 May 2020 17:43:01 -0400 IronPort-SDR: I+FSU/JJ36wTN2AM3ylGKxvF2IdoxUvIrbP5QUc1vMd6qrvJ4TfBbhWpIKIAoz2CfaMMEQqOcg 8RWF4i/umq0A== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2020 14:43:00 -0700 IronPort-SDR: VrRXXdswApTlmZiOJa6cs5ElnoZWHUwIDfzGnv+RA2jY/ZIdpIR0z5RnIuWMewWb6r5X06yxA5 OInBbJzWRJuQ== X-IronPort-AV: E=Sophos;i="5.73,419,1583222400"; d="scan'208";a="300460084" Received: from kcaccard-mobl.amr.corp.intel.com (HELO kcaccard-mobl1.jf.intel.com) ([10.212.147.236]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2020 14:42:58 -0700 Message-ID: <7c8685090dd36ab0175ae91d1421f4cd7fb6aff0.camel@linux.intel.com> Subject: Re: [PATCH v2 7/9] x86: Add support for function granular KASLR From: Kristen Carlson Accardi To: Kees Cook Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, Jonathan Corbet , x86@kernel.org, "H. Peter Anvin" , arjan@linux.intel.com, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, rick.p.edgecombe@intel.com, Tony Luck , linux-doc@vger.kernel.org Date: Thu, 21 May 2020 14:42:56 -0700 In-Reply-To: <202005211301.4853672E2@keescook> References: <20200521165641.15940-1-kristen@linux.intel.com> <20200521165641.15940-8-kristen@linux.intel.com> <202005211301.4853672E2@keescook> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kees, Thanks for your review - I will incorporate what I can into v3, or explain why not once I give it a try :). On Thu, 2020-05-21 at 14:08 -0700, Kees Cook wrote: > > > On Thu, May 21, 2020 at 09:56:38AM -0700, Kristen Carlson Accardi > wrote: > > + /* > > + * sometimes we are updating a relative offset that would > > + * normally be relative to the next instruction (such as a > > call). > > + * In this case to calculate the target, you need to add 32bits > > to > > + * the pc to get the next instruction value. However, sometimes > > + * targets are just data that was stored in a table such as > > ksymtab > > + * or cpu alternatives. In this case our target is not relative > > to > > + * the next instruction. > > + */ > > Excellent and scary comment. ;) Was this found by trial and error? > That > sounds "fun" to debug. :P This did suck to debug. Thank goodness for debugging with gdb in a VM. As you know, I had previously had a patch to use a prand to be able to retain the same layout across boots, and that came in handy here. While we decided to not submit this functionality with this initial merge attempt, I will add it on in the future as it does make debugging much easier when you can reliably duplicate failure modes.