Re: [PATCH] wireless: hostap: Fix a use after free in hostap_80211_rx

From: Kalle Valo
Date: Thu Jun 24 2021 - 12:43:08 EST


Lv Yunlong <lyl2019@xxxxxxxxxxxxxxxx> wrote:

> Function hostap_80211_rx() calls prism2_rx_80211(..,skb,..). In
> prism2_rx_80211, i found that the skb could be freed by dev_kfree_skb_any(skb)
> and return 0. Also could be freed by netif_rx(skb) when netif_rx return
> NET_RX_DROP.
>
> But after called the prism2_rx_80211(..,skb,..), the skb is used by skb->len.
>
> As the new skb->len is returned by prism2_rx_80211(), my patch uses a variable
> len to repalce skb->len. According to another useage of prism2_rx_80211 in
> monitor_rx().
>
> Signed-off-by: Lv Yunlong <lyl2019@xxxxxxxxxxxxxxxx>

Can someone help with reviewing the patch?

--
https://patchwork.kernel.org/project/linux-wireless/patch/20210329110021.7497-1-lyl2019@xxxxxxxxxxxxxxxx/

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