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

[Coverity CID: 220534] Out-of-bounds access in tests/arch/arm/arm_no_multithreading/src/main.c #34007

Closed
zephyrbot opened this issue Apr 3, 2021 · 2 comments · Fixed by #34321
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug

Comments

@zephyrbot
Copy link
Collaborator

Static code scan issues found in file:

https://github.com/zephyrproject-rtos/zephyr/tree/b86f7addae05add0db45d9b528854235fbb93a48/tests/arch/arm/arm_no_multithreading/src/main.c#L104

Category: Memory - corruptions
Function: test_main
Component: Tests
CID: 220534

Details:

arch_irq_connect_dynamic(i, 0 /* highest priority */,

98    
99         __ASSERT(i >= 0,
100             "No available IRQ line to use in the test\n");
101    
102         printk("Available IRQ line: %u\n", i);
103    
>>>     CID 220534:  Memory - corruptions  (OVERRUN)
>>>     Overrunning callee's array of size 128 by passing argument "i" (which evaluates to 4294967295) in call to "arch_irq_connect_dynamic".
104         arch_irq_connect_dynamic(i, 0 /* highest priority */,
105             arm_isr_handler,
106             NULL,
107             0);
108    
109         NVIC_EnableIRQ(i);

Please fix or provide comments in coverity using the link:

https://scan9.coverity.com/reports.htm#v29271/p12996

Note: This issue was created automatically. Priority was set based on classification
of the file affected and the impact field in coverity. Assignees were set using the CODEOWNERS file.

@zephyrbot zephyrbot added bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug labels Apr 3, 2021
@ioannisg
Copy link
Member

That's a false positive - as the ASSERT statement above will catch the case if i becomes negative. Somehow we need to tell coverity that ASSERTS are ON, on tests. I'll "fix" this in the code, anyways...

@ioannisg
Copy link
Member

Need to close this manually, since I had forgotten to properly add the "Fixes" comment in the PR

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

Successfully merging a pull request may close this issue.

3 participants