2020-05-14 04:05:40

by Dongyang Zhan

[permalink] [raw]
Subject: Fwd: Potential memory leak bug in mwifiex_init_rxq_ring()

---------- Forwarded message ---------
发件人: Dongyang Zhan <[email protected]>
Date: 2020年5月3日周日 下午2:16
Subject: Potential memory leak bug in mwifiex_init_rxq_ring()
To: <[email protected]>
Cc: <[email protected]>


Hi,

I am a security researcher. I found a potential bug in
/drivers/net/wireless/marvell/mwifiex/pcie.c. I hope you can help me
to confirm it.

Potential memory leak in mwifiex_init_rxq_ring()
(/drivers/net/wireless/marvell/mwifiex/pcie.c) when triggering
mwifiex_map_pci_memory() fails.

Source Code:
skb = mwifiex_alloc_dma_align_buf(MWIFIEX_RX_DATA_BUF_SIZE,
GFP_KERNEL);
if (!skb) {
mwifiex_dbg(adapter, ERROR,
"Unable to allocate skb for RX ring.\n");
kfree(card->rxbd_ring_vbase);
return -ENOMEM;
}

if (mwifiex_map_pci_memory(adapter, skb,
MWIFIEX_RX_DATA_BUF_SIZE,
PCI_DMA_FROMDEVICE))
return -1;//skb is not released

...
}

Thank you.