Page MenuHomeFreeBSD

pf: Fix unaligned checksum updates
ClosedPublic

Authored by kp on Dec 21 2020, 9:09 AM.
Tags
None
Referenced Files
F139372403: D27696.diff
Thu, Dec 11, 9:32 AM
Unknown Object (File)
Sun, Dec 7, 10:01 PM
Unknown Object (File)
Sun, Dec 7, 2:51 PM
Unknown Object (File)
Wed, Nov 26, 5:13 PM
Unknown Object (File)
Mon, Nov 24, 9:45 AM
Unknown Object (File)
Sun, Nov 23, 11:24 PM
Unknown Object (File)
Mon, Nov 17, 1:30 AM
Unknown Object (File)
Nov 7 2025, 8:31 PM

Details

Summary

The algorithm we use to update checksums only works correctly if the
updated data is aligned on 16-bit boundaries (relative to the start of
the packet).

Import the OpenBSD fix for this issue.

PR: 240416
Obtained from: OpenBSD

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 35568
Build 32468: arc lint + arc unit

Event Timeline

kp requested review of this revision.Dec 21 2020, 9:09 AM

I guess you need a similar dance (for 16-bit) in pf_normalize_tcpopt() when updating the MSS.

Also handle the MSS update case.

This revision is now accepted and ready to land.Dec 21 2020, 11:11 PM

Ensure we actually update the packet, even when checksum flags indicate the checksum doesn't need an update.

This revision now requires review to proceed.Dec 22 2020, 12:00 PM
This revision is now accepted and ready to land.Dec 22 2020, 12:18 PM