aboutsummaryrefslogtreecommitdiff
path: root/drivers/crypto/ccree/cc_request_mgr.c
AgeCommit message (Collapse)AuthorFilesLines
2020-08-07mm, treewide: rename kzfree() to kfree_sensitive()Waiman Long1-1/+1
As said by Linus: A symmetric naming is only helpful if it implies symmetries in use. Otherwise it's actively misleading. In "kzalloc()", the z is meaningful and an important part of what the caller wants. In "kzfree()", the z is actively detrimental, because maybe in the future we really _might_ want to use that "memfill(0xdeadbeef)" or something. The "zero" part of the interface isn't even _relevant_. The main reason that kzfree() exists is to clear sensitive information that should not be leaked to other future users of the same memory objects. Rename kzfree() to kfree_sensitive() to follow the example of the recently added kvfree_sensitive() and make the intention of the API more explicit. In addition, memzero_explicit() is used to clear the memory to make sure that it won't get optimized away by the compiler. The renaming is done by using the command sequence: git grep -w --name-only kzfree |\ xargs sed -i 's/kzfree/kfree_sensitive/' followed by some editing of the kfree_sensitive() kerneldoc and adding a kzfree backward compatibility macro in slab.h. [[email protected]: fs/crypto/inline_crypt.c needs linux/slab.h] [[email protected]: fix fs/crypto/inline_crypt.c some more] Suggested-by: Joe Perches <[email protected]> Signed-off-by: Waiman Long <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Acked-by: David Howells <[email protected]> Acked-by: Michal Hocko <[email protected]> Acked-by: Johannes Weiner <[email protected]> Cc: Jarkko Sakkinen <[email protected]> Cc: James Morris <[email protected]> Cc: "Serge E. Hallyn" <[email protected]> Cc: Joe Perches <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: David Rientjes <[email protected]> Cc: Dan Carpenter <[email protected]> Cc: "Jason A . Donenfeld" <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
2020-03-12crypto: ccree - remove ancient TODO remarksGilad Ben-Yossef1-1/+0
Remove left over ancient and now misleading TODO remarks. Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-02-22crypto: ccree - grammar s/not room/no room/Geert Uytterhoeven1-1/+1
Fix grammar in a comment. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-02-22crypto: ccree - improve kerneldoc in cc_request_mgr.[ch]Geert Uytterhoeven1-19/+22
Miscellaneous improvements: - Start comment blocks with "/**" to enable kerneldoc, - Mark parameters using "@" instead of "\param", - Fix copied is_dout parameter of cc_send_request(), - Add missing function names to kerneldoc headers, - Add missing parameter descriptions. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-02-22crypto: ccree - fix retry handling in cc_send_sync_request()Geert Uytterhoeven1-4/+0
If cc_queues_status() indicates that the queue is full, cc_send_sync_request() should loop and retry. However, cc_queues_status() returns either 0 (for success), or -ENOSPC (for queue full), while cc_send_sync_request() checks for real errors by comparing with -EAGAIN. Hence -ENOSPC is always considered a real error, and the code never retries the operation. Fix this by just removing the check, as cc_queues_status() never returns any other error value than -ENOSPC. Signed-off-by: Geert Uytterhoeven <[email protected]> Acked-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-01-22crypto: ccree - fix PM race conditionGilad Ben-Yossef1-50/+0
The PM code was racy, possibly causing the driver to submit requests to a powered down device. Fix the race and while at it simplify the PM code. Signed-off-by: Gilad Ben-Yossef <[email protected]> Fixes: 1358c13a48c4 ("crypto: ccree - fix resume race condition on init") Cc: [email protected] # v4.20 Signed-off-by: Herbert Xu <[email protected]>
2020-01-22crypto: ccree - cc_do_send_request() is void funcGilad Ben-Yossef1-25/+11
cc_do_send_request() cannot fail and always returns -EINPROGRESS. Turn it into a void function and simplify code. Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-01-22crypto: ccree - fix typos in error msgsHadar Gat1-2/+2
Fixed typos in ccree error msgs. Signed-off-by: Hadar Gat <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2019-12-11crypto: ccree - fix backlog memory leakGilad Ben-Yossef1-0/+1
Fix brown paper bag bug of not releasing backlog list item buffer when backlog was consumed causing a memory leak when backlog is used. Signed-off-by: Gilad Ben-Yossef <[email protected]> Cc: [email protected] # v4.19+ Signed-off-by: Herbert Xu <[email protected]>
2019-12-11crypto: ccree - fix typos in commentsHadar Gat1-6/+6
Fix some typos in code comments. Signed-off-by: Hadar Gat <[email protected]> Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2019-07-26crypto: ccree - drop legacy ivgen supportGilad Ben-Yossef1-41/+6
ccree had a mechanism for IV generation which was not compatible with the Linux seqiv or echainiv iv generator and was never used in any of the upstream versions so drop all the code implementing it. Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2019-04-25crypto: ccree - copyright header updateGilad Ben-Yossef1-1/+1
This sacrificial copyright header update is offered to the legal department as atonement for any changes made in this driver files in the course of the current year which have not been duly recorded as such. Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2019-04-25crypto: ccree - fix backlog notificationsGilad Ben-Yossef1-3/+8
We were doing backlog notification callbacks via a cipher/hash/aead request structure cast to the base structure, which may or may not work based on how the structure is laid in memory and is not safe. Fix it by delegating the backlog notification to the appropriate internal callbacks which are type aware. Signed-off-by: Gilad Ben-Yossef <[email protected]> Cc: [email protected] # v4.19+ Signed-off-by: Herbert Xu <[email protected]>
2019-04-25crypto: ccree - add CPP completion handlingGilad Ben-Yossef1-28/+75
Add the logic needed to track and report CPP operation rejection. The new logic will be used by the CPP feature introduced later. Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2018-03-03crypto: ccree - replace memset+kfree with kzfreeGilad Ben-Yossef1-2/+1
Replace memset to 0 followed by kfree with kzfree for simplicity. Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2018-03-03crypto: ccree - add support for older HW revsGilad Ben-Yossef1-3/+3
Add support for the legacy CryptoCell 630 and 710 revs. Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2018-02-15crypto: ccree - introduce CryptoCell driverGilad Ben-Yossef1-0/+712
Introduce basic low level Arm TrustZone CryptoCell HW support. This first patch doesn't actually register any Crypto API transformations, these will follow up in the next patch. This first revision supports the CC 712 REE component. Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Herbert Xu <[email protected]>