summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhao Dongdong <zhaodongdong@kylinos.cn>2026-05-26 11:21:39 +0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2026-05-27 16:44:02 -0400
commit3c40d381ce04f9575a5d8b542898183c3b4b38dc (patch)
tree0a8fd859ef2298f657365e4bc5d135bdf4b4cf3c
parent82855073c1081732656734b74d7d1d5e4cfd0da7 (diff)
downloadlinux-next-3c40d381ce04f9575a5d8b542898183c3b4b38dc.tar.gz
linux-next-3c40d381ce04f9575a5d8b542898183c3b4b38dc.zip
Bluetooth: 6lowpan: check skb_clone() return value in send_mcast_pkt()
The skb_clone() function can return NULL if memory allocation fails. send_mcast_pkt() calls skb_clone() without checking the return value, which can lead to a NULL pointer dereference in send_pkt() when it dereferences skb->data. Add a NULL check after skb_clone() and skip the peer if the clone fails. Fixes: 18722c247023 ("Bluetooth: Enable 6LoWPAN support for BT LE devices") Signed-off-by: Zhao Dongdong <zhaodongdong@kylinos.cn> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
-rw-r--r--net/bluetooth/6lowpan.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index 2f03b780b40d..960a19b3e26d 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -486,6 +486,8 @@ static int send_mcast_pkt(struct sk_buff *skb, struct net_device *netdev)
int ret;
local_skb = skb_clone(skb, GFP_ATOMIC);
+ if (!local_skb)
+ continue;
BT_DBG("xmit %s to %pMR type %u IP %pI6c chan %p",
netdev->name,