Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Gilad Ben-Yossef <gilad@benyossef.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
	driverdev-devel@linuxdriverproject.org,
	devel@driverdev.osuosl.org
Cc: Ofir Drang <ofir.drang@arm.com>,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: [PATCH v2 7/7] staging: ccree: use signal safe completion wait
Date: Thu, 22 Jun 2017 16:37:01 +0300	[thread overview]
Message-ID: <1498138623-6126-8-git-send-email-gilad@benyossef.com> (raw)
In-Reply-To: <1498138623-6126-1-git-send-email-gilad@benyossef.com>

We were waiting for a completion notification of HW DMA
operation using an interruptible wait which can result
in data corruption if a signal interrupted us while
DMA was not yet completed.

Fix this by moving to uninterrupted wait.

Fixes: abefd6741d ("staging: ccree: introduce CryptoCell HW driver").

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
---
 drivers/staging/ccree/ssi_request_mgr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/ccree/ssi_request_mgr.c b/drivers/staging/ccree/ssi_request_mgr.c
index cffc8de..87f5ab6 100644
--- a/drivers/staging/ccree/ssi_request_mgr.c
+++ b/drivers/staging/ccree/ssi_request_mgr.c
@@ -382,7 +382,8 @@ int send_request(
 		/* Wait upon sequence completion.
 		 *  Return "0" -Operation done successfully.
 		 */
-		return wait_for_completion_interruptible(&ssi_req->seq_compl);
+		wait_for_completion(&ssi_req->seq_compl);
+		return 0;
 	} else {
 		/* Operation still in process */
 		return -EINPROGRESS;
-- 
2.1.4

      parent reply	other threads:[~2017-06-22 13:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-22 13:36 [PATCH v2 0/7] staging: ccree: bug fixes and TODO items for 4.13 Gilad Ben-Yossef
2017-06-22 13:36 ` [PATCH v2 1/7] staging: ccree: fix hash import/export Gilad Ben-Yossef
2017-06-22 13:58   ` Dan Carpenter
2017-06-25  6:21     ` Gilad Ben-Yossef
2017-06-22 13:36 ` [PATCH v2 2/7] staging: ccree: register setkey for none hash macs Gilad Ben-Yossef
2017-06-23 16:29   ` Greg Kroah-Hartman
2017-06-25  6:28     ` Gilad Ben-Yossef
2017-06-22 13:36 ` [PATCH v2 3/7] staging: ccree: add support for older HW revisions Gilad Ben-Yossef
2017-06-23 16:30   ` Greg Kroah-Hartman
2017-06-22 13:36 ` [PATCH v2 4/7] staging: ccree: remove unused function Gilad Ben-Yossef
2017-06-22 13:36 ` [PATCH v2 5/7] staging: ccree: add clock management support Gilad Ben-Yossef
2017-06-23 16:31   ` Greg Kroah-Hartman
2017-06-22 13:37 ` [PATCH v2 6/7] staging: ccree: add DT bus coherency detection Gilad Ben-Yossef
2017-06-22 13:37 ` Gilad Ben-Yossef [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1498138623-6126-8-git-send-email-gilad@benyossef.com \
    --to=gilad@benyossef.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ofir.drang@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox