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: 9562359 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2DB4F6047A for ; Wed, 8 Feb 2017 11:57:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20CA4284C9 for ; Wed, 8 Feb 2017 11:57:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 158D0284CF; Wed, 8 Feb 2017 11:57:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 557F9284C9 for ; Wed, 8 Feb 2017 11:57:32 +0000 (UTC) Received: (qmail 11764 invoked by uid 550); 8 Feb 2017 11:56:46 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 11538 invoked from network); 8 Feb 2017 11:56:40 -0000 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=I17FGtdR+ez/6UQ0OjG8N9MUa0PtYfStn/bJhAerSwqq3loGQdU3Vw64PWOxKGRQ2J SsCW5FwPnNMOrpLk2i7LLCW0wkKTb0Q3aoUMrdFzxgae+/u25xgH+N/6KNt6QiSJ4uZa wdXMoYs7zw9dKFQ0FSWFISf050bXlccss3SpN9dLZ8YNxL6eSj7oz1KLbc4UF0Mml1hp WZesHinn3XuaCbc3m2lBvEEw5B1+q9rGrge7sukYXgwmC/23IV4BsyjhbtFRnN6SsAy5 +TI1U9qKojf4BHs6Y9idE/VVycEtVBkp6Y+q443uZb1T1yHH6C+RMzVUJkDb4iaq2wQV 76Og== X-Gm-Message-State: AIkVDXJplYUs48QFaxHaT7lL97R+qa+pJF3zbzZK9wNUpBtNhofo/05PYhl3TS8CtKNCJSlY X-Received: by 10.223.169.112 with SMTP id u103mr18389675wrc.166.1486554988732; 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 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> Subject: [kernel-hardening] [PATCH v2 10/14] arm: efi: remove forbidden values from the PE/COFF header X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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: