staging: rtl8192e: Fix potential use-after-free in rtllib_rx_Monitor()
authorYueHaibing <yuehaibing@huawei.com>
Wed, 23 Nov 2022 08:12:53 +0000 (16:12 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:42 +0000 (13:32 +0100)
commit7155f549dbcabc95d6dbd74d023a2cf2f42d098f
tree4434af836a54b97b0906166d2957dbdbb98d5359
parent73df1172bbcc8d45cd28e3b1a9ca2edb2f9f7ce6
staging: rtl8192e: Fix potential use-after-free in rtllib_rx_Monitor()

[ Upstream commit d30f4436f364b4ad915ca2c09be07cd0f93ceb44 ]

The skb is delivered to netif_rx() in rtllib_monitor_rx(), which may free it,
after calling this, dereferencing skb may trigger use-after-free.
Found by Smatch.

Fixes: 94a799425eee ("From: wlanfae <wlanfae@realtek.com> [PATCH 1/8] rtl8192e: Import new version of driver from realtek")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20221123081253.22296-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/rtl8192e/rtllib_rx.c