From patchwork Mon Jun 12 14:53:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 103642 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp235092qgd; Mon, 12 Jun 2017 08:01:24 -0700 (PDT) X-Received: by 10.55.88.194 with SMTP id m185mr68383203qkb.230.1497279684862; Mon, 12 Jun 2017 08:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497279684; cv=none; d=google.com; s=arc-20160816; b=w42WVGktzjJVdbPiO9wouTHwKJFANi5fBpS9Tw2Pi8VGNSFQxyfQzSW+qe0B8zqXwO pgkVsXuB5LatMijf7XuE5NBt1qYEESJU5riZveEjZGYL9hk9pSUGvvEpAHJ68IcfrwlO uuf41qgCTdu1KWIewPx0eevhcH7v6b8OR6GCfMWcR0LzG/+qjlXSSdahdp7NlujpHVbJ 5jwskG07pgwwIjMt/lumRuejehuWE7DBRj1fIph7kxKKC+M1t32G8aNb+NVFjGKbkrzO 6lfDr1fOBeHbye9AzvWYTfUbXiuJ8QH92ty5nvsa/fAblnR0wMFh+LooDtl2UiFfBrQr 8URA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:arc-authentication-results; bh=KsGghTS49iDVpanbD2gDDvEt7MlfdUV/DHg8AFdqbkw=; b=kxWKusORxW1V7+clxWgqgvhTLe/Sz77lsofCR0RbJZmgMvYh5KAh6/KQmevhNcOd05 njSDELedAmT6sybroCaFmPD/HKIKugQQiAmnzrULAE4ASOOmtao0s89MuX3PJ/uFSLo/ suRG1l7y8/303xKQ3Bw1rFF1QKh7Sb0JI9VjPDvQKzZyR7yJuLCWkIVH3XpllhDoCODQ pTypBCUQEDlvSrnGF0yGkVFHKItTW4TB17rPmrMOyIKTVAuImoTcNsOhhALGP4Fx5hbD lzMJLWohQKzrwyodmX3eWcv4++0MzT0PwSuqfmoly16YS3iuCHynkvEnUWsrS1O1FJeJ fukA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=grub-devel-bounces+patch=linaro.org@gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id o32si4154533qko.165.2017.06.12.08.01.24 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 12 Jun 2017 08:01:24 -0700 (PDT) Received-SPF: pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=grub-devel-bounces+patch=linaro.org@gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38546 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKQqI-00053B-G4 for patch@linaro.org; Mon, 12 Jun 2017 11:01:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKQl2-0000yZ-NT for grub-devel@gnu.org; Mon, 12 Jun 2017 10:55:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dKQl2-0000wU-0h for grub-devel@gnu.org; Mon, 12 Jun 2017 10:55:56 -0400 Received: from mail-wr0-x231.google.com ([2a00:1450:400c:c0c::231]:34117) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dKQl1-0000w8-Kt for grub-devel@gnu.org; Mon, 12 Jun 2017 10:55:55 -0400 Received: by mail-wr0-x231.google.com with SMTP id g76so98960973wrd.1 for ; Mon, 12 Jun 2017 07:55:55 -0700 (PDT) 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=k40hvaiiAPb9KtxKtSUVxyRM1mHccocC4rK6H4oUbnw=; b=Be0pDOLWyxaDJhqikeByrZN/OiS/thFX8N8ujt4R9hOq/CERnPzk3e4wK3YPV3/aJV Hr5yOZDAbBXLdBhZZ1LO6NvNHF8MQ/ALQn8uvkgP2hJAaFgfJtghZqhFVbo0ERyNTI7n iNwlzb94dlzFXCNDD2LZhMMGFZ8beZT0knC+I= 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=k40hvaiiAPb9KtxKtSUVxyRM1mHccocC4rK6H4oUbnw=; b=b0paLnROPUbyPl2QfAiMlFCGLB6oF1A5oWmbH9lULF/MGx1GFD4myFh8lnx7O/XafX TZFUViFsJZDmKuL9DPRQ6cKkExS44OrXg4PpZLeYIseIMEQF71/eOiyZvg3p10Oa9rpM spFX9y4EnSwl216UXQWWJWWKkinoKsBBHVjFiYOBS434/sRNVH18977rHUhSuguj36wF Fc32KKOmBnrTppfwOPjazVSaEXae/WJAeWCVMTBekcaa/6o6OQsyvb2PCBWvFue8ipd0 ler0FUBjB+QuXeselrs6D/Fd11Vu8mKH+yTRswHrnkYqGOgtvi2MOQD413z2Ke7KVTNg oilQ== X-Gm-Message-State: AODbwcAhsF0gJFlrx0WeE/hdnxA9+YjJzZacK5mB6U8Py1SNooLytmMA yOhWtIoOrzetJs8GyZfIbw== X-Received: by 10.223.162.156 with SMTP id s28mr8613653wra.97.1497279350197; Mon, 12 Jun 2017 07:55:50 -0700 (PDT) Received: from mohikan.hemma.eciton.net (cpc92316-cmbg19-2-0-cust118.5-4.cable.virginm.net. [82.12.0.119]) by smtp.gmail.com with ESMTPSA id s140sm7722wmd.1.2017.06.12.07.55.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jun 2017 07:55:49 -0700 (PDT) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH 7/7] efi: change heap allocation type to GRUB_EFI_LOADER_CODE Date: Mon, 12 Jun 2017 15:53:41 +0100 Message-Id: <20170612145341.3351-8-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170612145341.3351-1-leif.lindholm@linaro.org> References: <20170612145341.3351-1-leif.lindholm@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::231 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The development of GNU GRUB Cc: ard.biesheuvel@linaro.org, lersek@redhat.com, agraf@suse.de, kraxel@redhat.com MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" With upcoming changes to EDK2, allocations of type EFI_LOADER_DATA may not return regions with execute ability. Since modules are loaded onto the heap, change the heap allocation type to GRUB_EFI_LOADER_CODE in order to permit execution on systems with this feature enabled. Closes: 50420 Signed-off-by: Leif Lindholm --- grub-core/kern/efi/mm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.11.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c index 7b1763bc5..f27a48e68 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c @@ -404,7 +404,9 @@ add_memory_regions (grub_efi_memory_descriptor_t *memory_map, pages = required_pages; } - addr = grub_efi_allocate_pages (start, pages); + addr = grub_efi_allocate_pages_real (start, pages, + GRUB_EFI_ALLOCATE_ADDRESS, + GRUB_EFI_LOADER_CODE); if (! addr) grub_fatal ("cannot allocate conventional memory %p with %u pages", (void *) ((grub_addr_t) start),