From: Jon Hunter <jonathanh@nvidia.com>
To: Hans de Goede <hdegoede@redhat.com>,
Arend van Spriel <arend.vanspriel@broadcom.com>,
Kalle Valo <kvalo@codeaurora.org>,
linux-tegra <linux-tegra@vger.kernel.org>,
<linux-wireless@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: [REGRESSION] brcmfmac: NULL pointer deference starting next-20181107
Date: Tue, 13 Nov 2018 13:32:17 +0000 [thread overview]
Message-ID: <82736fa6-f3cc-f45f-a4b0-dba485531f7d@nvidia.com> (raw)
In-Reply-To: <000bfd39-10cf-661c-9512-0410782168dc@nvidia.com>
On 13/11/2018 13:21, Jon Hunter wrote:
...
>> IMHO the best fix here would be to modify efivar_entry_size(),
>> adding:
>>
>> if (!ops)
>> return -ENOENT;
>>
>> Which makes it return the same error as when we do have efivar
>> support but the requested variable is not found.
>
> So the above did not work. I see a patch from Arend and I will give this
> a try.
FWIW, this did work ...
diff --git a/drivers/firmware/efi/vars.c b/drivers/firmware/efi/vars.c
index 9336ffdf6e2c..8181e548f32b 100644
--- a/drivers/firmware/efi/vars.c
+++ b/drivers/firmware/efi/vars.c
@@ -829,9 +829,14 @@ struct efivar_entry *efivar_entry_find(efi_char16_t
*name, efi_guid_t guid,
*/
int efivar_entry_size(struct efivar_entry *entry, unsigned long *size)
{
- const struct efivar_operations *ops = __efivars->ops;
+ const struct efivar_operations *ops;
efi_status_t status;
+ if (!__efivars || !__efivars->ops)
+ return -ENOENT;
+
+ ops = __efivars->ops;
+
*size = 0;
if (down_interruptible(&efivars_lock))
I will let you know about Arend's patch as well.
Jon
--
nvpublic
next prev parent reply other threads:[~2018-11-13 13:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-12 13:24 [REGRESSION] brcmfmac: NULL pointer deference starting next-20181107 Jon Hunter
2018-11-12 13:25 ` Jon Hunter
2018-11-13 10:24 ` Arend van Spriel
2018-11-13 10:33 ` Arend van Spriel
2018-11-13 10:40 ` Hans de Goede
2018-11-13 10:45 ` Arend van Spriel
2018-11-13 13:21 ` Jon Hunter
2018-11-13 13:32 ` Jon Hunter [this message]
2018-11-13 13:32 ` Hans de Goede
2018-11-13 11:29 ` Jon Hunter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=82736fa6-f3cc-f45f-a4b0-dba485531f7d@nvidia.com \
--to=jonathanh@nvidia.com \
--cc=ard.biesheuvel@linaro.org \
--cc=arend.vanspriel@broadcom.com \
--cc=hdegoede@redhat.com \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).