Skip to content

STM32L4: before calling HAL_CRYP_DeInit initialize the Instance member #8946

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

Merged
merged 1 commit into from
Dec 4, 2018
Merged

STM32L4: before calling HAL_CRYP_DeInit initialize the Instance member #8946

merged 1 commit into from
Dec 4, 2018

Conversation

juhoeskeli
Copy link
Contributor

Description

Tested with wise 1570 (STM32L4) & cloud client. When function aes_set_key is called the function HAL_CRYP_DeInit calls macro __HAL_CRYP_DISABLE which dereferences null pointer (Instance). The target ends up HardFaulting. The issue was uncovered by the MPU overhaul change which was recently introduced.

To fix this, the Instance member should be initialized before calling HAL_CRYP_DeInit. This fixes the issue for workaround #8922.

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

@juhoeskeli
Copy link
Contributor Author

@0xc0170 please take a look

@0xc0170 0xc0170 requested a review from a team December 3, 2018 10:40
@0xc0170
Copy link
Contributor

0xc0170 commented Dec 3, 2018

@ARMmbed/team-st-mcd we would like to take this to the 5.11-rc2 (labeled as such), can you please review ?

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 3, 2018

Tested with wise 1570 (STM32L4) & cloud client. When function aes_set_key is called the function HAL_CRYP_DeInit calls macro __HAL_CRYP_DISABLE which dereferences null pointer (Instance). The target ends up HardFaulting. The issue was uncovered by the MPU overhaul change which was recently introduced.

Nice catch

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 3, 2018

Travis failure will be fixed on master soon (we will request rebase once done). See #8945

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 3, 2018

Travis failure will be fixed on master soon (we will request rebase once done). See #8945

The fix is on master, if you rebase, it should allow travis to run

@juhoeskeli
Copy link
Contributor Author

Done rebasing

@cmonr
Copy link
Contributor

cmonr commented Dec 3, 2018

CI started

@mbed-ci
Copy link

mbed-ci commented Dec 3, 2018

Test run: SUCCESS

Summary: 4 of 4 test jobs passed
Build number : 1
Build artifacts
Build logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants