提交 052897ca 编写于 作者: G Gustavo F. Padovan 提交者: Marcel Holtmann

Bluetooth: Check the SDU size against the MTU value

If the SDU size is greater than the MTU something is wrong, so report
an error.
Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
[jprvita@profusion.mobi: set err to appropriate errno value]
Signed-off-by: NJoão Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 10467e9e
...@@ -3338,6 +3338,11 @@ static int l2cap_sar_reassembly_sdu(struct sock *sk, struct sk_buff *skb, u16 co ...@@ -3338,6 +3338,11 @@ static int l2cap_sar_reassembly_sdu(struct sock *sk, struct sk_buff *skb, u16 co
pi->sdu_len = get_unaligned_le16(skb->data); pi->sdu_len = get_unaligned_le16(skb->data);
skb_pull(skb, 2); skb_pull(skb, 2);
if (pi->sdu_len > pi->imtu) {
err = -EMSGSIZE;
break;
}
pi->sdu = bt_skb_alloc(pi->sdu_len, GFP_ATOMIC); pi->sdu = bt_skb_alloc(pi->sdu_len, GFP_ATOMIC);
if (!pi->sdu) { if (!pi->sdu) {
err = -ENOMEM; err = -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册