Re: [PATCH] firmware: efi: add NULL pointer checks in efivars api functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 13/11/2018 13:04, Arend van Spriel wrote:
> Several functions in efivars api assume __efivars is set, ie. will be
> accessed after efivars_register() has been called. However, following
> NULL pointer access was reported upon calling efivar_entry_size().
> 
> [   14.177769] Unable to handle kernel NULL pointer dereference at
> 		virtual address 00000008
> [   14.197303] pgd = 60bfa5f1
> [   14.211842] [00000008] *pgd=00000000
> [   14.227373] Internal error: Oops: 5 [#1] SMP ARM
> [   14.244244] Modules linked in: brcmfmac sha256_generic sha256_arm snd cfg80211 brcmutil soundcore snd_soc_tegra30_ahub tegra_wdt
> [   14.269109] CPU: 1 PID: 114 Comm: kworker/1:2 Not tainted 4.20.0-rc1-next-20181107-gd881de3 #1
> [   14.269114] Hardware name: NVIDIA Tegra SoC (Flattened Device Tree)
> [   14.269154] Workqueue: events request_firmware_work_func
> [   14.269177] PC is at efivar_entry_size+0x28/0x90
> [   14.269362] LR is at brcmf_fw_complete_request+0x3f8/0x8d4 [brcmfmac]
> [   14.269369] pc : [<c0c40718>]    lr : [<bf2a3ef4>]    psr: a00d0113
> [   14.269374] sp : ede7fe28  ip : ee983410  fp : c1787f30
> [   14.269378] r10: 00000000  r9 : 00000000  r8 : bf2b2258
> [   14.269384] r7 : ee983000  r6 : c1604c48  r5 : ede7fe88  r4 : edf337c0
> [   14.269389] r3 : 00000000  r2 : 00000000  r1 : ede7fe88  r0 : c17712c8
> [   14.269398] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
> [   14.269404] Control: 10c5387d  Table: ad16804a  DAC: 00000051
> 
> Disassembly showed that the local static variable __efivars is NULL. Likely
> because efivars_register() is not called on the Tegra platform. So adding
> a NULL pointer check in efivar_entry_size() and similar functions while at
> it. In efivars_register() a couple of sanity checks have been added.
> 
> Cc: Hans de Goede <hdegoede@xxxxxxxxxx>
> Reported-by: Jon Hunter <jonathanh@xxxxxxxxxx>
> Signed-off-by: Arend van Spriel <arend.vanspriel@xxxxxxxxxxxx>

Thanks. This fixes the problem for me ...

Tested-by: Jon Hunter <jonathanh@xxxxxxxxxx>

Cheers!
Jon

-- 
nvpublic



[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux