Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp510396pxa; Fri, 21 Aug 2020 13:05:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyM04+fqLPZRFe0sTg4ZG/J4Tdz+OhLSGeZLHFXbttuodUx7wOovrvh7Gw9sprXMccStYBA X-Received: by 2002:a50:bae6:: with SMTP id x93mr4486252ede.79.1598040302513; Fri, 21 Aug 2020 13:05:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598040302; cv=none; d=google.com; s=arc-20160816; b=sWh/pYFYAuRce/yAwdQVj7wS8genqPap2uAL233rR/cd3J1nHm5EuU8HgC+E3VV4Xm ihkvxzG7MfXtqyEiUAcvAhvu8jDJEVes9d2bYpDPGHy2/Pv+L2Qy05CtglVUG0sZFokq ixgAA7jJEb7xeV0CihsPzDMpLtj/bKkC3k4enr/4Y0WD2f5u8XXW/QltKDEmAgWnk60j VPLzFOntvE71JTD5LH22PxV4VG5NCbFYyIhnX6/xfVB2H0AMH6/XLP0ItTmiLfLqO4hC hpW3fDJIhikgDiwnJFvmsDKDmxIrBmZBA2U9CtIB9PFBHGI94yeTQ+3w9AMjaa8/BRhK OTQA== 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:date:from :dkim-signature; bh=TPOt76AEuXIQt1E+8hC9FNGB9En2HYeoQvtbHdl/m1g=; b=Mzq8ku4ZCMlNjInXverR0Psuus+Jzj/1AYXbsrr3vQemYV2Um6DYpvrFpXqJdKF8VF f/Tuz/rdh2EjMmhkYHA4+K/nc2/rENtMUG81TlHw4dJJh9sW6sV1PJHkg1iq74E7k+uu zPv9NdJYP6EiM9qgIrzbriZ+fIVdL+mrrxkqx9zb6TOJx2j69LjGmHGSOsN8G6VOlHjl GQwV3CeQOeCnXBMqsqYpcvhvIkEhAWymsJt5n72arm4AWo+TigB29k+KXU5HK73zEIkZ 1MJthoz+vPvZ/iHZ9ksckNtnhZRr8QrCR8sOVCwuFtjvH2WwjnMhgfBSs9NBuS1PSH/k cVig== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=cFHRVbfk; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si1771187edb.557.2020.08.21.13.04.38; Fri, 21 Aug 2020 13:05:02 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=cFHRVbfk; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726337AbgHUUCE (ORCPT + 99 others); Fri, 21 Aug 2020 16:02:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725831AbgHUUCD (ORCPT ); Fri, 21 Aug 2020 16:02:03 -0400 Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24C65C061573; Fri, 21 Aug 2020 13:02:03 -0700 (PDT) Received: by mail-qk1-x741.google.com with SMTP id d14so2429369qke.13; Fri, 21 Aug 2020 13:02:03 -0700 (PDT) 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; bh=TPOt76AEuXIQt1E+8hC9FNGB9En2HYeoQvtbHdl/m1g=; b=cFHRVbfk774qVr9x3mqS5vqcqh4uuZR3AktkRKIYSbrK/h6eTE8iTn3Eszc8EU5VU4 H2gBX0hwAajvgJkpnxJzEPZCh94gbkzOVt+ZveLrWKElY7x28RT/g51x+SukMSCeeINg HZvWl4elaNCaYwDed/Z0Vi4QHqie2XI2XiXN35MWwFN1l394xqNEFKcchxE11pXAGn9m nJ6X4fA4xIO+NOhv34wJ10ixswyFiVLdeml9cwaPWhfYsQ4zWLHmdRMhrsC5B1zdAvSO vvdZ6jLj7HQCdxyGI4xYcdJwoIdN9f91NDDlkyL/QXjpshXpCtguxWzEgk1JvLMc5BiP NorA== 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; bh=TPOt76AEuXIQt1E+8hC9FNGB9En2HYeoQvtbHdl/m1g=; b=By/lg7wN0OPsZXKYDQkjjrjmYT/iOeI9SGd1IRUCc/q8bLWoOnebWKVhwk1c0v37CW IQqOVVFfWKqIAHLR6e7Vmz0j/0YtNxhABERvj9wgGanjN9iY+3d+dD0K3o15+NNtGCGG dlNUXfBTNvywDdEEH9ixDCb5dsodGbJ9AwjFUX4r08DdxQ8ytjCp0QEF+1ZxipXP8nov ItAmriXlgyfTMIp7uIIX5wM4rVWzEEC1kB9rGgsMi5Vfx6KyaIhGlJxPdj1OIDKIU/RV JmlXWSULUl03o19ZD95UD3z+iG1efWZ5hcLmQfgHrvRTLPQLolAWxJDC0yaKpBBeGDeA w9aA== X-Gm-Message-State: AOAM531xjAa6vgCassh5ItihqKL1Ss+1CPpz3k4pZ6p2+L40USghsSBP ONnCNlYpGRYYu2kWm1Pr8o0= X-Received: by 2002:a05:620a:201a:: with SMTP id c26mr4160170qka.155.1598040121471; Fri, 21 Aug 2020 13:02:01 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id c142sm2528839qkg.71.2020.08.21.13.02.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2020 13:02:01 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Fri, 21 Aug 2020 16:01:59 -0400 To: Kees Cook Cc: Ingo Molnar , Catalin Marinas , Mark Rutland , Ard Biesheuvel , Peter Collingbourne , James Morse , Borislav Petkov , Ingo Molnar , Russell King , Masahiro Yamada , Arvind Sankar , Nick Desaulniers , Nathan Chancellor , Arnd Bergmann , x86@kernel.org, clang-built-linux@googlegroups.com, linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 27/29] x86/boot/compressed: Remove, discard, or assert for unwanted sections Message-ID: <20200821200159.GC1475504@rani.riverdale.lan> References: <20200821194310.3089815-1-keescook@chromium.org> <20200821194310.3089815-28-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200821194310.3089815-28-keescook@chromium.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 21, 2020 at 12:43:08PM -0700, Kees Cook wrote: > In preparation for warning on orphan sections, stop the linker from > generating the .eh_frame* sections, discard unwanted non-zero-sized > generated sections, and enforce other expected-to-be-zero-sized sections > (since discarding them might hide problems with them suddenly gaining > unexpected entries). > > Signed-off-by: Kees Cook > .rel.dyn : { > - *(.rel.*) > + *(.rel.*) *(.rel_*) > } > ASSERT(SIZEOF(.rel.dyn) == 0, "Unexpected run-time relocations (.rel) detected!") > > .rela.dyn : { > - *(.rela.*) > + *(.rela.*) *(.rela_*) > } > ASSERT(SIZEOF(.rela.dyn) == 0, "Unexpected run-time relocations (.rela) detected!") > } > -- > 2.25.1 > When do you get .rela_?