mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-06 10:32:10 +00:00
crosvm runs as a 32-bit binary on arm devices but arcvm has a 64-bit kernel with a 64-bit userspace. Since the {GET,SET}FLAGS ioctls use a c_long as part of the encoding, the encoded value changes based on whether a long is 4 bytes or 8 bytes. This causes a mismatch where the server expects the 4 byte encoding while the VM sends the 8 byte encoding. Check for both encodings when handling ioctls. The actual flag value itself is actually just a c_int and not a c_long as you might expect from the encoding. Since that has the same width on both 32 and 64 bit systems we don't have to change the actual value that's returned. BUG=b:163729385 TEST=lsattr and chattr still work inside the VM. Also use a test program to check that the 64-bit versions also work inside the VM. Change-Id: I77e98ea83372306597f7b3eb2bd675035be98d5d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2352281 Auto-Submit: Chirantan Ekbote <chirantan@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: Chirantan Ekbote <chirantan@chromium.org> Commit-Queue: Chirantan Ekbote <chirantan@chromium.org> |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |