rust-vmm / vmm-sys-util

Helpers and utilities used by multiple rust-vmm components and VMMs
BSD 3-Clause "New" or "Revised" License
78 stars 64 forks source link

IoControlBlock definition incorrect on big endian architectures. #196

Open plugwash opened 1 year ago

plugwash commented 1 year ago

While working on the 32-bit tests, I compared the definitions of some data structures with the C originals and noticed that pub struct IoControlBlock had not been correctly translated from the original C code. The original C code contains a macro which re-orders the fields on big endian architectures. I presume that the field in question was originally a 64-bit integer and was later changed to two 32-bit integers.

Nothing in vmm-sys-util itself seems to touch the fields in question. I haven't looked in downstream crates.

patch (mostly untested, doesn't break compilation but there don't seem to be any tests that touch the fields in question) at https://salsa.debian.org/rust-team/debcargo-conf/-/blob/1d296fda82959651ff7358066dcb4425941a2060/src/vmm-sys-util/debian/patches/fix-big-endian.patch