Commit Graph
6 Commits
Author SHA1 Message Date
Peter BarkerandClaude Opus 4.8 562d10e20f AP_MAVLinkCAN: reject negative CAN bus index in filter modify
A malformed CAN_FILTER_MODIFY message with a bus value of zero produces
bus == -1 after the off-by-one adjustment. The existing bounds check only
tested the upper bound, so hal.can[-1] was dereferenced before validation.
Add a lower-bound check, matching the fix applied to MAV_CMD_CAN_FORWARD.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 17:21:49 +10:00
Colin Smith 2ab74e790d AP_MAVLinkCAN: guard callback_bus before unregister 2026-06-17 17:19:02 +10:00
Colin Smith d06239ba36 AP_MAVLinkCAN: reject negative CAN bus indices 2026-06-17 17:19:02 +10:00
Peter Barker ca3b9cc66f AP_CANManager: make a stand-alone singleton for mavlink-to-CAN 2025-09-07 11:19:22 +01:00
Andrew Tridgell 1bfd33b6e8 AP_CANManager: fixed mutex ordering deadlock in MAVCAN
we had a deadlock between the mutex in HAL_ChibiOS CAN layer and the
MAVLinkCAN object

the deadlock arose because the low level CAN layer holds the HAL CAN
mutex before it calls up to the MAVLinkCAN frame callback

on the mavlink side, it took the MAVLinkCAN mutex before calling down
to the CAN send layer, this meant it took the 2 mutexes in the
opposite order

the symptoms were:

 - failure to boot if we have active MAVCAN during reboot as we
 deadlock during the scheduler delay callback

 - deadlock during heavy MAVCAN usage
2025-06-08 14:18:23 +10:00
bugobliterator 0ba6e570d3 AP_CANManager: create a new class for MAVLink CAN 2025-05-06 14:19:12 +10:00