Modified strcture data element from fixed size to flexible array.#8997
Modified strcture data element from fixed size to flexible array.#8997chvamshi-xilinx merged 1 commit intoXilinx:2024.2from
Conversation
…linx#8669) Signed-off-by: Manoj Takasi <mtakasi@amd.com> Co-authored-by: Manoj Takasi <mtakasi@amd.com>
stsoe
left a comment
There was a problem hiding this comment.
I am not comfortable with ert.h changes from data[1] -> data[]. While I completely agree that we should have used data[] from inception of this code, changing it now has ripple effects, e.g. sizeof(ert_start_kernel_cmd) changes, and who knows what XRT is relying doing and relying on?
I am all for data[] for all new structs added, but leave existing ones alone.
I take that back given that this is a cherry pick from code that was merged to master long ago. Please ignore my comment above. Also, user space is unchanged, so whatever it does with sizeof is unaffected (good). It would be good if we had a project to consolidate all code on data[], which is exactly the right to use. |
|
@ManojTakasi , As this is a big change. Can you please make sure edge tests also works with this change. You can try couple of basic tests. |
|
Hi @chvamshi-xilinx, I tested the vadd and simple_graph applications after applying these changes, and both tests working as expected. |
Problem solved by the commit
This PR is cherry-picked from #8669 and #8746
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
Documentation impact (if any)