GCS_MAVLink: better reject commands that are out-of-spec or are unsupported
After a lengthy discussion in the "dev-team" and "security" discord channel related to issue: https://github.com/ArduPilot/ardupilot/issues/33410 the general consensus was that we should improve AP's robustness of GCS errors by better rejecting mavlink commands that are out-of-spec. Note this is a robustness issue, not a [security issue](https://ardupilot.org/dev/docs/security-landing-page.html).
Some examples:
1. reject in-spec messages that AP does not support
2. reject out-of-spec messages. e.g. messages which have clearly invalid field values (e.g. spec says mode field is uint8_t but caller provides a value outside this range)
If we only have the flash for (1) or (2) we think (1) should be prioritised and (2) left to the GCS developers.
The practical limitation is flash space. Adding piecemeal checks of every method may require a huge amount of flash forcing us to reduce features. Ideally we would like a flash-light method to perform all the required checks.
Enhancement to pymavlink might be part of the solution
### Platform
- [x] All
- [ ] AntennaTracker
- [ ] Copter
- [ ] Plane
- [ ] Rover
- [ ] Submarine
### Additional context
Add any other context or screenshots about the feature request here.
2 条评论