Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1453783ybi; Sat, 25 May 2019 02:20:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTa4uHfuKm/E+YzTxq6z3v8xCFe+Aad7H03wEPlJjGvTQy4sVuFmcOyjt6ZG7RuyXzFyUc X-Received: by 2002:a17:90a:8d86:: with SMTP id d6mr14402113pjo.127.1558776018786; Sat, 25 May 2019 02:20:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558776018; cv=none; d=google.com; s=arc-20160816; b=U9qrn3B/5G+cAuDVWjaJYura9rzCL4lc6Jw0WN90/4db1fQeWz9UKiGWItHujzvGrg txwQ91EFNF7yYSt7NmwcdhDpKVwUxNjZNZI0u53dxrfa6KslQPs5EzdS+RqnhXJlRZV/ 7ElK4Myjtoe0VmjniL4hL2otIw3qNWfTfg+KliOsf3CHeQrXpid8xfZrnfkm2YpUN8ie BX2PVO8AR6K5gdd5wORrQC9CKXS+RVvXzgqlQUvPSueRS5Cd6zqQr9/KZCgLVXIxFie0 B4hudZ3FPLTRMPUkFiiytCmQC2H0F7gWy/KPqWvfWWDZKEkrTJg/eVG/Cjj1O37wVTxN QfYQ== 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 :in-reply-to:references:mime-version:dkim-signature; bh=XET7OF75wNiBS0S9YBCqjrCeD8nZnzrXhbrqUvMdrP8=; b=zZ5aUfoMyI/RaIcwLey33rST4NDiHrqxHD6WG+1hAqL162UBkH9n/39Di5PF5v40Gm JF45XyWYcQgVvmO5SyXnF5sC3QvQr1BC71XgEEXwKSJtItVW1NdpXRDCSw+lDuhSSF7P EE0gr8bM9/a5WjEvwnDa44NYg3eX6CLsRccxD4776+v/ssPO6qI8xtFwYKA+pPSoLTEf eKEJCBMAC2xNei1HX4CWnWmLm7YjK923eLC0kuAzApEWX3dHJxj/YaJSm5BpCQPCZWwr ZwI8N9TI6oOokth89pSjP0yUqx2RDif9psufAOxviZQhHrAOlvqHiS/aHozSo6b/056I j62A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ceHJWOcl; 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 q14si6913856pls.327.2019.05.25.02.20.03; Sat, 25 May 2019 02:20:18 -0700 (PDT) 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=ceHJWOcl; 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 S1726712AbfEYJSu (ORCPT + 99 others); Sat, 25 May 2019 05:18:50 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:35832 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726453AbfEYJSt (ORCPT ); Sat, 25 May 2019 05:18:49 -0400 Received: by mail-it1-f193.google.com with SMTP id u186so17314239ith.0 for ; Sat, 25 May 2019 02:18:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XET7OF75wNiBS0S9YBCqjrCeD8nZnzrXhbrqUvMdrP8=; b=ceHJWOclYeyDuJd7Q+aBCyW8OCwNFP8/2cWymfgFMO3AHiV4OddjDn8yfqX+xarEuT QDG0HGrexSN7InLbYaWJc2k4H5kadELuPS8oT/40UksxXj9l1VNDDQqVXZ5jR9AaTaqw MQvnpIeWvRKTyesCYEN4KeoUdjR2inujPC0435YZvqMqunD5W6k1bDxy+xa6RjdN7n3K dmPEMXbwYu/QtRnAnOD9DEmXFcafL68r+OEYi5eqHiEOefJosh1ceV2DTQM6ZmE3nj16 Iu4C5tFR8tDL/XibRnPlSvqjCOOaG+NCyaWEXHT04A/s1pATYUJPIIrw37Ec+fCtEKCs MLrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XET7OF75wNiBS0S9YBCqjrCeD8nZnzrXhbrqUvMdrP8=; b=mUNjfOPVtNsWJHOOdtd5VTFMn/5Y9GN5Oqhra9jxtnwLW/FCzBgwGNb7kG4p1mY14r PmYlyQXpUEKV5Y79zNPZz6ehLgL5X5sA9fGlGtfNQ4RhxR8NfbE1w3xFGvpWQKo44yHk x6J5RPO8swDl/1Va8a5PeGV73Z4heKcMI+geSkwW1qHHdQ/GXXrPNp2ltxrMbWpKc4sx FlGmK3kSruR/OwYKhkhkcUUgbU5d1UmatWx+VnpatbTimp1zQS9jYOtHZQcqRNIETLJy FyCD5D9/Qk44FRxALdYJHZlG0wZ2JwnoB+QPmjuGDp9DtdQiIYmH3+Yw/W02f10UKrqR xUnQ== X-Gm-Message-State: APjAAAXzUGXODrhoQgCO9j5z07jED2Vt88YmKWb/rmEgfBcMVnHCMimc WkkoKCcWjmwupvXfcUlCPwOGkrrK0W+6RXdEUjAFgUCrgE4HxQ== X-Received: by 2002:a24:d00e:: with SMTP id m14mr19817246itg.153.1558775928708; Sat, 25 May 2019 02:18:48 -0700 (PDT) MIME-Version: 1.0 References: <20190517082633.GA3890@zhanggen-UX430UQ> <20190517090628.GA4162@zhanggen-UX430UQ> <20190523005133.GA14881@zhanggen-UX430UQ> <20190525023608.GA11613@zhanggen-UX430UQ> In-Reply-To: <20190525023608.GA11613@zhanggen-UX430UQ> From: Ard Biesheuvel Date: Sat, 25 May 2019 11:18:36 +0200 Message-ID: Subject: Re: [PATCH v2] efi_64: Fix a missing-check bug in arch/x86/platform/efi/efi_64.c To: Gen Zhang Cc: Darren Hart , linux-efi , Linux Kernel Mailing List 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 Sat, 25 May 2019 at 04:36, Gen Zhang wrote: > > On Fri, May 24, 2019 at 06:07:10PM +0200, Ard Biesheuvel wrote: > > Apologies for only spotting this now, but I seem to have given some bad advice. > > > > efi_call_phys_prolog() in efi_64.c will also return NULL if > > (!efi_enabled(EFI_OLD_MEMMAP)), but this is not an error condition. So > > that occurrence has to be updated: please return efi_mm.pgd instead. > Thanks for your reply, Ard. You mean that we should return efi_mm.pgd > when allcoation fails? And we should delete return EFI_ABORTED on the > caller site, right? In that case, how should we handle the NULL pointer > returned by condition if(!efi_enabled(EFI_OLD_MEMMAP)) on the caller > site? > No, the other way around. I have already updated the patch, so don't worry about it. https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/commit/?h=urgent&id=d2dc2bc7b60b936b95da4b04c2912c02974c3e9f