net/x25: Fix skb leak in x25_lapb_receive_frame()
authorWei Yongjun <weiyongjun1@huawei.com>
Mon, 14 Nov 2022 11:05:19 +0000 (11:05 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Nov 2022 16:35:40 +0000 (17:35 +0100)
commitfda0ba7c84b46d10947c687320804b9de149a921
tree810616770bb37f446a1fdd3ef83d4c8ffabc88ee
parentccb22c876e8e7f62377e749c971907efe65d34c2
net/x25: Fix skb leak in x25_lapb_receive_frame()

[ Upstream commit 2929cceb2fcf0ded7182562e4888afafece82cce ]

x25_lapb_receive_frame() using skb_copy() to get a private copy of
skb, the new skb should be freed in the undersized/fragmented skb
error handling path. Otherwise there is a memory leak.

Fixes: cb101ed2c3c7 ("x25: Handle undersized/fragmented skbs")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Martin Schiller <ms@dev.tdt.de>
Link: https://lore.kernel.org/r/20221114110519.514538-1-weiyongjun@huaweicloud.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/x25/x25_dev.c