commit | ea9d3d4b4be5954c3ef28c4aee5ce367dc318a86 | [log] [tgz] |
---|---|---|
author | Tom Bergan <tombergan@fuchsia.infra.roller.google.com> | Wed Dec 01 03:46:35 2021 +0000 |
committer | Copybara-Service <copybara-worker@google.com> | Tue Nov 30 19:47:48 2021 -0800 |
tree | 433d8883be1a72adda802a8c7739086bf8ad631d | |
parent | 2aefa8f13b3ac09ad178478e0c58667958c8f6a4 [diff] |
[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
This repository contains Fuchsia's Global Integration manifest files.
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.
First install Jiri.
Next run:
$ jiri init $ jiri import minimal https://fuchsia.googlesource.com/integration $ jiri update
Third party projects should have their own subdirectory in ./third_party
.