From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6756C43461 for ; Wed, 16 Sep 2020 10:16:06 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3E84C20872 for ; Wed, 16 Sep 2020 10:16:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="UGB16rEz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E84C20872 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kIUTa-00037G-BA; Wed, 16 Sep 2020 10:15:46 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kIUTZ-00036d-OH for xen-devel@lists.xenproject.org; Wed, 16 Sep 2020 10:15:45 +0000 X-Inumbo-ID: 6c047847-f5e0-4247-b906-834daa4fa09f Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6c047847-f5e0-4247-b906-834daa4fa09f; Wed, 16 Sep 2020 10:15:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1600251344; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=6Dd97ERfrqNS38sEZtk9PVeUIARAoj9FAEz85fIHVWc=; b=UGB16rEzX+jhBsKSdmYg4KfFgSI0/bOyhzciAx2qlLL9PYaMiz4dQGvT we/B+gR6ly8QFujqGGeMDZKs+JQd02pkzSdSd/Mdcody0+jyyZEdUSgSB 5vy4wSD03BeBqq27zj9sMtnlyCOUX7apybe0fDlF0HgI1a8WsaXpLOJ4p 8=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: S0OWKcDxB7qWP49DBY3vuiHO2C7H3u8uVdxBlZkpHI2fg2oMyGMgoa55bX0BMwfimjqy+SEHmk +YZ0NOJ89SINttwn4C46eUhkKbZRnsiktJovKtkSYc5xyAaJCML1VgJ4FlqcfENbdYaSvZPylY 7nh4Ep7DVf4wgOeTTAmrrqD0rJBqMkK44inmCwhDo0yt7+QmOQz1C4FzjPKx/jenm05OBUB62C 5vbGZQwELD+ahs+zYq5pCz+PFypeycUdLtbhOtqTg/wrLRnQz1hYPqSSgz+/M2Q1VRBJnpIXtp Y84= X-SBRS: 2.7 X-MesageID: 26788203 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.76,432,1592884800"; d="scan'208";a="26788203" Date: Wed, 16 Sep 2020 12:15:34 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Trammell Hudson CC: "xen-devel@lists.xenproject.org" , "jbeulich@suse.com" , "andrew.cooper3@citrix.com" , "wl@xen.org" Subject: Re: [PATCH v4 3/4] efi: Enable booting unified hypervisor/kernel/initrd images Message-ID: <20200916101020.GU753@Air-de-Roger> References: <20200914115013.814079-1-hudson@trmm.net> <20200914115013.814079-4-hudson@trmm.net> <20200916073209.GR753@Air-de-Roger> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: AMSPEX02CAS02.citrite.net (10.69.22.113) To FTLPEX02CL06.citrite.net (10.13.108.179) X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On Wed, Sep 16, 2020 at 08:37:44AM +0000, Trammell Hudson wrote: > On Wednesday, September 16, 2020 3:32 AM, Roger Pau Monné wrote: > > On Mon, Sep 14, 2020 at 07:50:12AM -0400, Trammell Hudson wrote: > > > - s2w(&name_string); > > > > Don't you need to check that s2w succeed, so that name_string.w is not > > a random pointer from stack garbage? > > Maybe? I don't see anywhere else in the code that s2w() is > ever checked for a NULL return. I see some callers pass the return of s2w() straight into read_file which will check that's not NULL before proceeding, or else call PrintErrMesg which won't return. > Perhaps a better fix would > be to modify the function to panic if it is unable > to allocate. Just doing what read_file does and use PrintErrMesg seems fine to me. Roger.