From patchwork Wed Feb 8 11:55:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 93640 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp2758673obz; Wed, 8 Feb 2017 06:31:17 -0800 (PST) X-Received: by 10.84.169.36 with SMTP id g33mr34087213plb.36.1486564277872; Wed, 08 Feb 2017 06:31:17 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j5si7182908pgh.413.2017.02.08.06.31.17; Wed, 08 Feb 2017 06:31:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753307AbdBHOa6 (ORCPT + 2 others); Wed, 8 Feb 2017 09:30:58 -0500 Received: from mail-wr0-f175.google.com ([209.85.128.175]:36128 "EHLO mail-wr0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753874AbdBHOaz (ORCPT ); Wed, 8 Feb 2017 09:30:55 -0500 Received: by mail-wr0-f175.google.com with SMTP id k90so61401430wrc.3 for ; Wed, 08 Feb 2017 06:30:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YGQ8pGFuCiQ1MOjA0xOzoU+jiIxrYtxdloFfQce6ROI=; b=hyoxiKrNgsH2/BeSIVzUnZ35kMynNE5SffzMgdvE1Idu+5utKvZ4V0Auq7PHv5yT7i dGVQHMTZOvnzi7k3b7xW9/xXMXPL+VguzKIy4ifULG3V6UGkordfJTXVQKWYzkSMHaLF gjyacRh6LWAf8Tx5f1q7mUHJA79tZgj1NW5TU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YGQ8pGFuCiQ1MOjA0xOzoU+jiIxrYtxdloFfQce6ROI=; b=NcaVO+67DNY6Mjf6FsaQGgr3iO1mUrDDiP4YfhDgFA3qNsHDuoEYELemeCzm8LPoOh 0MpDP8dI4Mq88W72cQ0fV+uqtCtWdDHMNtv/X27FgIm1iiK+ZghBdYWhytj1NzxR2q4Q KosmxUXVmJb47Tt/VvZoDgyZ1zub0ufQL1+q3RQA+AMSIGy/Fq5unbupQnO1RpQsqu63 nePFQhFoI/9a/UTC+ondt/ppTggq7K+Gjc+lr7yHU/adq2l/2won8UCGCE3DBDHCnJ3z wnX+NcOJP2RLXa31du/ATvpYWuT8QQArZA8iP5ExNpUK2hg63J6KeGa/LmOSn+UCBxM8 Rj7g== X-Gm-Message-State: AIkVDXJgRUVxxNqou2zHbcX3uq4/uilx3j7Dy+SkrEp4mrokB077itrGvhxlj7o2ZwR1yN7x X-Received: by 10.223.169.112 with SMTP id u103mr18389675wrc.166.1486554988732; Wed, 08 Feb 2017 03:56:28 -0800 (PST) Received: from localhost.localdomain ([160.169.163.122]) by smtp.gmail.com with ESMTPSA id 123sm2974815wml.6.2017.02.08.03.56.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Feb 2017 03:56:28 -0800 (PST) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com, leif.lindholm@linaro.org Cc: catalin.marinas@arm.com, linux@armlinux.org.uk, kernel-hardening@lists.openwall.com, labbott@fedoraproject.org, Ard Biesheuvel Subject: [PATCH v2 10/14] arm: efi: remove forbidden values from the PE/COFF header Date: Wed, 8 Feb 2017 11:55:43 +0000 Message-Id: <1486554947-3964-11-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1486554947-3964-1-git-send-email-ard.biesheuvel@linaro.org> References: <1486554947-3964-1-git-send-email-ard.biesheuvel@linaro.org> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org Bring the PE/COFF header in line with the PE/COFF spec, by setting NumberOfSymbols to 0, and removing the section alignment flags. Signed-off-by: Ard Biesheuvel --- arch/arm/boot/compressed/efi-header.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/boot/compressed/efi-header.S b/arch/arm/boot/compressed/efi-header.S index 1d26a9d0a9e8..50eff3bbc57c 100644 --- a/arch/arm/boot/compressed/efi-header.S +++ b/arch/arm/boot/compressed/efi-header.S @@ -43,7 +43,7 @@ coff_header: .short 2 @ nr_sections .long 0 @ TimeDateStamp .long 0 @ PointerToSymbolTable - .long 1 @ NumberOfSymbols + .long 0 @ NumberOfSymbols .short section_table - optional_header @ SizeOfOptionalHeader .short 0x306 @ Characteristics. @@ -109,7 +109,7 @@ section_table: .long 0 @ PointerToLineNumbers .short 0 @ NumberOfRelocations .short 0 @ NumberOfLineNumbers - .long 0x42100040 @ Characteristics + .long 0x42000040 @ Characteristics .ascii ".text\0\0\0" .long _end - __efi_start @ VirtualSize @@ -120,7 +120,7 @@ section_table: .long 0 @ PointerToLineNumbers .short 0 @ NumberOfRelocations .short 0 @ NumberOfLineNumbers - .long 0xe0500020 @ Characteristics + .long 0xe0000020 @ Characteristics .align 9 __efi_start: