Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1639331

[PATCH 4/4] crypto: Documentation: fix none signal safe sample

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Gilad Ben-Yossef <gilad@benyossef.com>
Newsgroups linux.kernel
Subject [PATCH 4/4] crypto: Documentation: fix none signal safe sample
Date Thu, 11 May 2017 14:00:01 +0200
Message-ID <tFUVb-5Qu-1@gated-at.bofh.it> (permalink)
References <tFUVb-5Qu-3@gated-at.bofh.it>
X-Mailer git-send-email 2.1.4
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 28
Organization linux.* mail to news gateway
X-Original-Cc Ofir Drang <ofir.drang@arm.com>, Gilad Ben-Yossef <gilad.benyossef@arm.com>, Eric Biggers <ebiggers3@gmail.com>, linux-crypto@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, keyrings@vger.kernel.org
X-Original-Date Thu, 11 May 2017 14:53:45 +0300
X-Original-Message-ID <1494503626-15877-5-git-send-email-gilad@benyossef.com>
X-Original-References <1494503626-15877-1-git-send-email-gilad@benyossef.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1639331

Show key headers only | View raw


The sample code was showing use of wait_for_completion_interruptible()
for waiting for an async. crypto op to finish. However, if a signal
arrived it would free the buffers used even while crypto HW might
still DMA from/into the buffers.

Resolve this by using wait_for_completion() instead.

Reported-by: Eric Biggers <ebiggers3@gmail.com>
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
---
 Documentation/crypto/api-samples.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/crypto/api-samples.rst b/Documentation/crypto/api-samples.rst
index d021fd9..944f08b 100644
--- a/Documentation/crypto/api-samples.rst
+++ b/Documentation/crypto/api-samples.rst
@@ -48,7 +48,7 @@ Code Example For Symmetric Key Cipher Operation
             break;
         case -EINPROGRESS:
         case -EBUSY:
-            rc = wait_for_completion_interruptible(
+            rc = wait_for_completion(
                 &sk->result.completion);
             if (!rc && !sk->result.err) {
                 reinit_completion(&sk->result.completion);
-- 
2.1.4

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 4/4] crypto: Documentation: fix none signal safe sample Gilad Ben-Yossef <gilad@benyossef.com> - 2017-05-11 14:00 +0200

csiph-web