nfc: virtual_ncidev: Add variable to check if ndev is running
authorNguyen Dinh Phi <phind.uet@gmail.com>
Tue, 21 Nov 2023 07:53:57 +0000 (15:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2023 16:01:59 +0000 (17:01 +0100)
commit1f75542ce7c4e958386fb4932185842c3c8e1c4d
treedecfddf8a24be40009402c8d561392d9c4869f81
parentc9d25e4639c1d95d384e08d48d7b89cf690db9d1
nfc: virtual_ncidev: Add variable to check if ndev is running

[ Upstream commit 84d2db91f14a32dc856a5972e3f0907089093c7a ]

syzbot reported an memory leak that happens when an skb is add to
send_buff after virtual nci closed.
This patch adds a variable to track if the ndev is running before
handling new skb in send function.

Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com>
Reported-by: syzbot+6eb09d75211863f15e3e@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/lkml/00000000000075472b06007df4fb@google.com
Reviewed-by: Bongsu Jeon
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nfc/virtual_ncidev.c