Commit 548cfe7
committed
drivers: input: crsf: contain out-of-bounds async rx-ready windows
A field fault traced to the CRSF RX_RDY path: the parser was handed a
buffer window whose base pointer read a wild address, faulting in ISR
context. The serial driver's async double-buffer accounting was audited
and found self-consistent: the RX_RDY event reports a (buf, offset, len)
window derived under lock from a single view, with offset and length
bounded by the buffer length, so the wild base pointer cannot come from
that accounting alone and the root mechanism could not be pinned in the
serial layer. This guard is containment at the buffer owner, not a fix
for a proven serial-driver defect.
The CRSF driver supplies the two RX DMA buffers, so it can validate the
event before trusting it: require the RX_RDY buffer to be one of those
two buffers and the offset/len window to stay within CRSF_RX_BUF_SIZE
before invalidating cache or parsing. Anything else is dropped so a
stale or corrupt window can never reach crsf_process_bytes.
Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>1 parent 5a57f9d commit 548cfe7
1 file changed
Lines changed: 18 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
459 | 459 | | |
460 | 460 | | |
461 | 461 | | |
462 | | - | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
463 | 477 | | |
464 | | - | |
| 478 | + | |
465 | 479 | | |
466 | 480 | | |
467 | | - | |
| 481 | + | |
468 | 482 | | |
| 483 | + | |
469 | 484 | | |
470 | 485 | | |
471 | 486 | | |
| |||
0 commit comments