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 [backport 2019.07] #11848

Conversation

fjmolinas
Copy link
Contributor

Backport of #11847

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 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: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) labels Jul 16, 2019
@fjmolinas fjmolinas requested a review from jia200x July 16, 2019 12:29
@jia200x
Copy link
Member

jia200x commented Jul 16, 2019

I confirm it's the same commit as aff7ee3

jia200x
jia200x previously approved these changes Jul 16, 2019
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.

it's pointing to the right branch and everything looks OK. ACK

@fjmolinas fjmolinas force-pushed the backport/2019.07/pr_fix_issue_11626 branch from d8be0bc to 8be045f Compare July 17, 2019 09:23
@fjmolinas
Copy link
Contributor Author

@jia200x rebased since 868b55c was merged into 2019.07-branch

@fjmolinas
Copy link
Contributor Author

@jia200x rebased since 868b55c was merged into 2019.07-branch

@jia200x your review somehow got dismissed while doing so... could you take a look again (should just mean ACK'ing again, nothing has changed).

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.

Sure! ACK

@fjmolinas fjmolinas merged commit df8fb49 into RIOT-OS:2019.07-branch Jul 17, 2019
@fjmolinas fjmolinas deleted the backport/2019.07/pr_fix_issue_11626 branch July 17, 2019 10:14
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: release backport Integration Process: The PR is a release backport of a change previously provided to master 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.

2 participants