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

CR-1214907 Modified strcture data element from fixed size to flexible array. #8669

Merged
merged 1 commit into from
Dec 24, 2024

Conversation

ManojTakasi
Copy link
Collaborator

Problem solved by the commit

https://jira.xilinx.com/browse/CR-1214907 We are getting UBSAN: array-index-out-of-bounds call trace while compiling xocl xclmgmt drivers in ubuntu 24.04

Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered

Reference: https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays

How problem was solved, alternative solutions (if any) and why they were rejected

Added macros to pick flexible arrays when comipiling kernel code.

Risks (if any) associated the changes in the commit

Modifications are in common files and will affect all platforms.

What has been tested and how, request additional testing if necessary

Tested on u250 by running xrt-smi examine. Ran vadd and graph testcases on vck190 .

Documentation impact (if any)

NA

Copy link
Collaborator

@stsoe stsoe left a comment

Choose a reason for hiding this comment

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

The changes to ert.h are exactly what flexible arrays should be all over the place. Iit's so confusing to have data[1], but unfortunately much code in user space accounts for the one default element; so the guard to enable for kernel space only is good.

@chvamshi-xilinx chvamshi-xilinx merged commit 7f72660 into Xilinx:master Dec 24, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants