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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8920AC433EF for ; Thu, 14 Oct 2021 00:29:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6C900611B0 for ; Thu, 14 Oct 2021 00:29:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229730AbhJNAbw (ORCPT ); Wed, 13 Oct 2021 20:31:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:37456 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229660AbhJNAbw (ORCPT ); Wed, 13 Oct 2021 20:31:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634171387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5NbKviyVjAGHpJsTY9YMRcseM4r7JqRNYBE2w/RGvYI=; b=bnIgPwr+EfQzmKZaxZ1DKo86Cnt5OSaDnXKFhCcm2xoXbHFIg2BFDpVJheu0RLzK4M812A fiRWNqs71L4k/uAkgeZz8umWPoTSHujCi1EtRMaEhHnA6iMzwU+3sN8i3wj87uXb7/2fLK ACTOKgNY3BZ1GEv/TyeobUlRvrJMTew= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-497-VUPg6xpnPeWsrtbrKPL7xw-1; Wed, 13 Oct 2021 20:29:46 -0400 X-MC-Unique: VUPg6xpnPeWsrtbrKPL7xw-1 Received: by mail-qt1-f200.google.com with SMTP id z10-20020ac83e0a000000b002a732692afaso3389572qtf.2 for ; Wed, 13 Oct 2021 17:29:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=5NbKviyVjAGHpJsTY9YMRcseM4r7JqRNYBE2w/RGvYI=; b=Ht2/hZ3qrkuTC3mAX2Am76UVzMOUgAJ7hIqLf7mbFujTKzVgW8ITGffrAKuWx9DFBC FIvGWIeMvPxWl8WohL26zYwCVQP70kwvPQntt/njgig4SLMpsFfZMjYI5dvP/+R+yl7S PzgFqK6Vez6KSwftO1DQhfpuQWAVZYQMyYRU1MZL+C1N6ZyFHcflG7HrMFuzj9eKraIs eCEZ9djeLg4TBTsWwMseFQwhbOj3nFq20fuOljbGQ3saGSFJQE5lF5m7BIyQliIPhZTd zVMqTG00RcOGdH4eKm15KZ59zjRYhQ0PzfP+mUbeUeclp6zL5YEoZ+c/K0WTzjz/0x7y RJ9Q== X-Gm-Message-State: AOAM530nUd7P3DDZ7nNPiHbYGbB/A4ImL0pywFVV47OCrbLNdvZaXKRC ykRr89UzSn58c59TdrOohZpzIl+cWjSJTasI7HsZpRuCoMkeHBAAfHgVUCN8yO/szzlN7J4AddA y/5czw118Jd4YG59j5fXyZkjJE5gF X-Received: by 2002:a05:622a:4d2:: with SMTP id q18mr3028915qtx.84.1634171386053; Wed, 13 Oct 2021 17:29:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVACw6Q+Bf+KRmLJVeXEJvTVKunw0eo0+N1Y08lNYbQoCAUE2k8n1Z/txG89ZKqIF/2iP2xg== X-Received: by 2002:a05:622a:4d2:: with SMTP id q18mr3028899qtx.84.1634171385863; Wed, 13 Oct 2021 17:29:45 -0700 (PDT) Received: from treble ([2600:1700:6e32:6c00::15]) by smtp.gmail.com with ESMTPSA id w17sm720171qts.53.2021.10.13.17.29.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 17:29:45 -0700 (PDT) Date: Wed, 13 Oct 2021 17:29:41 -0700 From: Josh Poimboeuf To: Kees Cook Cc: Borislav Petkov , Kristen Carlson Accardi , Tony Luck , Alexander Lobakin , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Arnd Bergmann , Joerg Roedel , Arvind Sankar , Jing Yangyang , Abaci Robot , Jiapeng Chong , Nathan Chancellor , Nick Desaulniers , Vincenzo Frascino , Andrey Konovalov , Miroslav Benes , "H. Nikolaus Schaller" , Fangrui Song , linux-kernel@vger.kernel.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH 4/4] vmlinux.lds.h: Have ORC lookup cover entire _etext - _stext Message-ID: <20211014002941.3ywwcfhf53bpw5xp@treble> References: <20211013175742.1197608-1-keescook@chromium.org> <20211013175742.1197608-5-keescook@chromium.org> MIME-Version: 1.0 In-Reply-To: <20211013175742.1197608-5-keescook@chromium.org> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jpoimboe@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-hardening@vger.kernel.org On Wed, Oct 13, 2021 at 10:57:42AM -0700, Kees Cook wrote: > From: Kristen Carlson Accardi > > When using -ffunction-sections to place each function in its own text > section (so it can be randomized at load time in the future FGKASLR > series), the linker will place most of the functions into separate .text.* > sections. SIZEOF(.text) won't work here for calculating the ORC lookup > table size, so the total text size must be calculated to include .text > AND all .text.* sections. > > Signed-off-by: Kristen Carlson Accardi > Reviewed-by: Tony Luck > Tested-by: Tony Luck > Reviewed-by: Kees Cook > [ alobakin: move it to vmlinux.lds.h and make arch-indep ] > Signed-off-by: Alexander Lobakin > Signed-off-by: Kees Cook Acked-by: Josh Poimboeuf -- Josh