This is a note to let you know that I've just added the patch titled Bluetooth: Fix bt_skb_sendmmsg not allocating partial chunks to the 5.16-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: bluetooth-fix-bt_skb_sendmmsg-not-allocating-partial.patch and it can be found in the queue-5.16 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 976b37e2a5885863e25eb71ebf8f67bf272a3b0f Author: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx> Date: Mon Feb 14 17:59:38 2022 -0800 Bluetooth: Fix bt_skb_sendmmsg not allocating partial chunks [ Upstream commit 29fb608396d6a62c1b85acc421ad7a4399085b9f ] Since bt_skb_sendmmsg can be used with the likes of SOCK_STREAM it shall return the partial chunks it could allocate instead of freeing everything as otherwise it can cause problems like bellow. Fixes: 81be03e026dc ("Bluetooth: RFCOMM: Replace use of memcpy_from_msg with bt_skb_sendmmsg") Reported-by: Paul Menzel <pmenzel@xxxxxxxxxxxxx> Link: https://lore.kernel.org/r/d7206e12-1b99-c3be-84f4-df22af427ef5@xxxxxxxxxxxxx BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215594 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx> Tested-by: Paul Menzel <pmenzel@xxxxxxxxxxxxx> (Nokia N9 (MeeGo/Harmattan) Signed-off-by: Marcel Holtmann <marcel@xxxxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 3271870fd85e..a1093994e5e4 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h @@ -497,8 +497,7 @@ static inline struct sk_buff *bt_skb_sendmmsg(struct sock *sk, tmp = bt_skb_sendmsg(sk, msg, len, mtu, headroom, tailroom); if (IS_ERR(tmp)) { - kfree_skb(skb); - return tmp; + return skb; } len -= tmp->len;