Skip to contentSkip to conversation

New: IPsec AH ICV Padding for IPv4

Bug 208121 Stephen Hemminger 1 participant 1 message Jun 10, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Begin forwarded message:

Date: Wed, 10 Jun 2020 09:32:26 +0000
From: [email protected]
To: [email protected]
Subject: [Bug 208121] New: IPsec AH ICV Padding for IPv4

https://bugzilla.kernel.org/show_bug.cgi?id=208121

            Bug ID: 208121
           Summary: IPsec AH ICV Padding for IPv4
           Product: Networking
           Version: 2.5
    Kernel Version: 5.4.0.37.40
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Other
          Assignee: [email protected]
          Reporter: [email protected]
        Regression: No

Created attachment 289597
--> https://bugzilla.kernel.org/attachment.cgi?id=289597&action=edit
packet capture

According to RFC 4302[1]:

Quoted 7 lines

As mentioned in Section 2.6, the ICV field may include explicit padding if required to ensure that the AH header is a multiple of 32 bits (IPv4) or 64 bits (IPv6). If padding is required, its length is determined by two factors:

- the length of the ICV
- the IP protocol version (v4 or v6)

[...]

Quoted 2 lines

Inclusion of padding in excess of the minimum amount required to satisfy IPv4/IPv6 alignment requirements is prohibited.

However, in the Linux implementation padding is always added (and expected) so that the Authentication Header (AH) is a multiple of 64 bits, independent of the IP version used. This is an issue when the IPsec AH with IPv4 is used with HMAC authentication e.g. HMAC-sha256-128. In this case the ICV field is 128 bits long, which results in an AH length of 96 + 128 = 224 bits. Even though this is a multiple of 32 bits, Linux adds an additional 32 bits of padding. Additionally, Linux drops incoming packets that do not have this padding.

In the attached file the outgoing packets, that are wrongfully padded can be seen.

[1] https://tools.ietf.org/html/rfc4302#section-3.3.3.2.1

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.