[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210412162502.314854-14-sashal@kernel.org>
Date: Mon, 12 Apr 2021 12:24:36 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Pavel Skripkin <paskripkin@...il.com>,
syzbot+28a246747e0a465127f3@...kaller.appspotmail.com,
"David S . Miller" <davem@...emloft.net>,
Sasha Levin <sashal@...nel.org>, linux-wpan@...r.kernel.org,
netdev@...r.kernel.org
Subject: [PATCH AUTOSEL 5.4 14/39] drivers: net: fix memory leak in atusb_probe
From: Pavel Skripkin <paskripkin@...il.com>
[ Upstream commit 6b9fbe16955152626557ec6f439f3407b7769941 ]
syzbot reported memory leak in atusb_probe()[1].
The problem was in atusb_alloc_urbs().
Since urb is anchored, we need to release the reference
to correctly free the urb
backtrace:
[<ffffffff82ba0466>] kmalloc include/linux/slab.h:559 [inline]
[<ffffffff82ba0466>] usb_alloc_urb+0x66/0xe0 drivers/usb/core/urb.c:74
[<ffffffff82ad3888>] atusb_alloc_urbs drivers/net/ieee802154/atusb.c:362 [inline][2]
[<ffffffff82ad3888>] atusb_probe+0x158/0x820 drivers/net/ieee802154/atusb.c:1038 [1]
Reported-by: syzbot+28a246747e0a465127f3@...kaller.appspotmail.com
Signed-off-by: Pavel Skripkin <paskripkin@...il.com>
Signed-off-by: David S. Miller <davem@...emloft.net>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/net/ieee802154/atusb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
index 0dd0ba915ab9..23ee0b14cbfa 100644
--- a/drivers/net/ieee802154/atusb.c
+++ b/drivers/net/ieee802154/atusb.c
@@ -365,6 +365,7 @@ static int atusb_alloc_urbs(struct atusb *atusb, int n)
return -ENOMEM;
}
usb_anchor_urb(urb, &atusb->idle_urbs);
+ usb_free_urb(urb);
n--;
}
return 0;
--
2.30.2
Powered by blists - more mailing lists