Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp855576ybl; Thu, 12 Dec 2019 06:03:42 -0800 (PST) X-Google-Smtp-Source: APXvYqxzZP195iF8b407GoD2lDmC77H8CrefchWpe1XAS3d1GbAZ+NRP7zfN367byQqobECOcSms X-Received: by 2002:a05:6808:643:: with SMTP id z3mr5069066oih.19.1576159421898; Thu, 12 Dec 2019 06:03:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576159421; cv=none; d=google.com; s=arc-20160816; b=EUA4r51KX4neq3vlMVhGiuU0N7rQQ8RtdYMUpPQ2DVuxaLNqDdvxuETXO5fPJgDGzk fS2GHFjBMTGwzMGZISuSH0YuOHnw5OfY9eTLYLgDgp88xDY2cMtw7R/u9sj1q9xT+52Q 2YdftDOSTGoxgL5owpbMTA/Z4xIO2A9e6Al8K0cWfL+LNh9NBJQ9+o1Yydod9hgMCZAP 95k1YkWxcJPoJd9SzzqcSrEkBGbHU6hoo0YdQ+MfvrOHd96i/9qTb+fDAgCoS7pXnmF2 y+hkDwhUk5+H6zWJjvTaskYhbEGN5on3084pZg2xmpEzOpg6meKbPa5CMlDAIlz58HnT xOFA== 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=u2RUDl0mYLvmXxjsLkAo20DZhbBWkB25mVRHhxsu6eI=; b=OAGTosHe4YSSmkx+6mYe1FKL1ojM2o3uCxBayfXjp7BVobB9LxyZIfirPsZ/pZkxOK 3aC3+iuqAM7ktu9N9GldLOBY97B+TP5JJprEOD1oGHqwP17ZXIfbkl4WlVU5fn12VM/6 /6If2N4JLBGd7cjNaFB1NcRS1gHHN9PngtL3yQRjZJTI70TtNj+cNC6DxrnVT8Lc/Ad/ 4P/u1zqzoc65EzS1YZkQPsdoRH/2lTBGDwnvQ3QRsKOsQqTPXtPM/KhykSKia3vAeq8q MoiCDwcOvm5sDBYzTi8MF/6PtFrzv/j+h9azjKKIBYeTSZomShb0ayzZDizbekEQtLsH yVIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Og0OIM3E; 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 w11si3166380oic.62.2019.12.12.06.03.27; Thu, 12 Dec 2019 06:03:41 -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=Og0OIM3E; 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 S1729612AbfLLOCg (ORCPT + 99 others); Thu, 12 Dec 2019 09:02:36 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:39519 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729524AbfLLOCg (ORCPT ); Thu, 12 Dec 2019 09:02:36 -0500 Received: by mail-wm1-f66.google.com with SMTP id d5so2630512wmb.4 for ; Thu, 12 Dec 2019 06:02:35 -0800 (PST) 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=u2RUDl0mYLvmXxjsLkAo20DZhbBWkB25mVRHhxsu6eI=; b=Og0OIM3ERcWxCnRN++RWWG4z6rzmr5a6nHC6FsZO8HVaAVTtF1LczCuN6879Xt0VbM rtvTvkjllgM1I2VrJQitukSJtlMPazhlm11Eah76iznHoRB3K14Tt5F4kvYqB5FJxaf5 cvb+o1m/OKAS7Sg4eHfWZPgI8/P0KTHHdS2q3CM0n6DmXuEy7UM/0tFCR+2D1qLBZjBA 4dDgTIEpIdAa5yyroiTlCgmjN97ODLzvGmGwfwOdkI+U0IKJUOokU2BTHsCFXnJ+fsvc LjqAhgryPODrbsbMMp69/CKJtew/4PWTYKeo2iyVqC95uEJSKCPbCY9VSDzMj+uwuQH9 hviw== 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=u2RUDl0mYLvmXxjsLkAo20DZhbBWkB25mVRHhxsu6eI=; b=W6ensMgwuXenxMxBL6RqU0ymcx2pr4R6RT1LG1vHBhOiww7FjgX3EwFw26Xo73/LRe thWz0/9kgi9uG84r3VvlVkDXAca/QzXTvCyyL/v6Bl5B1LrT5n7edzwUIlpIzuzY+Q5P H9M4khcuQ8HEiCJcx+lFcwhK7363UR48bbnMqUbRPKOZmabb6FlDyF6enlgjsrwicgJP KZNUXeOV6bAzqpYzvT2IlZCqBZlbX9GKGEZXCh6WGKiy009hWlhlkD8nOlnZ/Ldv09Zz mYX0QcCGiwiNqLYi1N9Lotr6jMyowEpVikdlZ4g0ooG1WOUDZ5TwJJKmloPd5ruNW9eM vOEQ== X-Gm-Message-State: APjAAAWuv7VT0lV2d+9jnPNZfDo+ZAYKzBQpa6IKNQnBwH8JHGZeoBzk Dhh0Fy8oponH2lxoCLRx9u94ZccMI6JWA7eCuEF+Qg== X-Received: by 2002:a7b:c95a:: with SMTP id i26mr6726628wml.67.1576159354472; Thu, 12 Dec 2019 06:02:34 -0800 (PST) MIME-Version: 1.0 References: <20191212103158.4958-1-hdegoede@redhat.com> <20191212103158.4958-3-hdegoede@redhat.com> <82c65f05-1140-e10e-ba2f-0c4c5c85bbc8@redhat.com> In-Reply-To: <82c65f05-1140-e10e-ba2f-0c4c5c85bbc8@redhat.com> From: Ard Biesheuvel Date: Thu, 12 Dec 2019 15:02:15 +0100 Message-ID: Subject: Re: [PATCH 5.5 regression fix 2/2] efi/libstub/helper: Initialize pointer variables to zero for mixed mode To: Hans de Goede Cc: Thomas Gleixner , Dominik Brodowski , "the arch/x86 maintainers" , linux-efi , Linux Kernel Mailing List , stable 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 Thu, 12 Dec 2019 at 13:45, Hans de Goede wrote: > > Hi, > > On 12-12-2019 12:29, Ard Biesheuvel wrote: > > On Thu, 12 Dec 2019 at 11:32, Hans de Goede wrote: > >> > >> When running in EFI mixed mode (running a 64 bit kernel on 32 bit EFI > >> firmware), we _must_ initialize any pointers which are returned by > >> reference by an EFI call to NULL before making the EFI call. > >> > >> In mixed mode pointers are 64 bit, but when running on a 32 bit firmware, > >> EFI calls which return a pointer value by reference only fill the lower > >> 32 bits of the passed pointer, leaving the upper 32 bits uninitialized > >> unless we explicitly set them to 0 before the call. > >> > >> We have had this bug in the efi-stub-helper.c file reading code for > >> a while now, but this has likely not been noticed sofar because > >> this code only gets triggered when LILO style file=... arguments are > >> present on the kernel cmdline. > >> > >> Cc: stable@vger.kernel.org > >> Signed-off-by: Hans de Goede > >> --- > >> drivers/firmware/efi/libstub/efi-stub-helper.c | 4 ++-- > >> 1 file changed, 2 insertions(+), 2 deletions(-) > >> > >> diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c > >> index e02579907f2e..6ca7d86743af 100644 > >> --- a/drivers/firmware/efi/libstub/efi-stub-helper.c > >> +++ b/drivers/firmware/efi/libstub/efi-stub-helper.c > >> @@ -365,7 +365,7 @@ static efi_status_t efi_file_size(efi_system_table_t *sys_table_arg, void *__fh, > >> u64 *file_sz) > >> { > >> efi_file_handle_t *h, *fh = __fh; > > > > What about h? Doesn't it suffer from the same problem? > > > >> - efi_file_info_t *info; > >> + efi_file_info_t *info = NULL; > >> efi_status_t status; > >> efi_guid_t info_guid = EFI_FILE_INFO_ID; > >> unsigned long info_sz; > > > > And info_sz? > > And "efi_file_io_interface_t *io" and "efi_file_handle_t *fh" > in efi_open_volume(). > > I think that is all of them. > OK. I'll fix it up locally.