CVE-2026-143454: RDMA/mlx5: Use DEFINE_RAW_FLEX for leftovers flow attributes
In the Linux kernel, the following vulnerability has been resolved:
RDMA/mlx5: Use DEFINERAWFLEX for leftovers flow attributes
Commit e91fb8b9d0ed ("RDMA/mlx5: Avoid flexible array warning") split the leftoversspecs[] array into two separate structs to silence the sparse "array of flexible structures" warning, but in doing so reversed the member order: ethflow was placed before flowattr.
createflowrule() locates the flow specs with:
ibflow = (void )flowattr + sizeof(flowattr);
which expects the spec data to immediately follow the ibflowattr. With the reversed order, flowattr is the last member, so ibflow points past the end of the struct and the numofspecs = 1 loop reads out-of-bounds memory (whatever static data follows in the .data section), producing incorrect flow rules or a crash.
Rebuild the leftovers attributes with DEFINERAWFLEX(), which declares an on-stack struct ibflowattr with a properly sized trailing flows[] array. The ETH spec lives in flows[0].eth at exactly the offset createflowrule() expects, so no layout-dependent composite struct is needed. This also avoids embedding a structure that contains a flexible array member as a non-last member, which would trigger -Wflex-array-member-not-at-end once the warning is enabled.
Affected Software
Event History
Frequently Asked Questions
What systems are realistically exposed to this issue?
Systems running an affected Linux kernel and using the RDMA/mlx5 driver path that creates the affected leftovers flow rules are exposed. The issue occurs in _create_flow_rule() when it processes the malformed leftovers flow-attribute layout.
What is the practical impact if the vulnerable code path is reached?
The driver reads out-of-bounds memory while processing one flow specification. This can create incorrect flow rules or crash the system.
How can I tell whether a kernel contains the fix?
Check whether the kernel includes one of the referenced stable commits: 2398e9e726cca24b2535ba2bb30ec088487602d7, 4a8216314e864d94cbda0c5212aab3fa2020e64c, or e43913aabd35eef837edef29e93f15e15bdeeacd. The fix rebuilds the leftovers attributes with DEFINE_RAW_FLEX() so the Ethernet flow specification follows ib_flow_attr at the expected offset.