Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1482643ybv; Thu, 6 Feb 2020 05:00:06 -0800 (PST) X-Google-Smtp-Source: APXvYqxg/VwnOYhIVuqpaCwzEQ2/TiOEPTz1pMOzX+NjcP5gz2oEOuYOJs3hEOsx/DaqV/Vhfhae X-Received: by 2002:aca:ebc3:: with SMTP id j186mr6622359oih.15.1580994005846; Thu, 06 Feb 2020 05:00:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580994005; cv=none; d=google.com; s=arc-20160816; b=fNfN0kVD1J9lWMG6cnX8sc5yMjMd6WYBKymwIhP0KRgVxyw0rMidBLuHrJMCxi191H UH+rBvNn/HiNPFRGtiY34zGx3FzLZfFQAkPeHmjgTGzMbw4aWdo27g8rnop+R0NbpmnY V8iRyNXPPdHnSMR8Tf2FAyq+DCyfFSCCjwSCiOhJMqkWVaveMxBvuSF01zuMU6l4qlyJ G6hCxev21XbiU57AtJX7SmWJKjo07Ax0Pwymgf+orlQCH7n7gx6jGQiOLzi5gL03lHhu zalhl97BJsfVdeziUW5S5qnHSo0ILbDKClF0ISkLzEKojjrcfO2R57EZrhvPPrGOpwJa PxZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=6fXR/mbSdG/GuSMMWg/QMGok/jnDT6wVXIjTyBjsSus=; b=qAvDfS9/9FNJPnaiw3qXp5DHNk9Fpjgzavqmf4neUUzo3ws3L6PN/1cPQFPC2osyOM CihrMrrouIlSKA13/pjstyJ4KHqh78EjyR07sIlP0tBa4rZfDhGvkr26xzYRGv3qg36w OhX+Xd2MiQKkoQJz3a+r46yvYY9pjQsjTJUQTbcS8QxG2aKEQUSA0AVCrmr6VVIBxw5c RG7qGEFhx/1LVscgwXas0j06lY+QAplR82ERMhMfzUlwzRxSuyXTHMLjuZDLEAF2OW8/ GY7O/6m7Smfby6grybNROjro0crl9zhPwe+/IVmoheqqO00DzoyR5Vmsn0J991JvyTTR u47Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YDPSl97I; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b10si1710865otp.124.2020.02.06.04.59.53; Thu, 06 Feb 2020 05:00:05 -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=pass header.i=@chromium.org header.s=google header.b=YDPSl97I; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727717AbgBFMhm (ORCPT + 99 others); Thu, 6 Feb 2020 07:37:42 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:41610 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727577AbgBFMhm (ORCPT ); Thu, 6 Feb 2020 07:37:42 -0500 Received: by mail-ot1-f65.google.com with SMTP id r27so5297402otc.8 for ; Thu, 06 Feb 2020 04:37:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=6fXR/mbSdG/GuSMMWg/QMGok/jnDT6wVXIjTyBjsSus=; b=YDPSl97I6ie5WoTko+sLjNuIbuKRJ0lnQHSRwMr5Y6HtI9GRn2CyTqHW9t0F/mCZTb PrqWx1eIhx1UOYMGHk1pWUX0UhRN1FQd6pUSajEMJoSkwJGyfF4hMsofqz5ytpoefHyN DN8hb4Rw0W7U6VO5nOyU0MyBMSfHWGyFgvovg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6fXR/mbSdG/GuSMMWg/QMGok/jnDT6wVXIjTyBjsSus=; b=LiZER6tppcrbFOzQtSP95IWHmIrhpRiXq1vmsXs8ZqI+M2RaNR+XlP+IbxnEltnMs2 vyCoecaJFB7bAM3ZhZrrkufEMgKuQbSkbazgOvEw9JNnME3Fh+aY3wel8Ma7M4ihR8F1 xp7XbvzY2RrgGwDC37VhAu+ppugW274lcg4jdj1SoVntUO6I552upu0L1GWUrK5tcrhh rYkbgH2VxPyLUGc/Ej4D1qrwuS0SyzxdfNT9miju6Kv9r/1lvhIiP9hxkiBp0KRlG6fy kTz9547KhECSoNMFK7es2CU2E+eRus3KS+NxkXNxhUqfD1qdaSWNmGIxenvxX162i5Ld tEhw== X-Gm-Message-State: APjAAAUPOocJaaSiekQUXKK1HSvYFShwuz2yzhQqyWwo189Rj0Or8777 D20ljzGlFYL5vb29f3oavhfekNhqiWQ= X-Received: by 2002:a9d:1928:: with SMTP id j40mr30813778ota.68.1580992661363; Thu, 06 Feb 2020 04:37:41 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id a14sm1061768otr.54.2020.02.06.04.37.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2020 04:37:40 -0800 (PST) Date: Thu, 6 Feb 2020 04:37:39 -0800 From: Kees Cook To: Kristen Carlson Accardi Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, arjan@linux.intel.com, rick.p.edgecombe@intel.com, x86@kernel.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com Subject: Re: [RFC PATCH 07/11] x86/tools: Adding relative relocs for randomized functions Message-ID: <202002060435.CF7BFB723@keescook> References: <20200205223950.1212394-1-kristen@linux.intel.com> <20200205223950.1212394-8-kristen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200205223950.1212394-8-kristen@linux.intel.com> 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:46PM -0800, Kristen Carlson Accardi wrote: > If we are randomizing function sections, we are going to need > to recalculate relative offsets for relocs that are either in > the randomized sections, or refer to the randomized sections. > Add code to detect whether a reloc satisifies these cases, and if > so, add them to the appropriate reloc list. > > Signed-off-by: Kristen Carlson Accardi Looks good to me. :) Reviewed-by: Kees Cook -Kees -- Kees Cook