cloud-hypervisor/virtio-devices
Alyssa Ross e7c7a304e8 virtio-devices: fix UB getting tty size
TIOCGWINSZ modifies its argument, so it needs to mutably borrow it.
Unfortunately, ioctl()'s signature is not able to enforce this, and
the write happens in the kernel, so I don't think anything like miri,
valgrind, UBSan, etc. would have been able to catch this.

The UB passing an immutable reference caused resulted, for me, in
get_win_size() returning (0, 0) since LLVM commit
9a09c737a052 ("[BasicAA] Make isNotCapturedBeforeOrAt() check for
calls more precise (#69931)").

I've had a look through the other ioctl() calls in Cloud Hypervisor,
and I don't think any others have the same problem.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
2024-07-03 21:26:04 +00:00
..
src virtio-devices: fix UB getting tty size 2024-07-03 21:26:04 +00:00
build.rs build: Add "fuzzing" as a valid cfg(..) attribute 2024-05-08 08:10:28 +00:00
Cargo.toml build: Fix Cargo.toml formatting 2024-06-18 16:19:12 +00:00