Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp554222pxa; Fri, 21 Aug 2020 14:23:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9H/Y7sxG2fK85FMEPZ+W8pAuxUcWe2g94rm2RKrtOYfUigSGXVEXoDkEVeKM4AO8QuWtG X-Received: by 2002:a17:906:af0c:: with SMTP id lx12mr4977726ejb.228.1598044997254; Fri, 21 Aug 2020 14:23:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598044997; cv=none; d=google.com; s=arc-20160816; b=kn17kma6Iri0+fbD/qJYFVswAoy1kE5xqYKzIh8LWgwHUrIJpLeumdjsNmX/kKYJUG DeZz4ffN668PzW9LJNTaZn/83AAVsqVjwDL26rRmBfjO6j/u0mrCw6LGfATVPROkIQXe rYvFQU+e1n6YVqW5zX/Ts7gLIlv5pH6FP74JmCBo5pyrJZH+FE7/kCW3W2fYouA1WqFe veaXTisS+TdoEgTfJ6ivtFFpl6EAswVwEeqFnWO/ZbqK8+Fju2VDcS7sd2L3V9ccXTwf 5QLxKil8ATLEK4lYHFt/prHXPRHSvPw0M+MhvYzrvtbukfcnjKTP9m4X4Eeg7Cexv9+k DJCQ== 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=7zxJLsKDKPmlEOdAqEaMs/th95WQoPa5KmWk+Z1DjV8=; b=d3m7+q/WSF+JBJEvyOamUi9VtghjkOEGZtck3u1eKE5S+2CYuvMIvWZ/INWmWK/7Ve Uz7dNJGSZi3iylHEiZ6HsVQR7YLyXOGyJ2LcZkXLMdCVzIu/u0vBJDnHfghGeGDGaXT/ hUabu+9mLlSfqEGhnzXCpV+SMD7+z2bK6yKD/753pSHB6P6mjrAuhfgfGyVlJ7gm0Sp7 n4i78etO0E97p6HDOVle7K1BGQQNvrEsseVjWthKCT2kkdWUSqKafQfjF/3uwOPzUij9 wHZyoNFyCkpWcD2KqvRy2Gk89Yvs2IIXh4cvbqMs9Klp8nrg6eNrI3ANFBp2+m1UgPwd 2BUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Z6d0JADM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mf10si1932987ejb.611.2020.08.21.14.22.53; Fri, 21 Aug 2020 14:23:17 -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=pass header.i=@chromium.org header.s=google header.b=Z6d0JADM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726457AbgHUVVo (ORCPT + 99 others); Fri, 21 Aug 2020 17:21:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726364AbgHUVVh (ORCPT ); Fri, 21 Aug 2020 17:21:37 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48D7AC061573 for ; Fri, 21 Aug 2020 14:21:37 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id u128so1677778pfb.6 for ; Fri, 21 Aug 2020 14:21:37 -0700 (PDT) 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=7zxJLsKDKPmlEOdAqEaMs/th95WQoPa5KmWk+Z1DjV8=; b=Z6d0JADM6ZgtFdmHVXm5tWDcsc0z+xRwVRI6J5P0qu7Wh8Wlh8hMqrvoVoPHscBSX5 BPn31oZ1h8KocB9ca3F8q5MQ2YsQ1iVfBeigGJPS6Yoy6p0Po4/KSMrywwADhAagcgS9 igh0vRz/eRmU7KOg9mT0Sb0Co7agth6mO4CkA= 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=7zxJLsKDKPmlEOdAqEaMs/th95WQoPa5KmWk+Z1DjV8=; b=Q2iHnjn5Bb8pJzcN/Iyb/jI9+l4uHrgaDWLfrUESDwOlsn1KtQh6IaEud8/ZuDl7y7 jXLICr7rVq6nxgecL8P4otkMEAahXvsONUwmn0wKempiD5THYSETjC7Tfu4n3ihMg54Y xGse0GdhdqrSknb7a7M+fAjF6cfABa8PI/Bv8ADGuPUBSaL5RaPgQAH/9/+X6+5+7Fre n/8HlM5X7jcSxy0LcQLtsoA+fdyP2RinAh65uSA+nZwIRYT5I4dpB5YT9FwKA5VoAasI lOz4vUxVmEHcjSccasF/Hyvmc3oJdP/gORfM0Miyd0D/gq5OYmUVfST1is4QJDwFYVp7 qcmg== X-Gm-Message-State: AOAM532ZWKaN9ob6ln6m+rB9eEftECVq0+Mg/Czc/ThmwHvLo7xbjCHI Y8t6+NtIoewoPpkkaFA3SPbvlA== X-Received: by 2002:a63:7550:: with SMTP id f16mr3613147pgn.118.1598044896892; Fri, 21 Aug 2020 14:21:36 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id m22sm2843446pja.36.2020.08.21.14.21.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2020 14:21:35 -0700 (PDT) Date: Fri, 21 Aug 2020 14:21:34 -0700 From: Kees Cook To: Arvind Sankar Cc: Ingo Molnar , Catalin Marinas , Mark Rutland , Ard Biesheuvel , Peter Collingbourne , James Morse , Borislav Petkov , Ingo Molnar , Russell King , Masahiro Yamada , 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: <202008211421.47347CA42@keescook> References: <20200821194310.3089815-1-keescook@chromium.org> <20200821194310.3089815-28-keescook@chromium.org> <20200821200159.GC1475504@rani.riverdale.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200821200159.GC1475504@rani.riverdale.lan> 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 04:01:59PM -0400, Arvind Sankar wrote: > 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_? i386 builds, IIRC. I can try to hunt that down if you want? -- Kees Cook