Andrey V. Elsukov 3aee70991d Fix possible double releasing for SA and SP references.
There are two possible ways how crypto callback are called: directly from
caller and deffered from crypto thread.

For outbound packets the direct call chain is the following:
 IPSEC_OUTPUT() method -> ipsec[46]_common_output() ->
 -> ipsec[46]_perform_request() -> xform_output() ->
 -> crypto_dispatch() -> crypto_invoke() -> crypto_done() ->
 -> xform_output_cb() -> ipsec_process_done() -> ip[6]_output().

The SA and SP references are held while crypto processing is not finished.
The error handling code wrongly expected that crypto callback always called
from the crypto thread context, and it did references releasing in
xform_output_cb(). But when the crypto callback called directly, in case of
error the error handling code in ipsec[46]_perform_request() also did
references releasing.

To fix this, remove error handling from ipsec[46]_perform_request() and do it
in xform_output() before crypto_dispatch().

MFC after:	10 days
2017-05-23 09:32:26 +00:00
..
2017-02-06 08:49:57 +00:00
2017-02-06 08:49:57 +00:00
2017-04-26 00:34:05 +00:00
2017-02-06 08:49:57 +00:00
2017-02-06 08:49:57 +00:00
2017-02-06 08:49:57 +00:00
2017-04-03 04:44:56 +00:00
2017-02-06 08:49:57 +00:00
2017-02-16 11:38:50 +00:00
2017-02-06 08:49:57 +00:00