Received: by 10.223.185.116 with SMTP id b49csp6602639wrg; Thu, 8 Mar 2018 10:03:32 -0800 (PST) X-Google-Smtp-Source: AG47ELu46PNLFshG4BIXfPX5SItjQj9rPmoJ6/TtSw0OInaVNOzedw0ddCrhchNJXSgid0/+YWUl X-Received: by 10.99.175.87 with SMTP id s23mr21801851pgo.328.1520532212437; Thu, 08 Mar 2018 10:03:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520532212; cv=none; d=google.com; s=arc-20160816; b=PQhe8aQpcfP697uku571j0PuN6alKWOey/LeIqLEvgP2uWjbPD+Jal6p/iv4e80QRx ISMWRv5JvIZh/SVsjJT4cXZzsXfhsAQyvp7t0KtY5fSCNyWLV7d3FnlM5GW+1k6Lpqmh URqyGs1pNua/AnDkQTPLU1kdgK8FKIc/vRSvQJu4FqzDD9notHnz584VlzJmFkkvx1SJ XN6MEWLssil2w1MgYTQLyu8MEtnrIptJuIhCcmO3j4kBxLGJ83rsH98ASe5uQaY7pOEh pC4+bMdKNBxw/1TMRkVJpZV1HxmUn2Q0b8HSSusNv5+whpsK3Tb9B3qCGEOZe9leWePM EqAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=HzNZmHlAJS4xyffy54smFOwKdTJGmqyJvNEYKpryCVk=; b=U89Nxs6riQUBphKbQyysUr7NjXtCHiyY6VpXrlHqVD2NoO1JQcGkZa1Gj/Tx1Hq2j5 bhZo2IrBy0gKJoch4EhMdjr+TBz+b+v3qo9B072nEpRUUSqJ5097DqObZsYJyh6F8Nsv WkK3pkRYhWOSv0yebmsW8Nyfgf73Uf1j1WM/A5jhILzXwAY4a7Zpwh1rAZ13pkSfA3X1 qE2WbVvlXp9PL4dCu3mGWE9IAhENAWnILxdIEibJjGodDWU+nIZhBUWHIK3+cKYjpsRL VoZeNOu4eE0uA518dm2Ms0AIlteLOFUwP9kiyKepPTkCVTpFEWn9mij0r1AU2/4sy0iJ EXOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Bd+/fc1M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l6si13309137pgq.562.2018.03.08.10.02.52; Thu, 08 Mar 2018 10:03:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Bd+/fc1M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936141AbeCHSAy (ORCPT + 99 others); Thu, 8 Mar 2018 13:00:54 -0500 Received: from mail-io0-f195.google.com ([209.85.223.195]:45312 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933700AbeCHSAw (ORCPT ); Thu, 8 Mar 2018 13:00:52 -0500 Received: by mail-io0-f195.google.com with SMTP id m22so581187iob.12 for ; Thu, 08 Mar 2018 10:00:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=HzNZmHlAJS4xyffy54smFOwKdTJGmqyJvNEYKpryCVk=; b=Bd+/fc1MT29kkJ70uaTTShTTaonL5urDwWF74nuXEmB/NeZhGvvzdWJX/tzgcdqEp/ dE16BlsD7RRlPw9nI3tEnVHAA/3k9nEcNul4uijXmpde8l7NRLr55en2TJ/3Md4nVApi W5hOThFjKxVA2ylfNbwsIg9kpQD9eAlSsSfl4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=HzNZmHlAJS4xyffy54smFOwKdTJGmqyJvNEYKpryCVk=; b=llIDPSri9ZD9OjhVxbQqU+LJI37y+SKNykucqjI+R4ZwKUADBEcfLJMY5wF0jeZ/mK ivtcc2yKDM8ofLsI61H6yGKb5lo7GRWpDJrvlN8KXfAKPflkbeXuCAzwb4XoBc7xRuPf Al6kvQ62Qp7LtkLrCZFO/WnwRdUVayLiXFXo3eHrzzNCDMbOAQjQK/F00E0GAsZ5leUY l6M96H8oSA84dQ4kL7nLiec2si4sXmxA+4iJ4PdXVWZnnmCDG7juP41dEBdGVGeWJHpg vcoj56gPju4OGjRydwGzh5BIwVlVNQ7O/Wrd6hytFT3CzR3d5VTyunltzQnl8T6z5Trr FmEw== X-Gm-Message-State: APf1xPAAlYsCKjjMZ+GzfTALm15v6bg5qCKiSKZ8bnT2bgHgthpyqVD8 t1KNvTwm6i/93RvENaDEwHtBI+AAFxH9kiw86DRSzQ== X-Received: by 10.107.41.16 with SMTP id p16mr32264463iop.173.1520532051618; Thu, 08 Mar 2018 10:00:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.138.209 with HTTP; Thu, 8 Mar 2018 10:00:50 -0800 (PST) In-Reply-To: References: <1519414953-5478-1-git-send-email-tbaicar@codeaurora.org> <1519414953-5478-2-git-send-email-tbaicar@codeaurora.org> <20180224072054.GA3264@dhcp-128-65.nay.redhat.com> From: Ard Biesheuvel Date: Thu, 8 Mar 2018 18:00:50 +0000 Message-ID: Subject: Re: [PATCH 1/2] efi/esrt: fix unsupported version initialization failure To: Tyler Baicar Cc: Dave Young , linux-efi@vger.kernel.org, Linux Kernel Mailing List , Jeff Hugo , Sameer Goel , AKASHI Takahiro , Timur Tabi Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8 March 2018 at 16:11, Tyler Baicar wrote: > On 2/24/2018 2:20 AM, Dave Young wrote: >> >> On 02/23/18 at 12:42pm, Tyler Baicar wrote: >>> >>> If ESRT initialization fails due to an unsupported version, the >>> early_memremap allocation is never unmapped. This will cause an >>> early ioremap leak. So, make sure to unmap the memory allocation >>> before returning from efi_esrt_init(). >>> >>> Signed-off-by: Tyler Baicar >>> --- >>> drivers/firmware/efi/esrt.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/firmware/efi/esrt.c b/drivers/firmware/efi/esrt.c >>> index c47e0c6..504f3c3 100644 >>> --- a/drivers/firmware/efi/esrt.c >>> +++ b/drivers/firmware/efi/esrt.c >>> @@ -285,7 +285,7 @@ void __init efi_esrt_init(void) >>> } else { >>> pr_err("Unsupported ESRT version %lld.\n", >>> tmpesrt.fw_resource_version); >>> - return; >>> + goto err_memunmap; >>> } >>> if (tmpesrt.fw_resource_count > 0 && max - size < entry_size) { >>> -- >> >> Reviewed-by: Dave Young > > Thank you Dave for your review here and input on the other patch. > > Ard, > > Can this patch be picked up? I understand patch 2 is not acceptable, but > this one should > be good to go I think. > Yeah you're right. I'll pick it up as a bugfix.