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

samples: wifi: radio_test: Fix crash during temp and rssi get #18896

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

krish2718
Copy link
Contributor

@krish2718 krish2718 commented Nov 14, 2024

samples: wifi: radio_test: Fix crash during temp and rssi get

Get temperature and RSSI commands don't take any args, but due to
copy-paste, the code tries to parse the args, argv[1] without any NULL
or boundary checks causing a crash.

This bug is quite old but in nRF53 (and 52) the address 0x0 is a valid
address (IIRC mapped to begining of external flash), so, the conversion
to string passes, though it returns garbage but the check for the
returned value is completely unnecessary, so it doesn't matter if that
is invoked or not, because of this, the issue was hidden.

In nRF54H the address 0x0 is not mapped and is considered invalid and
leading to the crash.

@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Nov 14, 2024
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Nov 14, 2024

CI Information

To view the history of this post, clich the 'edited' button above
Build number: 2

Inputs:

Sources:

sdk-nrf: PR head: 8039b9133b982d27510f270d6543ea6f08c7562a

more details

sdk-nrf:

PR head: 8039b9133b982d27510f270d6543ea6f08c7562a
merge base: d0cdd9babd7a5904dc931f917e6af3920f083aab
target head (main): d0cdd9babd7a5904dc931f917e6af3920f083aab
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (1)
samples
│  ├── wifi
│  │  ├── radio_test
│  │  │  ├── src
│  │  │  │  │ nrf_wifi_radio_test_shell.c

Outputs:

Toolchain

Version:
Build docker image:

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain
  • ◻️ Build twister
  • ◻️ Integration tests
    • ◻️ test-sdk-wifi
Disabled integration tests
    • desktop52_verification
    • doc-internal
    • test_ble_nrf_config
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-ble_samples
    • test-fw-nrfconnect-boot
    • test-fw-nrfconnect-chip
    • test-fw-nrfconnect-fem
    • test-fw-nrfconnect-nfc
    • test-fw-nrfconnect-nrf-iot_cloud
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf-iot_lwm2m
    • test-fw-nrfconnect-nrf-iot_mosh
    • test-fw-nrfconnect-nrf-iot_nrf_provisioning
    • test-fw-nrfconnect-nrf-iot_positioning
    • test-fw-nrfconnect-nrf-iot_samples
    • test-fw-nrfconnect-nrf-iot_serial_lte_modem
    • test-fw-nrfconnect-nrf-iot_thingy91
    • test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • test-fw-nrfconnect-nrf_crypto
    • test-fw-nrfconnect-ps
    • test-fw-nrfconnect-rpc
    • test-fw-nrfconnect-rs
    • test-fw-nrfconnect-tfm
    • test-fw-nrfconnect-thread
    • test-fw-nrfconnect-zigbee
    • test-low-level
    • test-sdk-audio
    • test-sdk-dfu
    • test-sdk-find-my
    • test-sdk-mcuboot
    • test-sdk-pmic-samples
    • test-sdk-sidewalk

Note: This message is automatically posted and updated by the CI

Get temperature and RSSI commands don't take any args, but due to
copy-paste, the code tries to parse the args, argv[1] without any NULL
or boundary checks causing a crash.

This bug is quite old but in nRF53 (and 52) the address 0x0 is a valid
address (IIRC mapped to begining of external flash), so, the conversion
to string passes, though it returns garbage but the check for the
returned value is completely unnecessary, so it doesn't matter if that
is invoked or not, because of this, the issue was hidden.

In nRF54H the address 0x0 is not mapped and is considered invalid and
leading to the crash.

Signed-off-by: Chaitanya Tata <[email protected]>
@rlubos rlubos merged commit 1f06433 into nrfconnect:main Nov 14, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants