fix(gps): bound GSV satellite records - #232
Merged
dakejahl merged 2 commits intoAug 31, 2026
Merged
Conversation
Reject impossible GSV metadata and constrain parser reads and telemetry writes to sentence and array bounds. Fixes PX4/PX4-Autopilot#28348 Assisted-by: OpenAI:Codex
Apply the same sentence-record and telemetry-array bounds to Ashtech GSV parsing. Assisted-by: OpenAI:Codex
Contributor
Author
|
Not on physical hardware—I don’t currently have a compatible receiver available. Verification was performed in PX4 SITL using a pseudo-serial NMEA GPS under AddressSanitizer. The malformed payload reproduced the baseline overflows in both the NMEA and Ashtech paths; the patched builds survived the same cases while preserving valid GSV behaviour. The normal and AddressSanitizer SITL builds, formatting check, and GPSDrivers CTest all passed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Harden the standard NMEA and Ashtech GSV parsers against receiver-controlled satellite counts and page metadata.
A checksummed sentence such as
$GPGSV,1,1,200*4Bpreviously drove the parsers past their four-record localsatarrays. Large page numbers could also address beyond thesatellite_info_sarrays. The same pattern existed in both parsers.This change:
SAT_INFO_MAX_SATELLITES; andFixes PX4/PX4-Autopilot#28348.
Verification
GPS_SAT_INFO=1.stack-buffer-overflowinGPSDriverNMEA::handleMessage()atnmea.cpp:748; PX4 aborted.GPSDriverAshtech::handleMessage()atashtech.cpp:570.1,2,3,4and SNR values30,31,32,33.make px4_sitl_default(RelWithDebInfo): pass.make px4_sitl_default PX4_CMAKE_BUILD_TYPE=AddressSanitizer: pass.make check_format: pass.AI assistance and independent validation
OpenAI Codex assisted with this implementation. GDN operated as a separate, coding-platform-independent validation layer above the coding system: it reproduced the fault in both protocol paths and assessed the patch through sanitizer, build, formatting, and protocol-behavior evidence. The same GDN process can validate work produced using any AI coding platform.
Assisted-by: OpenAI:Codex