Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1468251ybi; Sat, 25 May 2019 02:42:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6tvsYprpC8+GHIgu21zqN0ML/no1MC3Aq5wBAl2JPxUMTO+hhoaPiBnGdiR21JzsPadSJ X-Received: by 2002:a17:902:7591:: with SMTP id j17mr52020238pll.200.1558777345904; Sat, 25 May 2019 02:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558777345; cv=none; d=google.com; s=arc-20160816; b=ifkh1eT68C9zGHmCC8ZUS7qQfGwYz5bWCZOXanyhugfEoOyYEkPozZj6xM7Ah57aLi UL35bIrXtI6NbJrmTs0Zia7qu4T62L/ZrRAvN3Lpoh//wqDj4ZBh/3t++axQXV1qEbAo uO+J0XyjXnfO3gZuuRU0uHSedeSTPVzv474i1jX7egzO+czU+Q/Jm1e0XUmd67pqjSGB dzAc8dlhZ3s7DP4+6ywPSCbWLORDWTF2Ju0KuRhqU+TdhJ0UXAsUwREUHrIWv1FDVPcK LfcLw/jeSWWq5m/FzSCManDmON56chOL1umI+qIYfeGc3/f/nIfvgmnPtYWCGcOOOj8R xhbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jiTZ2o51d/sXyhPszg2Yj4q0qpn+Df3pI4yEQ+F+CaU=; b=ZzDlJrhDvfHJp/Ey2dSKtUIDUp5clGxbce3h87g+kvnu698NWyac9BufAdVOz2g0Ws HclaDeIz55WFWCxBjCv+44i661V3E3nAIZKENxi0nW99PgABfxP8yBhrEnBXdtMUUrmS t2IUxTviHsPdI8RGP/mr7YIzwvMbqnrIEzWGCH8lzLu15m/aWiNTnxSCPCEgNUL/NlLo DO/W7Um7opJIWKkXdkuNSpb+e/K1KBI0HegxoHV1iHcjxm0rPawvkW0j8tZiZmYfAd2f Qp6hIseuGd0Cekq8wsJbESU2u8sRheHhEyDQMBAGbFEVMvUVskAeUmTJ2M2IYGUD5tHD LtKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Je7TqJvX; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i33si2973430pgl.159.2019.05.25.02.42.10; Sat, 25 May 2019 02:42:25 -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=@gmail.com header.s=20161025 header.b=Je7TqJvX; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726741AbfEYJlI (ORCPT + 99 others); Sat, 25 May 2019 05:41:08 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:37129 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726453AbfEYJlH (ORCPT ); Sat, 25 May 2019 05:41:07 -0400 Received: by mail-pf1-f196.google.com with SMTP id a23so6768243pff.4; Sat, 25 May 2019 02:41:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jiTZ2o51d/sXyhPszg2Yj4q0qpn+Df3pI4yEQ+F+CaU=; b=Je7TqJvXMENlCk3KNfujP2JkxLFkRJ216vC0Pn/xn9SjRXrCQTi/Wt9sIKeYqRqlG2 05v409w0p5WS2azWc8YEdW+mBWMaJM4Z2oznxJRoxm20gwGNcVijA+CRZ4Zr5TZhBCmn 6NhhmYFiT0UPe2jvDG4EUdX2JlVZp2bWjxwFykOxUqT7B5PKrx6uRwS1kzv8YXW9JmVu rtn9w592U9knYw3AEW+j/NDrp5xlYv+jOFbhj1n6wQuMHldhjkPXCFGqUnx/h8bj8UDh AISuuICfKbz7o9/kp3VX+oEXrj2uK6V4A9W+jFnOzDT0Ji4olXXeD7oLA7WDgeW+tnbF a8eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jiTZ2o51d/sXyhPszg2Yj4q0qpn+Df3pI4yEQ+F+CaU=; b=ig+pn8o0s+PZeYhIY/LdMxPUi4AiqBmtPjJBuXq3Un+oflbU3IBm+GGb/jFkBrHVKO 3IsthW8i3lHQnS+PBR1pP7pcnul1W03eRhydY5htQNQo+OTGTdevIsUqjqQrmSuS6b5C fGA75HF5c5PRI6hNumtq/dC3aC/sFbuyZwE4842hiapsk58T6ZCbaXwRHSGMQpADsYn/ KFZvZgmctMxNiScGjMfmVMBfH7glnAcdXcWqKqTBcS3O+ZQ0qt1E4BlYxZ/w7oULrpAL uJ2wt3yDioomb/klHfrBsl+lfikKuvb3SvR/bW/8lMbger8BJZsaqQ8iiUTxRufyTHGM Xhiw== X-Gm-Message-State: APjAAAVJJ+iAybwCwl0kq7YN5YWB9DXozZ7KmUwFmDmgoD9a7oYB2lh4 Rw+hGY8PdVAOlW/vrWOwFT0= X-Received: by 2002:a62:590f:: with SMTP id n15mr27824591pfb.204.1558777266747; Sat, 25 May 2019 02:41:06 -0700 (PDT) Received: from zhanggen-UX430UQ ([66.42.35.75]) by smtp.gmail.com with ESMTPSA id k22sm4951489pfk.54.2019.05.25.02.41.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 May 2019 02:41:05 -0700 (PDT) Date: Sat, 25 May 2019 17:40:52 +0800 From: Gen Zhang To: Ard Biesheuvel Cc: Darren Hart , linux-efi , Linux Kernel Mailing List Subject: Re: [PATCH v2] efi_64: Fix a missing-check bug in arch/x86/platform/efi/efi_64.c Message-ID: <20190525094052.GA13189@zhanggen-UX430UQ> References: <20190517082633.GA3890@zhanggen-UX430UQ> <20190517090628.GA4162@zhanggen-UX430UQ> <20190523005133.GA14881@zhanggen-UX430UQ> <20190525023608.GA11613@zhanggen-UX430UQ> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 25, 2019 at 11:18:36AM +0200, Ard Biesheuvel wrote: > 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 Thanks for your reply and update, Ard! That's really nice of you. Thanks Gen