)]}'
{
  "commit": "fc4f6dd734c2d94dddbc6dd38871d9c67f1817a7",
  "tree": "1eee6cc4d6b2f93c7ab280dc1a48768da1a5e7d9",
  "parents": [
    "7980e3d5d89a389035793924f96682e94c867860"
  ],
  "author": {
    "name": "QUICHE team",
    "email": "quiche-dev@google.com",
    "time": "Wed Oct 28 08:33:35 2026 -0700"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Wed Oct 28 08:34:29 2026 -0700"
  },
  "message": "Fix misaligned header pointer access in CreateTcpResetPacket.\n\n### Why are we doing this?\n`//third_party/quic/qbone/platform:tcp_packet_test` currently passes on `x86_64` (`--cpu\u003dk8`) but fails on `Arm` (`--cpu\u003darm`) (see [go/multiarch-fix](http://go/multiarch-fix)).\n\nUnder `--config\u003dubsan`, `//third_party/quic/qbone/platform:tcp_packet_test` failed on Arm because `[tcp_packet.cc](http://cs/f:google3/third_party/quic/qbone/platform/tcp_packet.cc)` cast the raw byte buffer from `original_packet.data()` directly to `const ip6_hdr*` via `reinterpret_cast`. On Arm, `kReferenceTCPSYNPacket` in `[tcp_packet_test.cc](http://cs/f:google3/third_party/quic/qbone/platform/tcp_packet_test.cc)` happened to be placed at an address that was not 4-byte aligned (e.g. ending in `...b2`), whereas on x86_64 it happened to be aligned. Accessing struct members through a misaligned pointer is undefined behavior and triggered UndefinedBehaviorSanitizer\u0027s `misaligned-pointer-use` runtime error on Arm.\n\n### What changed\nIn [tcp_packet.cc](http://cs/f:google3/third_party/quic/qbone/platform/tcp_packet.cc), copy `ip6_hdr` and `tcphdr` into naturally aligned stack structures using `memcpy` rather than casting unaligned byte pointers with `reinterpret_cast`. Also verify that `original_packet.size()` is large enough to contain both `ip6_hdr` and `tcphdr` before copying the TCP header.\n\n### Verification\nVerified with `blaze test --nocache_test_results`:\n- Pre-fix `--cpu\u003dk8` (`PASS`): http://sponge2/dd1bf5ff-8512-4572-aad5-ac7dd22d6c8b\n- Pre-fix `--cpu\u003darm` (`FAIL`): http://sponge2/8f3ea8a2-678c-4166-995e-2a6c846a7e40\n- Post-fix `--cpu\u003darm` (`PASS`): http://sponge2/c76c4440-ca59-4047-acfb-d26fc3b3eac7\n- Post-fix `--cpu\u003dk8` (`PASS`): http://sponge2/cf42a087-6bfc-4f94-b77c-876d041c62f1\n\nGenerated by [Lightway](http://go/lightway) for `multiarch_divergence_fixer`: [Pipeline summary](http://g3doc/.journal/g3doc/pipeline_summary?cl\u003dgroupagent-lightway-ai/1111606) | [Run dashboard](http://go/lightway-runs?f\u003dRunId:eq:937aa2b5-4a8c-416f-9c42-c81a7fa6127e)\n\n#multiarch_divergence_fixer #fix-divergence #lightway\n\nTested:\n    Local presubmit tests passed.\nPiperOrigin-RevId: 1008932221\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6d6bd9ac701f1b4389cff944f231066fa2416cc1",
      "old_mode": 33188,
      "old_path": "quiche/quic/qbone/platform/tcp_packet.cc",
      "new_id": "c63a9faeffef137168ca8494a7c118a5b5735ae5",
      "new_mode": 33188,
      "new_path": "quiche/quic/qbone/platform/tcp_packet.cc"
    },
    {
      "type": "modify",
      "old_id": "c9ada0c77914f9b7d1b4960acff5d64acf26612b",
      "old_mode": 33188,
      "old_path": "quiche/quic/qbone/platform/tcp_packet_test.cc",
      "new_id": "fe93e62517507131a7f1e19118a54ab3cb39e443",
      "new_mode": 33188,
      "new_path": "quiche/quic/qbone/platform/tcp_packet_test.cc"
    }
  ]
}
