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: 93625 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp2701334obz; Wed, 8 Feb 2017 04:21:25 -0800 (PST) X-Received: by 10.99.2.151 with SMTP id 145mr26552113pgc.5.1486556485053; Wed, 08 Feb 2017 04:21:25 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a19si6961019pgk.243.2017.02.08.04.21.24; Wed, 08 Feb 2017 04:21:25 -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 S1754109AbdBHMVY (ORCPT + 2 others); Wed, 8 Feb 2017 07:21:24 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:36777 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753903AbdBHMVI (ORCPT ); Wed, 8 Feb 2017 07:21:08 -0500 Received: by mail-wm0-f45.google.com with SMTP id c85so195033608wmi.1 for ; Wed, 08 Feb 2017 04:21:08 -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=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=MS9fVFCuzS1MvXolJFmiCzzbaDaG28t3drisTu4M3PinIwmzwGYDG6EGeQG08hpbJL xQ0kVxUuraHx1vT2TkTWK21woxceC5/aulyw9yDZuBX0Nwew1NoJRWMuGx9svxrURuMk 0uFWbBkIgDDwTWftU47Hcempfzx7S85jI1X5AqNsM3suiduA7EEy/FHafnIpg7/SpVVM 5VS6PdxTIYNQX5gGgN4b70Z8fLA6FO8JBsEkL6B0DMNC1uDLDp7+efwyo78k7pdE2DDn uCyhsa1UkBSZpszwdvllijAhczVbrH2A6QPM1vaQ86pcpAseSSn8Z1jbq1eHb+sbVT5u SfvQ== X-Gm-Message-State: AMke39lT29IKwGpD+90kbbO4scYduELXHR7Eh8DabmXayaA1HqI4/mhdmD4LHeHLzKhHsCjf X-Received: by 10.28.149.199 with SMTP id x190mr16753086wmd.91.1486554976084; Wed, 08 Feb 2017 03:56:16 -0800 (PST) Received: from localhost.localdomain ([160.169.163.122]) by smtp.gmail.com with ESMTPSA id 123sm2974815wml.6.2017.02.08.03.56.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Feb 2017 03:56:15 -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 05/14] arm64: efi: remove forbidden values from the PE/COFF header 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> 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/arm64/kernel/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 Acked-by: Mark Rutland 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 /*