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

Dynamic interrupt does not work with multi-level interrupts #18570

Closed
dcpleung opened this issue Aug 22, 2019 · 2 comments
Closed

Dynamic interrupt does not work with multi-level interrupts #18570

dcpleung opened this issue Aug 22, 2019 · 2 comments
Assignees
Labels
area: Kernel bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Milestone

Comments

@dcpleung
Copy link
Member

There is a potential for writing into memory past _sw_isr_table[] due to the interrupt encoding with multi-level interrupts and dynamic interrupts. This is because z_isr_install() in arch/common/sw_isr_common.c simply takes the input irq to calculate a linear index to _sw_isr_table[]. However, in reality, the elements after 1st level interrupts are sparsely populated and no longer linear. For example:

  • Each level has 32 IRQs.
  • There is one 2nd level interrupts out of Bluetooth: ATT: Respond with not support error for unknown PDUs #6 of 1st level.
  • So the interrupt encoding of the 7th IRQ on 2nd level would be '0x0806'.
  • z_isr_install() sets _sw_isr_table[2054] with the ISR.
  • However, due to there is only one 2nd level interrupt, the index should be 39 (32 + 7).
  • Also note that the size of _sw_isr_table is only 64 (32 + 32).
@dcpleung dcpleung added the bug The issue is a bug, or the PR is fixing a bug label Aug 22, 2019
@aescolar aescolar added area: Kernel priority: low Low impact/importance bug labels Aug 22, 2019
@aescolar
Copy link
Member

CC @andyross @andrewboie

@rljordan-zz rljordan-zz added this to the v2.1.0 milestone Aug 27, 2019
@laurenmurphyx64 laurenmurphyx64 removed their assignment Sep 20, 2019
@dleach02 dleach02 modified the milestones: v2.1.0, v2.2.0 Dec 10, 2019
@jhedberg jhedberg modified the milestones: v2.2.0, v2.3.0 Mar 10, 2020
@carlescufi carlescufi modified the milestones: v2.3.0, v2.4.0 Jun 5, 2020
@dcpleung
Copy link
Member Author

Fixed in commit 0fb4382

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Kernel bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

8 participants