[lvc-project] [PATCH] staging: wlan-ng: Fix potential double free in skb_ether_to_p80211
Fedor Pchelkin
pchelkin at ispras.ru
Sun Sep 15 22:31:40 MSK 2024
On Sun, 15. Sep 21:58, Mikhail Arkhipov wrote:
> Fix a potential double free of the p80211_wep->data pointer in the
> skb_ether_to_p80211 function. When encryption fails, the function frees
> p80211_wep->data but does not set the pointer to NULL, leading to the
> possibility of double freeing the memory if the caller attempts to
> free it again (calling function in p80211netdev.c (line 385) attempts
> to free this memory again using kfree_sensitive at line 432)
>
> Set p80211_wep->data to NULL after freeing it to ensure that further
> attempts to free this pointer are safely handled, preventing a
> double free error.
Здравствуйте!
Драйвер был убран из upstream коммитом 20952655235d ("staging: wlan-ng:
Remove broken driver prism2_usb").
Подобные вещи очень желательно проверять перед отправкой в международное
сообщество. Т.к. это staging, то, думаю, Грег Кроа-Хартман откажется взять
целенаправленный патч в стабильные ветки. Тогда просьба отправить патч в
lvc-patches с пометкой, в какие LVC ветки нам это следует применить.
Пометку можно делать либо в названии письма [PATCH 6.1] или, например,
[PATCH 5.10/5.15/6.1/6.6], либо в комментарии к патчу (комментарий к патчу
идёт после ---).
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: b5956dd26f84 ("drivers/staging/wlan-ng/p80211conv.c: fixed a
> potential memory leak")
Теги не переносят по строкам.
Fixes: b5956dd26f84 ("drivers/staging/wlan-ng/p80211conv.c: fixed a potential memory leak")
> Signed-off-by: Mikhail Arkhipov <m.arhipov at rosa.ru>
> ---
Вот здесь область для комментария, после ---.
> drivers/staging/wlan-ng/p80211conv.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c
> index 0ff5fda81b05..b2e224e1e33f 100644
> --- a/drivers/staging/wlan-ng/p80211conv.c
> +++ b/drivers/staging/wlan-ng/p80211conv.c
> @@ -215,6 +215,7 @@ int skb_ether_to_p80211(struct wlandevice *wlandev, u32 ethconv,
> "Host en-WEP failed, dropping frame (%d).\n",
> foo);
> kfree(p80211_wep->data);
> + p80211_wep->data = NULL;
> return 2;
> }
> fc |= cpu_to_le16(WLAN_SET_FC_ISWEP(1));
> --
> 2.39.3 (Apple Git-146)
>
More information about the lvc-project
mailing list