Skip to content

fix(corekit): non-zero padding octets are zeroed on rebuild #1223

Closed

Description

@JarryShaw

Describe the bug
PaddingField never stores the octets it read, so any non-zero padding comes back as zeros.

To Reproduce

  • TCP options 020405b4 00aabbcc rebuild as …00000000.
  • SCTP DATA padding ffffff rebuilds as 000000.
  • An SCTP parameter pad ee rebuilds as 00.

Expected behavior
Padding octets round-trip as read. This may overlap the corekit round-trip audit, which is still running.

Found by the transport round-trip audit (#1202). The repro is from the audit report and I have not re-run it yet.

Activity

  1. added
    fixPull requests that fix a defect (fix: subject prefix)
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 7, 2026
  2. JarryShaw commented on Oct 7, 2026

    @JarryShaw
    OwnerAuthor

    Blocked until the corekit round-trip audit reports, so the fix lands with whatever else it finds in PaddingField.

  3. added
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 7, 2026
  4. JarryShaw commented on Oct 7, 2026

    @JarryShaw
    OwnerAuthor

    Twelve more HIP sites for this issue, listed by the #1342 cross-review in schema/internet/hip.py: R1_COUNTER :563, NAT_TRAVERSAL_MODE :818, ENCRYPTED :849, NOTIFICATION :1056, REG_FROM :1165, ESP_TRANSFORM :1207, PAYLOAD_MIC :1256, ROUTE_DST :1304, RELAY_FROM :1426, RELAY_TO :1443, OVERLAY_TTL :1458 and ROUTE_VIA :1476. Eleven were confirmed by writing 0xff and rebuilding; ENCRYPTED is read from the schema only. The 13th HIP site, Locator.flags, is a BitField and is filed separately as #1365.

  5. JarryShaw commented on Oct 8, 2026

    @JarryShaw
    OwnerAuthor

    More sites with the same root cause (PaddingField packs zeros, so non-zero octets parse silently and come back zeroed). The PaddingField sweep found these and I re-checked them on main at 79949ec3d. The issue does not yet list any of them:

    • HOPOPT / IPv6-Opts PadN data, schema/internet/hopopt.py:427 and ipv6_opts.py:427: 3b00 0104 aabbccdd becomes 3b00 0104 00000000.
    • QS Report reserved, hopopt.py:687 and ipv6_opts.py:692: … 80 aa … becomes … 80 00 ….
    • IPv6 Frag reserved octet, ipv6_frag.py:38; SR0 / Type 2 reserved(4), ipv6_route.py:162, :178.
    • HTTP/2 Pad, httpv2.py:240, :289, :387 (RFC 7540 §6.1 lets a receiver reject non-zero pad); OSPF crypto reserved, ospf.py:47.

    Checked and fine, either rejected at parse or unreachable: IPv4 LSR/RR/SSR remainders, IPv6 MPL pad, IPv4 header padding. IPv4 TS is #1392 (fixed in #1399). The CALIPSO length loss is a separate defect, now #1403. Still unprobed: PCAP-NG alignment pads, IPv6-Route RPL pad and L2TP offset pad.

  6. JarryShaw commented on Oct 8, 2026

    @JarryShaw
    OwnerAuthor

    One more site, found while checking #1235: the Quick-Start report "not used" octet is a PaddingField(length=1), so 3b01260680ff12345679… rebuilds as …800012345679….

  7. JarryShaw commented on Oct 8, 2026

    @JarryShaw
    OwnerAuthor

    One more site, from the #1420 cross-review: the Simple Packet Block padding is a PaddingField (schema/misc/pcapng.py:1549), so with original_len=5 and data abcdefgh the 3 non-zero pad octets rebuild as zeros (24 → 24 octets, not exact).

  8. JarryShaw commented on Oct 8, 2026

    @JarryShaw
    OwnerAuthor

    Unblocked: the corekit round-trip audit has filed its findings (#1288–#1300, filed 2026-10-07), and #1288 closed with #1416. A worker is on it now, on branch fix/1223-padding-kept-as-captured. The worker also covers #1329's MH PadN remainder. The IPv4 Quick-Start report site is held for a follow-up, because the #1209 worker owns ipv4.py in this wave.

  9. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Oct 8, 2026
  10. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixPull requests that fix a defect (fix: subject prefix)

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions