ahtn / keyplus

An easy to use, wired and wireless modular keyboard firmware
MIT License
246 stars 40 forks source link

Invalid packets are parsed by the nRF receiver breaking keyboard input #34

Open ahtn opened 6 years ago

ahtn commented 6 years ago

I connected a device that was sending invalid packets to the nRF receiver, and this broke keyboard input after the receiver seemed to try parse the packets as keyboard packets. The RF packet parser needs to be made more robust as these packets where not even a valid size for keyboard input. Also, it seems that the parser would attempt to scan these packets even when no devices had been paired, which should not be possible when the pairing algorithm is working correctly.

To detect and debug issues of this nature, it would be good to write a packet fuzzer that can send malformed/random packets to the receiver at different rates.

ahtn commented 6 years ago

The RF module doesn't disable interrupts when it is accessing the packet buffer used by the nRF24 IRQ.