aboutsummaryrefslogtreecommitdiffstats
path: root/net/tls/tls_sw.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2019-03-11 15:37:55 -0400
committerDan Williams <dan.j.williams@intel.com>2019-03-11 15:37:55 -0400
commit4083014e32699af04a8e6eaa4855b08dba36a47a (patch)
treefa37f9f9691fe64ca8a3c0cdc0315dc12462e6e4 /net/tls/tls_sw.c
parent6fd96ff557963de8e62842a0dc360a6e3610d2bb (diff)
parent78153dd45e7e0596ba32b15d02bda08e1513111e (diff)
Merge branch 'for-5.1/nfit/ars' into libnvdimm-for-next
Merge several updates to the ARS implementation. Highlights include: * Support retrieval of short-ARS results if the ARS state is "requires continuation", and even if the "no_init_ars" module parameter is specified. * Allow busy-polling of the kernel ARS state by allowing root to reset the exponential back-off timer. * Filter potentially stale ARS results by tracking query-ARS relative to the previous start-ARS.
Diffstat (limited to 'net/tls/tls_sw.c')
-rw-r--r--net/tls/tls_sw.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 11cdc8f7db63..bf5b54b513bc 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -439,6 +439,8 @@ static int tls_do_encryption(struct sock *sk,
439 struct scatterlist *sge = sk_msg_elem(msg_en, start); 439 struct scatterlist *sge = sk_msg_elem(msg_en, start);
440 int rc; 440 int rc;
441 441
442 memcpy(rec->iv_data, tls_ctx->tx.iv, sizeof(rec->iv_data));
443
442 sge->offset += tls_ctx->tx.prepend_size; 444 sge->offset += tls_ctx->tx.prepend_size;
443 sge->length -= tls_ctx->tx.prepend_size; 445 sge->length -= tls_ctx->tx.prepend_size;
444 446
@@ -448,7 +450,7 @@ static int tls_do_encryption(struct sock *sk,
448 aead_request_set_ad(aead_req, TLS_AAD_SPACE_SIZE); 450 aead_request_set_ad(aead_req, TLS_AAD_SPACE_SIZE);
449 aead_request_set_crypt(aead_req, rec->sg_aead_in, 451 aead_request_set_crypt(aead_req, rec->sg_aead_in,
450 rec->sg_aead_out, 452 rec->sg_aead_out,
451 data_len, tls_ctx->tx.iv); 453 data_len, rec->iv_data);
452 454
453 aead_request_set_callback(aead_req, CRYPTO_TFM_REQ_MAY_BACKLOG, 455 aead_request_set_callback(aead_req, CRYPTO_TFM_REQ_MAY_BACKLOG,
454 tls_encrypt_done, sk); 456 tls_encrypt_done, sk);
@@ -1792,7 +1794,9 @@ void tls_sw_free_resources_tx(struct sock *sk)
1792 if (atomic_read(&ctx->encrypt_pending)) 1794 if (atomic_read(&ctx->encrypt_pending))
1793 crypto_wait_req(-EINPROGRESS, &ctx->async_wait); 1795 crypto_wait_req(-EINPROGRESS, &ctx->async_wait);
1794 1796
1797 release_sock(sk);
1795 cancel_delayed_work_sync(&ctx->tx_work.work); 1798 cancel_delayed_work_sync(&ctx->tx_work.work);
1799 lock_sock(sk);
1796 1800
1797 /* Tx whatever records we can transmit and abandon the rest */ 1801 /* Tx whatever records we can transmit and abandon the rest */
1798 tls_tx_records(sk, -1); 1802 tls_tx_records(sk, -1);