Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp773435ybl; Thu, 12 Dec 2019 04:47:12 -0800 (PST) X-Google-Smtp-Source: APXvYqwDY4GwXpyzk4qKdY1Q9aoAwy02UYsc6kNzoZRmxZM1Dm4h4DnF2UNKbZEaLl2nQAL2har1 X-Received: by 2002:aca:f484:: with SMTP id s126mr4639229oih.48.1576154832193; Thu, 12 Dec 2019 04:47:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576154832; cv=none; d=google.com; s=arc-20160816; b=dE1Nf9VWXyh0cJxLTFkZTHGStZP6JJZveh6/fAbL/BkJMxgjVMb1m1ZuWsu9gGstNK Qqzgw/rk6mCqjK8EMvbbXwHlE4SG4zyNhbIRrAE1qwnCC0GCA9vh6B9hLXKkOWj62qOo tmEruFfWTVb/XgNmgw5cRco4wWRukmny2Tuw9/dzq3hwbCw9rs2A11DqN2zMv097s/ui 8S4cNcYAOhsXSj19L2NH8QI9IsK9K2j3VnoK5o6JuB6YBa3j51Xh7zrS+ymquXJWq2kp qrWIhgRI82T90vGfP++KBp6LzE+GJkusw5qEPHmoqmp/h0DseRBudbHXPC5+dI2aO50Y arYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=I8XMXlSrioOnOfeDKPU+ZNQ5TUt5nM7tjeiQ2QQ5IRM=; b=dXJD1geBruB0BJYZohip35XCmwNQk72tHvc/oqFLYxJeJPwn8u9Me9sbEz1cx1ba3x z8Y2tO9UKJE/yxjm6rX8WqVqdXwxxOLQlINptolBkWipw432DNV/IOKSz49gj3EfTz1y Y/UtcDbOA3p/0YrBu4NmaO3QnL+NRoKMJo6V96D7p8dI4T89EH0T2Ef1SaMKFdvgCucH N9TswfbHdbW8zxc3uqTEYITjanWBLm1GpnbctdZvCVT6YNVj9W3MpucTWGquxs5ZNLUv IaRRTSDQ/13dCqMFEP9A4Gsr3DFppVcSNnXt48Aegay+hc/6p2kTZa74LLWtO2LrvXPz hIjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iSCqjRGf; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x21si2791396oif.250.2019.12.12.04.46.57; Thu, 12 Dec 2019 04:47:12 -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=@redhat.com header.s=mimecast20190719 header.b=iSCqjRGf; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729219AbfLLMpN (ORCPT + 99 others); Thu, 12 Dec 2019 07:45:13 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:37324 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729092AbfLLMpM (ORCPT ); Thu, 12 Dec 2019 07:45:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576154711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I8XMXlSrioOnOfeDKPU+ZNQ5TUt5nM7tjeiQ2QQ5IRM=; b=iSCqjRGfiX5/SWnu6TMCnTbAqSRZmWV9ltl5eHhQ/tBNvzIILUEM/Xjh1554PDiFfYd30k vyshiW+IgL6J57o/0c2XMAsvorMcarnA5ttrECIPQ/d6NH/TBs1/xr8agNf3jXDTtkBU3O /D/vjrj9yr0nyjQUr9HLghlad0IhxRk= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-272-PGn84JiZPtGN4KZQRNAEGg-1; Thu, 12 Dec 2019 07:45:09 -0500 X-MC-Unique: PGn84JiZPtGN4KZQRNAEGg-1 Received: by mail-wm1-f69.google.com with SMTP id y125so1622520wmg.1 for ; Thu, 12 Dec 2019 04:45:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=I8XMXlSrioOnOfeDKPU+ZNQ5TUt5nM7tjeiQ2QQ5IRM=; b=f+r7GlA3ZiFxqVgsIpFmU3q3iR1AsqWDISsVv40leNJE5eVJGVSTYcGyiYJPhCEfRq 8MYmrJcDCInDfbCX/4sHBmSCVV32rbsfgRZGA3V1LgW8DsaKH/0QBcJUT2030RLUAkoK 0ce+fhB55l63bkWWtOxFB69x++1l6FTLDbaXhCahW/1H3Ygz4qL8N3xB1QsZMJ3ByOHH DC+8l20P5CwjuOn5Q8gbNWRKF9Hf9VG/1jRFO2/dTrdho74dyPGTnrBk9V/RrP+VeKSu M7A4E493hfcARXF7nsdcS9D6f4SHKRXRGEip9JOZ0mDFH7HhOEgIl1+k2sQt5dQIoYve BySQ== X-Gm-Message-State: APjAAAUgcgpZ9nNu04lirPGS/zfrKDg6oH1kOS6Jdvl7DYNWCEp8jwxV rR9xUXPflOtCWUUsEg0xv4+aupMA88m3Jbx/lXq3eeF8zsSAuofUsJLZfpr27MOecdh3xDhfwR8 c4npNo7QrvpyveRK7jX50Ch4w X-Received: by 2002:a1c:e909:: with SMTP id q9mr6714342wmc.30.1576154706785; Thu, 12 Dec 2019 04:45:06 -0800 (PST) X-Received: by 2002:a1c:e909:: with SMTP id q9mr6714317wmc.30.1576154706605; Thu, 12 Dec 2019 04:45:06 -0800 (PST) Received: from shalem.localdomain (2001-1c00-0c0c-fe00-7e79-4dac-39d0-9c14.cable.dynamic.v6.ziggo.nl. [2001:1c00:c0c:fe00:7e79:4dac:39d0:9c14]) by smtp.gmail.com with ESMTPSA id x10sm5873465wrv.60.2019.12.12.04.45.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Dec 2019 04:45:06 -0800 (PST) Subject: Re: [PATCH 5.5 regression fix 2/2] efi/libstub/helper: Initialize pointer variables to zero for mixed mode To: Ard Biesheuvel Cc: Thomas Gleixner , Dominik Brodowski , the arch/x86 maintainers , linux-efi , Linux Kernel Mailing List , stable References: <20191212103158.4958-1-hdegoede@redhat.com> <20191212103158.4958-3-hdegoede@redhat.com> From: Hans de Goede Message-ID: <82c65f05-1140-e10e-ba2f-0c4c5c85bbc8@redhat.com> Date: Thu, 12 Dec 2019 13:45:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Regards, Hans