[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87h6hjhbqy.fsf@kernel.org>
Date: Wed, 06 Mar 2024 12:53:57 +0200
From: Kalle Valo <kvalo@...nel.org>
To: Arend van Spriel <arend.vanspriel@...adcom.com>,
Arnd Bergmann <arnd@...db.de>
Cc: Duoming Zhou <duoming@....edu.cn>, linux-kernel@...r.kernel.org,
konrad.dybcio@...aro.org, hdegoede@...hat.com, minipli@...ecurity.net,
linux-wireless@...r.kernel.org, brcm80211@...ts.linux.dev,
brcm80211-dev-list.pdl@...adcom.com
Subject: Re: [PATCH] wifi: brcmfmac: pcie: handle randbuf allocation failure
Arend van Spriel <arend.vanspriel@...adcom.com> writes:
> On 3/1/2024 2:51 PM, Duoming Zhou wrote:
>> The kzalloc() in brcmf_pcie_download_fw_nvram() will return
>> null if the physical memory has run out. As a result, if we
>> use get_random_bytes() to generate random bytes in the randbuf,
>> the null pointer dereference bug will happen.
>> Return -ENOMEM from brcmf_pcie_download_fw_nvram() if kzalloc()
>> fails for randbuf.
>> Fixes: 91918ce88d9f ("wifi: brcmfmac: pcie: Provide a buffer of
>> random bytes to the device")
>
> Looks good to me. Looking for kernel guideline about stack usage to
> determine whether it would be ok to just use buffer on stack. Does
> anyone know. This one is 256 bytes so I guess the allocation is
> warranted here.
Arnd, what do you suggest? Do we have any documentation or guidelines
anywhere?
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Powered by blists - more mailing lists