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

pkg/semtech_loramac: fix memcpy to uninitialized pointer #11847

Merged
merged 1 commit into from
Jul 16, 2019

Conversation

fjmolinas
Copy link
Contributor

Contribution description

#11552 introduced an illegal memcpy to an uni-initialized pointers. This broke loramac for some boards e.g: lobaro-lorabox and broke ABP for most of them. This pr fixes the illegal access.

The PR should be backported to Release 2019.07.

Testing procedure

BOARD=lobaro-lorabox LORA_DRIVER=sx1272 make -C tests/pkg_semtech-loramac/ flash term

loramac save
2019-07-16 11:05:16,557 - INFO #  loramac save
2019-07-16 11:05:16,562 - INFO # [semtech-loramac] saving configuration on EEPROM
2019-07-16 11:05:17,010 - INFO # [semtech-loramac] saving uplink counter: 0 
2019-07-16 11:05:17,042 - INFO # [semtech-loramac] saving rx2 freq: 869525000
2019-07-16 11:05:17,070 - INFO # [semtech-loramac] saving rx2 dr: 3
reboot

with this PR it works as expected.

  • On b-l072z-lrwan1 and other boards in master trying to set session keys fails or hangs:
loramac set appskey 1EBB10A1AE58065BB4540A4181DC7BB8
2019-07-15 17:16:52,784 - INFO #  loramac set appskey 1EBB10A1AE58065BB4540A4181DC7BB8
loramac get appskey
2019-07-15 17:16:55,244 - INFO #  loramac get appskey
2019-07-15 17:16:55,248 - INFO # APPSKEY: E9030008000000000000000000000000

With this PR it succeeds.

Issues/PRs references

fixes #11626
alternative to #11783

@fjmolinas fjmolinas added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: LoRa Area: LoRa radio support Process: release backport Integration Process: The PR is a release backport of a change previously provided to master labels Jul 16, 2019
@fjmolinas fjmolinas requested review from jia200x and kYc0o July 16, 2019 09:23
@jia200x
Copy link
Member

jia200x commented Jul 16, 2019

thanks so much for the fix! I will test it now.

@fjmolinas
Copy link
Contributor Author

@jia200x do you have lobaro-lorabox too?

@jia200x
Copy link
Member

jia200x commented Jul 16, 2019

@jia200x do you have lobaro-lorabox too?

Yes I have. Will try

@jia200x jia200x added Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch and removed Process: release backport Integration Process: The PR is a release backport of a change previously provided to master labels Jul 16, 2019
@jia200x
Copy link
Member

jia200x commented Jul 16, 2019

it works in b-l072z-lrwan1. I will try with the lobaro board

@jia200x
Copy link
Member

jia200x commented Jul 16, 2019

it works too

Copy link
Member

@jia200x jia200x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK_ This needs a backport to the 2019.07 branch. Could you provide one?

@fjmolinas
Copy link
Contributor Author

ACK_ This needs a backport to the 2019.07 branch. Could you provide one?

Does that consist of a PR to the release branch of the same commit?

@miri64
Copy link
Member

miri64 commented Jul 16, 2019

Does that consist of a PR to the release branch of the same commit?

Yepp. You can use the backport_pr script to do that.

@fjmolinas
Copy link
Contributor Author

@jia200x should I hit the green button?

@jia200x
Copy link
Member

jia200x commented Jul 16, 2019

@jia200x should I hit the green button?

Sure :) Have the honor

@fjmolinas fjmolinas merged commit 1720e2d into RIOT-OS:master Jul 16, 2019
@fjmolinas
Copy link
Contributor Author

@jia200x thanks for the review!

@fjmolinas
Copy link
Contributor Author

Backport provided in #11848

@kb2ma kb2ma modified the milestone: Release 2019.10 Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: LoRa Area: LoRa radio support CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests/pkg_semtech-loramac: hardfault on lobaro-lorabox
4 participants