Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unexpected RekeyInd handling #6637

Merged
merged 2 commits into from
Oct 18, 2023
Merged

Fix unexpected RekeyInd handling #6637

merged 2 commits into from
Oct 18, 2023

Conversation

adriansmares
Copy link
Contributor

@adriansmares adriansmares commented Oct 16, 2023

Summary

This PR makes our handling of RekeyInd a bit smarter by discarding RekeyInd commands which are unexpected (specifically, if the LNS did not set the OptNeg bit during the Join Request handling).

This has showed up during some accidental fuzz testing - random bytes on FPort 0 are sent by the end device, and the LNS parses them as legitimate commands. A possible such command is RekeyInd, which switches the LoRaWAN version of the MAC state. If a 1.0.x end device sends this command, we must always discard it, otherwise we risk failing to match the packet (because the requested minor may be higher than 1, and thus enable the 1.1+ extra MIC checks).

Changes

  • Discard unexpected RekeyInd commands.
  • Change the error code for the unimplemented rejoin-request handler. Unimplemented errors are reported to Sentry and are logged with error level, as they generally signal some deep version mismatch, but the unimplemented state here is intentional.

Testing

Local testing. This feature does not require explicit testing.

Regressions

The RekeyInd commands will now be rejected if the end device version is < 1.1+, which is the correct behavior anyway.

Checklist

  • Scope: The referenced issue is addressed, there are no unrelated changes.
  • Compatibility: The changes are backwards compatible with existing API, storage, configuration and CLI, according to the compatibility commitments in README.md for the chosen target branch.
  • Documentation: Relevant documentation is added or updated.
  • The steps/process to test this feature are clearly explained including testing for regressions.
  • Changelog: Significant features, behavior changes, deprecations and fixes are added to CHANGELOG.md.
  • Commits: Commit messages follow guidelines in CONTRIBUTING.md, there are no fixup commits left.

@adriansmares adriansmares added the bug Something isn't working label Oct 16, 2023
@adriansmares adriansmares added this to the v3.28.0 milestone Oct 16, 2023
@adriansmares adriansmares self-assigned this Oct 16, 2023
@github-actions github-actions bot added the c/network server This is related to the Network Server label Oct 16, 2023
@adriansmares adriansmares marked this pull request as ready for review October 17, 2023 14:11
@adriansmares adriansmares merged commit dceeff8 into v3.28 Oct 18, 2023
13 checks passed
@adriansmares adriansmares deleted the fix/rekey-unknown branch October 18, 2023 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working c/network server This is related to the Network Server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants