From patchwork Wed Feb 8 11:55:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 9562349 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 375BA6047A for ; Wed, 8 Feb 2017 11:56:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 29B63284C9 for ; Wed, 8 Feb 2017 11:56:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E1ED284CF; Wed, 8 Feb 2017 11:56:55 +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 24C3E284C9 for ; Wed, 8 Feb 2017 11:56:53 +0000 (UTC) Received: (qmail 9705 invoked by uid 550); 8 Feb 2017 11:56:30 -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 9437 invoked from network); 8 Feb 2017 11:56:27 -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=3C0zk52+iNOJeJWj1xjjbSjNickSISnKR1I2EtOLjpY=; b=RumH88hEhNusA6mNEZEzXspqLHeC6CphcxOBcoJDpMXbsA0CjeWQO0u+K8/0vqp5is uzbqh5U4pHD529mGgysvY5JF835QwxWCkHQKbzGCKssfRemgLFd0VD+UfQLirw5O1/S2 60mi4z4kB036ecyhGkDox7s9ZexgtkYgH9GoI= 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=3C0zk52+iNOJeJWj1xjjbSjNickSISnKR1I2EtOLjpY=; b=llom1tTRc3TMPuSz4+Fuk2hZyfgKvax8cTzr32Yp58oKPJaGOdA7nXRJnBt2vTxo0V 9HF2dsu41kbv83dXoEixTUAD5REHlc4+kqmDxnENMrYbcl7rpyVU7gFmbDsgHipo27uU Jmn9cjhKUngBG3O3ruHKB+wDVCS/5Bb82J33dKAOVX45LojB5SJOWny6IcPimShipTbQ M2xKhu8+AGL8iYBoQ88XTtCMCxBvRdvV9v0zr6aGkjQ9X5OM5+ZMGL2FOnEwuZE6K+uJ dsWJV41oLNeAMNTfZ3ZJ4wp+mBYkLv0EWJMI7IaajuIv25ui/OdNncNf+nCcsKWhOGDC ixkw== X-Gm-Message-State: AMke39lMu7HkTUL4v/Czqk7Ax2QaPRl28HzWFHJxDC2lql31nNZS03JCEJ0T7FPNDPfcGZMt X-Received: by 10.28.149.199 with SMTP id x190mr16753086wmd.91.1486554976084; Wed, 08 Feb 2017 03:56:16 -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:38 +0000 Message-Id: <1486554947-3964-6-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 05/14] arm64: 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 Acked-by: Mark Rutland --- arch/arm64/kernel/efi-header.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/efi-header.S b/arch/arm64/kernel/efi-header.S index 9b24ce130afb..515624bbfcd0 100644 --- a/arch/arm64/kernel/efi-header.S +++ b/arch/arm64/kernel/efi-header.S @@ -15,7 +15,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 0x206 // Characteristics. // IMAGE_FILE_DEBUG_STRIPPED | @@ -88,7 +88,7 @@ section_table: .long 0 // PointerToLineNumbers .short 0 // NumberOfRelocations .short 0 // NumberOfLineNumbers - .long 0x42100040 // Characteristics (section flags) + .long 0x42000040 // Characteristics (section flags) .ascii ".text" @@ -104,7 +104,7 @@ section_table: .long 0 // PointerToLineNumbers .short 0 // NumberOfRelocations .short 0 // NumberOfLineNumbers - .long 0xe0500020 // Characteristics + .long 0xe0000020 // Characteristics #ifdef CONFIG_DEBUG_EFI /*