Page MenuHomeFreeBSD

irdma: improve TCP header validation
Needs ReviewPublic

Authored by rscheff on Sat, Jul 18, 1:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jul 27, 12:53 AM
Unknown Object (File)
Sun, Jul 26, 9:04 PM
Unknown Object (File)
Sat, Jul 25, 8:24 AM
Unknown Object (File)
Sat, Jul 25, 2:03 AM
Unknown Object (File)
Fri, Jul 24, 10:59 PM
Unknown Object (File)
Fri, Jul 24, 10:34 PM
Unknown Object (File)
Fri, Jul 24, 5:55 PM
Unknown Object (File)
Fri, Jul 24, 5:24 PM

Details

Reviewers
tuexen
markj
kgalazka
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
transport
Summary
iWARP handling code deals with TCP header processing outside of the normal TCP stack.
Certain validation checks to verify the internal integrity of the TCP header were missing.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 74913
Build 71796: arc lint + arc unit

Event Timeline

Owners added a reviewer: Restricted Owners Package.Sat, Jul 18, 1:29 PM
  • updating phabricator to show proper diff

To whom it may concern: the same problem seems to exist in the Linux source code: cm.c.

sys/dev/irdma/irdma_cm.c
2679

Indentation here looks wrong, same below.

sys/dev/irdma/irdma_utils.c
1544

Why only check this here, and not in the !gen1 case in irdma_puda_get_tcpip_info()?

If we're validating the offset here, why do it again in the functions above?

  • add a tcp_hlen check oversight and indentation
rscheff added inline comments.
sys/dev/irdma/irdma_utils.c
1544

Indeed, missed the other occurance initially.

sys/dev/irdma/irdma_cm.c
837

Why not make it an error?

sys/dev/irdma/irdma_utils.c
1544

My second comment still stands: what's the purpose of checking th_off < 5 above? That case is already handled here and in irdma_puda_get_tcpip_info().

1591

I think you still need to check that this subtraction won't underflow?