HomeFreeBSD

Take extra reference to security policy before calling crypto_dispatch().

Description

Take extra reference to security policy before calling crypto_dispatch().

Currently we perform crypto requests for IPSEC synchronous for most of
crypto providers (software, aesni) and only VIA padlock calls crypto
callback asynchronous. In synchronous mode it is possible, that security
policy will be removed during the processing crypto request. And crypto
callback will release the last reference to SP. Then upon return into
ipsec[46]_process_packet() IPSECREQUEST_UNLOCK() will be called to already
freed request. To prevent this we will take extra reference to SP.

PR: 201876
Sponsored by: Yandex LLC

Details

Provenance
aeAuthored on
Parents
rS288417: Have lockstat(1) trace locks by name rather than by address.
Branches
Unknown
Tags
Unknown