]> git.baikalelectronics.ru Git - kernel.git/commit
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:42:16 +0000 (17:42 +0100)
commitcf8202738693fd35bb6e0f09fcadf9adf98c0aa8
tree31e3509565fecef913b5cf5f9cb2ae3c5da72959
parent9156f114d3f3db23f196fb33c5c070a1ecc4b8d8
net/x25: Fix skb leak in x25_lapb_receive_frame()

[ Upstream commit 6e498a6e1887ccd6176487a8dc95d04ac0a57029 ]

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: ccf900903725 ("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