Page MenuHomeFreeBSD

Set the proper vnet in IPSec callback functions.
ClosedPublic

Authored by jhb on Mar 19 2018, 10:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 22 2023, 9:46 PM
Unknown Object (File)
Aug 7 2023, 8:24 PM
Unknown Object (File)
Aug 7 2023, 8:19 PM
Unknown Object (File)
Aug 7 2023, 8:19 PM
Unknown Object (File)
Aug 4 2023, 9:23 AM
Unknown Object (File)
Jul 15 2023, 4:38 PM
Unknown Object (File)
Jun 26 2023, 10:58 PM
Unknown Object (File)
Apr 8 2023, 7:01 AM
Subscribers

Details

Summary

When using hardware crypto engines, the callback functions used to handle
an IPSec packet after it has been encrypted or decrypted can be invoked
asynchronously from a worker thread that is not associated with a vnet.
Extend 'struct xform_data' to include a vnet pointer and save the current
vnet in this new member when queueing crypto requests in IPSec. In the
IPSec callback routines, use the new member to set the current vnet while
processing the modified packet.

This fixes a panic when using hardware offload such as ccr(4) with IPSec
after VIMAGE was enabled in GENERIC.

Test Plan
  • ping when using ccr(4) to offload crypto for an IPSec tunnel using AES-CBC + SHA1 HMAC.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Sounds good to me. I think if the vnet disappears between before the callback we have entirely different problems.

PS: It's spelt IPsec (lower case 's'; IP security).

This revision is now accepted and ready to land.Mar 20 2018, 3:56 PM
This revision was automatically updated to reflect the committed changes.