You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "anchao (via GitHub)" <gi...@apache.org> on 2026/10/22 14:27:07 UTC

[PR] usbhost/cdcmbim: validate device-provided NTB bounds [nuttx]

anchao opened a new pull request, #20884:
URL: https://github.com/apache/nuttx/pull/20884

   ## Summary                                                                                                                                                                                                  
                                                                                                                                                                                                               
   Harden the CDC-MBIM host receive path against malformed NTB input from a connected device.                                                                                                                  
                                                                                                                                                                                                               
   The previous parser trusted device-provided NDP offsets, NDP lengths, and DPE entries. A malicious device could create an NDP chain that loops forever or cause the DPE walk to read past the received NTB. 
                                                                                                                                                                                                               
   ## Changes                                                                                                                                                                                                  
                                                                                                                                                                                                               
   - Validate the NTH header length and NTB block length.                                                                                                                                                      
   - Validate the initial NDP offset before dereferencing it.                                                                                                                                                  
   - Bound the number of NDPs processed per NTB to prevent cyclic NDP chains.                                                                                                                                  
   - Validate each NDP length before walking its DPE entries.                                                                                                                                                  
   - Validate `next_ndp_index` before the next iteration.                                                                                                                                                      
   - Restrict DPE iteration to the advertised NDP length.                                                                                                                                                      
   - Ensure datagram offset/length ranges are contained within the received NTB.                                                                                                                               
   
   ## Testing
   
   sim/usbdev


-- 
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@nuttx.apache.org

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


Re: [PR] usbhost/cdcmbim: validate device-provided NTB bounds [nuttx]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #20884:
URL: https://github.com/apache/nuttx/pull/20884


-- 
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@nuttx.apache.org

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


Re: [PR] usbhost/cdcmbim: validate device-provided NTB bounds [nuttx]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20884:
URL: https://github.com/apache/nuttx/pull/20884#issuecomment-6353714130

   <!-- membrowse-pr-comment -->
   ## <img src="https://membrowse.com/membrowse-logo.svg" height="24" align="top"> MemBrowse Memory Report &middot; [Explore what changed →](https://membrowse.com/public/apache/nuttx?commit_sha=3eb58a6e1c446a3abe599862604519ebd0a561f4)
   
   
   *No memory changes detected for:*
   - [arduino-mega2560](https://membrowse.com/public/apache/nuttx/target/arduino-mega2560/compare?head=3eb58a6e1c446a3abe599862604519ebd0a561f4&base=879ad9c59e3239a51520de8f53c1d492d26148ee)
   - [esp32-devkitc](https://membrowse.com/public/apache/nuttx/target/esp32-devkitc/compare?head=3eb58a6e1c446a3abe599862604519ebd0a561f4&base=879ad9c59e3239a51520de8f53c1d492d26148ee)
   - [hifive1-revb](https://membrowse.com/public/apache/nuttx/target/hifive1-revb/compare?head=3eb58a6e1c446a3abe599862604519ebd0a561f4&base=879ad9c59e3239a51520de8f53c1d492d26148ee)
   - [mirtoo](https://membrowse.com/public/apache/nuttx/target/mirtoo/compare?head=3eb58a6e1c446a3abe599862604519ebd0a561f4&base=879ad9c59e3239a51520de8f53c1d492d26148ee)
   - [qemu-armv8a](https://membrowse.com/public/apache/nuttx/target/qemu-armv8a/compare?head=3eb58a6e1c446a3abe599862604519ebd0a561f4&base=879ad9c59e3239a51520de8f53c1d492d26148ee)
   - [qemu-intel64](https://membrowse.com/public/apache/nuttx/target/qemu-intel64/compare?head=3eb58a6e1c446a3abe599862604519ebd0a561f4&base=879ad9c59e3239a51520de8f53c1d492d26148ee)
   - [rx65n-rsk2mb](https://membrowse.com/public/apache/nuttx/target/rx65n-rsk2mb/compare?head=3eb58a6e1c446a3abe599862604519ebd0a561f4&base=879ad9c59e3239a51520de8f53c1d492d26148ee)
   - [s698pm-dkit](https://membrowse.com/public/apache/nuttx/target/s698pm-dkit/compare?head=3eb58a6e1c446a3abe599862604519ebd0a561f4&base=879ad9c59e3239a51520de8f53c1d492d26148ee)
   - [stm32-nucleo-f103rb](https://membrowse.com/public/apache/nuttx/target/stm32-nucleo-f103rb/compare?head=3eb58a6e1c446a3abe599862604519ebd0a561f4&base=879ad9c59e3239a51520de8f53c1d492d26148ee)
   
   ---
   <sub>Catch memory regressions in CI with [MemBrowse](https://membrowse.com). Free for open source.</sub>
   


-- 
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@nuttx.apache.org

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