HomeFreeBSD

Set the proper vnet in IPsec callback functions.

Description

Set the proper vnet in IPsec callback functions.

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.

Reported by: Sony Arpita Das and Harsh Jain @ Chelsio
Reviewed by: bz
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D14763

Details

Provenance
jhbAuthored on
Reviewer
bz
Differential Revision
D14763: Set the proper vnet in IPSec callback functions.
Parents
rS331247: Check for wrap-around in vm_phys_alloc_seg_contig().
Branches
Unknown
Tags
Unknown