You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2021/07/20 12:26:47 UTC

[GitHub] [mynewt-nimble] KKopyscinski opened a new pull request #1003: host/l2cap: disconnect if received packet is larger than MPS

KKopyscinski opened a new pull request #1003:
URL: https://github.com/apache/mynewt-nimble/pull/1003


   Peer sending packet larger than MPS is invalid, and should be met
   with L2CAP channel disconnection.
   
   This affects L2CAP/LE/CFC/BV-27-C


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-nimble] rymanluk commented on a change in pull request #1003: host/l2cap: disconnect if received packet is larger than MPS

Posted by GitBox <gi...@apache.org>.
rymanluk commented on a change in pull request #1003:
URL: https://github.com/apache/mynewt-nimble/pull/1003#discussion_r675393315



##########
File path: nimble/host/src/ble_l2cap.c
##########
@@ -387,6 +387,23 @@ ble_l2cap_rx(struct ble_hs_conn *conn,
             goto err;
         }
 
+        if ((chan->dcid >= 0x0040 && chan->dcid <= 0x007F && l2cap_hdr.len > chan->my_coc_mps) ||

Review comment:
       @KKopyscinski  don't you want just add `ble_l2cap_disconnect(chan);` after line 413 ?
   
   
   
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-nimble] rymanluk commented on a change in pull request #1003: host/l2cap: disconnect if received packet is larger than MPS

Posted by GitBox <gi...@apache.org>.
rymanluk commented on a change in pull request #1003:
URL: https://github.com/apache/mynewt-nimble/pull/1003#discussion_r673859029



##########
File path: nimble/host/src/ble_l2cap.c
##########
@@ -387,6 +387,15 @@ ble_l2cap_rx(struct ble_hs_conn *conn,
             goto err;
         }
 
+        if (l2cap_hdr.len > chan->my_coc_mps) {

Review comment:
       what about ATT ? in such a case chan->my_coc_mps is 0 I believe. Or not? 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-nimble] KKopyscinski commented on pull request #1003: host/l2cap: disconnect if received packet is larger than MPS

Posted by GitBox <gi...@apache.org>.
KKopyscinski commented on pull request #1003:
URL: https://github.com/apache/mynewt-nimble/pull/1003#issuecomment-923917531


   @sjanc as discussed offline, only CIDs from dynamic range are checked now


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-nimble] KKopyscinski commented on a change in pull request #1003: host/l2cap: disconnect if received packet is larger than MPS

Posted by GitBox <gi...@apache.org>.
KKopyscinski commented on a change in pull request #1003:
URL: https://github.com/apache/mynewt-nimble/pull/1003#discussion_r674545428



##########
File path: nimble/host/src/ble_l2cap.c
##########
@@ -387,6 +387,15 @@ ble_l2cap_rx(struct ble_hs_conn *conn,
             goto err;
         }
 
+        if (l2cap_hdr.len > chan->my_coc_mps) {

Review comment:
       Yes, I think you are right. What's more, I think only dynamic range CIDs use `my_coc_mps` field, and for others MPS=MTU of channel, which varies from channel to channel. I added 3 cases for `BLE_L2CAP_CID_ATT`, `BLE_L2CAP_CID_SIG` and `BLE_L2CAP_CID_SM`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org