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

OTA: Thread end device (Requestor) crashes if it cannot reach the Provider #14321

Closed
mykrupp opened this issue Jan 26, 2022 · 5 comments
Closed
Assignees
Labels
bug Something isn't working efr32 V1.0

Comments

@mykrupp
Copy link
Contributor

mykrupp commented Jan 26, 2022

Problem

Expected behavior: announce-ota-provider should error out when no Provider node ID has been registered. One reason that the Provider node ID would not be registered is if the provider has not been commissioned over thread

In a Thread network when the end device receives the Announce OTA Provider command and the Provider node ID indicated in that command is not reachable, the end device crashes. The function HandleNodeIdResolve in Discovery_ImplPlatform.cpp is passed a DnssdService pointer that contains incomplete information. Attributes mKey, mData contain null fields and mDataSize seems uninitialized.

Steps to reproduce:

  • Commission an OTA Requestor node onto a Thread network
  • Issue an AnnonceOTAProvider command passing an invalid (nonexistent) id as the Provider address:chip-tool otasoftwareupdaterequestor announce-ota-provider [invalidId] 0 0 0 2 0

Or follow the steps in https://github.com/selissia/connectedhomeip/edit/master/examples/ota-requestor-app/efr32/README.md without commissioning the Provider.

Call stack in Ozone:
Screen Shot 2022-01-24 at 1 42 30 PM

Hardfault register details:
Screen Shot 2022-01-24 at 12 47 43 PM

Proposed Solution

Either a null check around the provider node ID fields, or an error code indicating that the provider has not been comissioned.

@selissia selissia changed the title OTA: End device (Requestor) crashes if it cannot reach the Provider OTA: Thread end device (Requestor) crashes if it cannot reach the Provider Jan 26, 2022
@selissia
Copy link
Contributor

In this scenario the Provider is residing off the Thread network:
Provider----IP----OTBR----Thread----EndDevice

@woody-apple woody-apple added efr32 V1.0 bug Something isn't working labels Jan 26, 2022
@andy31415 andy31415 added v1_triage_split_9 bug Something isn't working efr32 V1.0 and removed bug Something isn't working efr32 V1.0 labels Jan 30, 2022
@holbrookt
Copy link
Contributor

@selissia should this issue be assigned to you as it's efr32? If not, can you help assign?

@selissia
Copy link
Contributor

selissia commented Jan 31, 2022

@holbrookt Yes, this is a DNS issue not specific to EFR32. As such I initially assigned it to @vivien-apple but @woody-apple unassigned it, I'm not sure why.

@holbrookt
Copy link
Contributor

Maybe an automated script? Feel free to reassign if you think that's right

mykrupp referenced this issue in mykrupp/connectedhomeip-1 Feb 2, 2022
bzbarsky-apple pushed a commit that referenced this issue Feb 7, 2022
… cannot reach the Provider (#14712)

* Fix github issue #14321

* Updates from PR suggestions

* Restyled by whitespace

* Restyled by clang-format

* Add verify or die calls to Discovery_ImplPlatform.cpp

Co-authored-by: Restyled.io <[email protected]>
@selissia
Copy link
Contributor

selissia commented Feb 8, 2022

Fixed by the above PR

@selissia selissia closed this as completed Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working efr32 V1.0
Projects
None yet
Development

No branches or pull requests

6 participants