Re: [-next] rtlwifi: kfree entry until after entry->bssid has been accessed

From: Kalle Valo
Date: Thu Jul 27 2017 - 06:58:41 EST


Colin Ian King <colin.king@xxxxxxxxxxxxx> wrote:

> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
>
> The current code kfree's entry and then dereferences it by accessing
> entry->bssid. Avoid the dereference-after-free by moving the kfree
> after the access to entry->bssid.
>
> Detected by CoverityScan, CID#1448600 ("Read from pointer after free")
>
> Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>

Patch applied to wireless-drivers-next.git, thanks.

d0116f6f7b30 rtlwifi: kfree entry until after entry->bssid has been accessed

--
https://patchwork.kernel.org/patch/9819083/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches