[roll] Roll fuchsia [vmm] VirtioQueueFake: ensure descriptor data is properly aligned

Currently, VirtioQueueFake ensures the first descriptor's data is
aligned but does not make similar guarantees for subsequent descriptors.
For example, the following code has undefined behavior on some
architectures because resp->status is not 8-byte aligned.

  struct Req {
    uint8_t code;
  }
  struct Resp {
    uint64_t status;
  }
  Req req;
  Resp* resp;
  DescriptorChainBuilder(q)
      .AppendReadableDescriptor(&req, sizeof(req))
      .AppendWritableDescriptor(&resp, sizeof(*resp))
      .Build();
  // ... wait for response
  EXPECT_EQ(resp->status, 1);  // UB: unaligned access

To fix this, VirtioQueueFake::WriteDesc now ensures data_begin_ is
aligned after writing each descriptor.

Tested in the follow-up CL: tests in that CL pass with this change, but
have UBSan failures without this change.

Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/612412
Original-Revision: 8f44b6fcc0bba1a948ef619d7b023013360d8f58
GitOrigin-RevId: 259217289da27f3a7bb1071f1d9a1896c5df203b
Change-Id: Ie18c851a2a73773c060916a0d114791850666ca7
1 file changed
tree: 433d8883be1a72adda802a8c7739086bf8ad631d
  1. infra/
  2. third_party/
  3. cts
  4. firmware
  5. flower
  6. jiri.lock
  7. minimal
  8. prebuilts
  9. README.md
  10. stem
  11. test_durations
README.md

Integration

This repository contains Fuchsia's Global Integration manifest files.

Making changes

All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.

Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance via the IRC channel #fuchsia on Freenode.

Obtaining the source

First install Jiri.

Next run:

$ jiri init
$ jiri import minimal https://fuchsia.googlesource.com/integration
$ jiri update

Third party

Third party projects should have their own subdirectory in ./third_party.