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 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6C1E5C0015E for ; Thu, 27 Jul 2023 08:23:23 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 787A4867A3; Thu, 27 Jul 2023 10:23:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Z6pCJMEj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CDB23867E8; Thu, 27 Jul 2023 10:23:18 +0200 (CEST) Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6227386784 for ; Thu, 27 Jul 2023 10:23:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3fc02a92dcfso6998105e9.0 for ; Thu, 27 Jul 2023 01:23:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690446196; x=1691050996; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=LYztHiBCrwoReKMVucZti4te4Oji5D1sxx+WzD4wczc=; b=Z6pCJMEjkV4/5csqGisW4VIuFy5pnPgXOqN6CpodQn4ifLuGsjPzTmMroxjEZBoEbR m75ughT7zkWefP+q47Mp/uXSLn9pLyhH8nJjFSiVR8MuBA1FXVfB4r5dkJ3tb8Ydfeax CywZjzV7TW9/tmHqrcn+jVrEl3CeoSz/Rmpurs7lPaka+PR7/8Bog0x8rHVXLOROjUQ5 5fnCuKhm7ASWFDT2O8AkV709NnVBoL8EyliUl5l3QGM4ir5LO+VojATBNzjeCVGmYM0u JOxPH2V2MgLJ/MX4Ci8Leoy9ZVfR4nqgopPNw4R+BL8cST8jvPNqzx4MtDa16WrKxr5s A6Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690446196; x=1691050996; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=LYztHiBCrwoReKMVucZti4te4Oji5D1sxx+WzD4wczc=; b=f26HD4/+l9ePyWy3M2OfMCDuHNrLBIEZlqzLsIeylQSgPwALWfuzc4EkvEWMCUYDXi 4dYhniGKpn5k4yHBDvld1hsgL9VSw6ZUbnrd0bAG952TBJiYnHWh0TI08jhVe8BsCGMj LnKDGIoqNBAuWv6YlwZy3+R8gO09Sh0gPWHduBbBQHCFrrszYlrD0DRPeXe9benBOiza kbWfgtJsT4u5nYoFceTwHQwtnnS74bNdHxH6hyp4HzhGMP8kCLKxKCmHE2U8QmRyT74N DBhzhIMTnVo8S4ZkXFAEMo73Jf0ehD0Hw5BOVvqqSlxKDLouTh6sSriiJDooTUyRZP3G k97w== X-Gm-Message-State: ABy/qLZ+hAioHIcfbffmm9yDlep1xSuOPQ0PwPg/2MpW4YrC563vfEaX +cMQRDlXtNE5K0UWyfEl4WEbMg== X-Google-Smtp-Source: APBJJlFltCYAY+ANrbb7cKzOivj9ZyM+hW1Gb5IFTnkuxTE/Re0Jd1b4Be1YxeFhgxGmfnWe62FEoA== X-Received: by 2002:adf:ef05:0:b0:317:6cca:a68a with SMTP id e5-20020adfef05000000b003176ccaa68amr1134869wro.41.1690446195899; Thu, 27 Jul 2023 01:23:15 -0700 (PDT) Received: from hades (ppp089210088142.access.hol.gr. [89.210.88.142]) by smtp.gmail.com with ESMTPSA id r8-20020adfe688000000b0031434c08bb7sm1246511wrm.105.2023.07.27.01.23.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 01:23:15 -0700 (PDT) Date: Thu, 27 Jul 2023 11:23:13 +0300 From: Ilias Apalodimas To: Dan Carpenter Cc: Heinrich Schuchardt , u-boot@lists.denx.de Subject: Re: [PATCH] efi_loader: fix uninitialized variable bug in efi_set_load_options() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On Thu, Jul 27, 2023 at 10:15:01AM +0300, Dan Carpenter wrote: > Check for efi_search_protocol() failure before dereferencing "handler" > to avoid a crash. > > Signed-off-by: Dan Carpenter > --- > lib/efi_loader/efi_load_options.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/efi_loader/efi_load_options.c b/lib/efi_loader/efi_load_options.c > index 3cfddee014e9..5f62184da1cd 100644 > --- a/lib/efi_loader/efi_load_options.c > +++ b/lib/efi_loader/efi_load_options.c > @@ -31,10 +31,10 @@ efi_status_t efi_set_load_options(efi_handle_t handle, > efi_status_t ret; > > ret = efi_search_protocol(handle, &efi_guid_loaded_image, &handler); > - loaded_image_info = handler->protocol_interface; > if (ret != EFI_SUCCESS) > return EFI_INVALID_PARAMETER; > > + loaded_image_info = handler->protocol_interface; > loaded_image_info->load_options = load_options; > loaded_image_info->load_options_size = load_options_size; > > -- > 2.39.2 > Reviewed-by: Ilias Apalodimas