video: decoder: vda: use wrapping multiplication for timestamp

When decoding using libvda, the frame timestamp is truncated to 32-bits
and needs to be restored to its original value. This is done by doing a
multiplication with the truncation factor. However, if libvda gives us
an invalid timestamp, the multiplication can overflow and cause the
video device process to panic. Avoid this by switching to a wrapping
multiplication - the passed timestamp will still be invalid, but the
decoder device will signal an error instead of crashing.

BUG=None
TEST=cargo build --features "video-decoder,libvda"

Change-Id: Iabe683a997e0e9dea8c2bea53ef520f53868e590
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3958881
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
1 file changed
tree: ae2e448add41308d47e73d70468787d9ba5a15e2
  1. .cargo/
  2. .devcontainer/
  3. .github/
  4. .vscode/
  5. aarch64/
  6. acpi_tables/
  7. anti_tamper/
  8. arch/
  9. argh_helpers/
  10. base/
  11. bit_field/
  12. broker_ipc/
  13. common/
  14. crash_report/
  15. cros_async/
  16. crosvm-fuzz/
  17. crosvm_control/
  18. crosvm_plugin/
  19. devices/
  20. disk/
  21. docs/
  22. fuse/
  23. gpu_display/
  24. hypervisor/
  25. infra/
  26. integration_tests/
  27. io_uring/
  28. kernel_cmdline/
  29. kernel_loader/
  30. kvm/
  31. kvm_sys/
  32. libcras_stub/
  33. linux_input_sys/
  34. logo/
  35. media/
  36. metrics/
  37. net_sys/
  38. net_util/
  39. power_monitor/
  40. prebuilts/
  41. protos/
  42. qcow_utils/
  43. resources/
  44. rutabaga_gfx/
  45. sandbox/
  46. seccomp/
  47. serde_keyvalue/
  48. src/
  49. system_api/
  50. tests/
  51. third_party/
  52. tools/
  53. tpm2/
  54. tpm2-sys/
  55. tracing/
  56. tube_transporter/
  57. usb_sys/
  58. usb_util/
  59. vfio_sys/
  60. vhost/
  61. virtio_sys/
  62. vm_control/
  63. vm_memory/
  64. win_audio/
  65. win_util/
  66. x86_64/
  67. .dockerignore
  68. .gitignore
  69. .gitmodules
  70. .rustfmt.toml
  71. ARCHITECTURE.md
  72. build.rs
  73. Cargo.lock
  74. Cargo.toml
  75. CONTRIBUTING.md
  76. DIR_METADATA
  77. LICENSE
  78. mypy.ini
  79. OWNERS
  80. PRESUBMIT.cfg
  81. pyproject.toml
  82. README.chromeos.md
  83. README.md
  84. rust-toolchain
README.md

crosvm - The Chrome OS Virtual Machine Monitor

crosvm is a virtual machine monitor (VMM) based on Linux’s KVM hypervisor, with a focus on simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security boundary for running native applications on the Chrome OS platform. Compared to QEMU, crosvm doesn’t emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as the virtio standard.

crosvm is currently used to run Linux/Android guests on Chrome OS devices.

Logo