Page MenuHomeFreeBSD

ktls: Fix capability checks in ktls_reset_receive_tag()
ClosedPublic

Authored by olivier on Thu, Oct 15, 7:51 PM.
Tags
None
Referenced Files
F176282649: D60757.id190017.diff
Sat, Oct 17, 3:42 PM
F176256220: D60757.diff
Sat, Oct 17, 9:56 AM
Unknown Object (File)
Fri, Oct 16, 5:06 PM
Unknown Object (File)
Fri, Oct 16, 3:47 PM
Unknown Object (File)
Fri, Oct 16, 1:47 PM
Unknown Object (File)
Fri, Oct 16, 6:18 AM
Unknown Object (File)
Fri, Oct 16, 6:18 AM
Unknown Object (File)
Fri, Oct 16, 6:18 AM
Subscribers

Details

Summary

IFCAP2_RXTLS4 and IFCAP2_RXTLS6 are bit numbers, not masks, so
ktls_reset_receive_tag() tested if_capenable2 against 0 for IPv4 and
against the RXTLS4 bit for IPv6. An IPv4 connection with NIC receive
TLS offload thus never got a new receive tag after its packets moved
to another interface, and fell back to software decryption for good.
c721694 fixed the same checks in ktls_alloc_rcv_tag(); use
IFCAP2_BIT() here as well.

Found with CBMC.

Fixes: fe8c78f ("ktls: Add full support for TLS RX offloading via network interface.")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

olivier created this revision.
olivier added a reviewer: jhb.

@kib The more errors like this that I see, the more firmly convinced I am that ifcap2 was a mistake, and that we should just have just extended if_capabilities / if_capenable to 64-bits.

This revision is now accepted and ready to land.Thu, Oct 15, 10:04 PM