Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1644537
| From | Gilad Ben-Yossef <gilad@benyossef.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 4/4] crypto: Documentation: fix none signal safe sample |
| Date | 2017-05-18 15:40 +0200 |
| Message-ID | <tItON-3bL-11@gated-at.bofh.it> (permalink) |
| References | <tItON-3bL-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
[PATCH v2 4/4] crypto: Documentation: fix none signal safe sample Gilad Ben-Yossef <gilad@benyossef.com> - 2017-05-18 15:40 +0200
csiph-web