| 457be301 | 29-Oct-2025 |
Gaurav Kashyap <gaurav.kashyap@oss.qualcomm.com> |
crypto: qce - fix version check
The previous version check made it difficult to support newer major versions (e.g., v6.0) without adding extra checks/macros. Update the logic to only reject v5.0 and
crypto: qce - fix version check
The previous version check made it difficult to support newer major versions (e.g., v6.0) without adding extra checks/macros. Update the logic to only reject v5.0 and allow future versions without additional changes.
Signed-off-by: Gaurav Kashyap <gaurav.kashyap@oss.qualcomm.com> Signed-off-by: Jingyi Wang <jingyi.wang@oss.qualcomm.com> Reviewed-by: Bjorn Andersson <andersson@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 7b6092ee | 18-Dec-2024 |
Nathan Chancellor <nathan@kernel.org> |
crypto: qce - revert "use __free() for a buffer that's always freed"
Commit ce8fd0500b74 ("crypto: qce - use __free() for a buffer that's always freed") introduced a buggy use of __free(), which cla
crypto: qce - revert "use __free() for a buffer that's always freed"
Commit ce8fd0500b74 ("crypto: qce - use __free() for a buffer that's always freed") introduced a buggy use of __free(), which clang rightfully points out:
drivers/crypto/qce/sha.c:365:3: error: cannot jump from this goto statement to its label 365 | goto err_free_ahash; | ^ drivers/crypto/qce/sha.c:373:6: note: jump bypasses initialization of variable with __attribute__((cleanup)) 373 | u8 *buf __free(kfree) = kzalloc(keylen + QCE_MAX_ALIGN_SIZE, | ^
Jumping over a variable declared with the cleanup attribute does not prevent the cleanup function from running; instead, the cleanup function is called with an uninitialized value.
Moving the declaration back to the top function with __free() and a NULL initialization would resolve the bug but that is really not much different from the original code. Since the function is so simple and there is no functional reason to use __free() here, just revert the original change to resolve the issue.
Fixes: ce8fd0500b74 ("crypto: qce - use __free() for a buffer that's always freed") Reported-by: Linux Kernel Functional Testing <lkft@linaro.org> Closes: https://lore.kernel.org/CA+G9fYtpAwXa5mUQ5O7vDLK2xN4t-kJoxgUe1ZFRT=AGqmLSRA@mail.gmail.com/ Signed-off-by: Nathan Chancellor <nathan@kernel.org> Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 49b9258b | 03-Dec-2024 |
Eric Biggers <ebiggers@google.com> |
crypto: qce - fix priority to be less than ARMv8 CE
As QCE is an order of magnitude slower than the ARMv8 Crypto Extensions on the CPU, and is also less well tested, give it a lower priority. Previo
crypto: qce - fix priority to be less than ARMv8 CE
As QCE is an order of magnitude slower than the ARMv8 Crypto Extensions on the CPU, and is also less well tested, give it a lower priority. Previously the QCE SHA algorithms had higher priority than the ARMv8 CE equivalents, and the ciphers such as AES-XTS had the same priority which meant the QCE versions were chosen if they happened to be loaded later.
Fixes: ec8f5d8f6f76 ("crypto: qce - Qualcomm crypto engine driver") Cc: stable@vger.kernel.org Cc: Bartosz Golaszewski <brgl@bgdev.pl> Cc: Neil Armstrong <neil.armstrong@linaro.org> Cc: Thara Gopinath <thara.gopinath@gmail.com> Signed-off-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 3382c44f | 03-Dec-2024 |
Bartosz Golaszewski <bartosz.golaszewski@linaro.org> |
crypto: qce - switch to using a mutex
Having switched to workqueue from tasklet, we are no longer limited to atomic APIs and can now convert the spinlock to a mutex. This, along with the conversion
crypto: qce - switch to using a mutex
Having switched to workqueue from tasklet, we are no longer limited to atomic APIs and can now convert the spinlock to a mutex. This, along with the conversion from tasklet to workqueue grants us ~15% improvement in cryptsetup benchmarks for AES encryption.
While at it: use guards to simplify locking code.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| eb7986e5 | 03-Dec-2024 |
Bartosz Golaszewski <bartosz.golaszewski@linaro.org> |
crypto: qce - convert tasklet to workqueue
There's nothing about the qce driver that requires running from a tasklet. Switch to using the system workqueue.
Signed-off-by: Bartosz Golaszewski <barto
crypto: qce - convert tasklet to workqueue
There's nothing about the qce driver that requires running from a tasklet. Switch to using the system workqueue.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| ce8fd050 | 03-Dec-2024 |
Bartosz Golaszewski <bartosz.golaszewski@linaro.org> |
crypto: qce - use __free() for a buffer that's always freed
The buffer allocated in qce_ahash_hmac_setkey is always freed before returning to use __free() to automate it.
Signed-off-by: Bartosz Gol
crypto: qce - use __free() for a buffer that's always freed
The buffer allocated in qce_ahash_hmac_setkey is always freed before returning to use __free() to automate it.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| c151535c | 03-Dec-2024 |
Bartosz Golaszewski <bartosz.golaszewski@linaro.org> |
crypto: qce - make qce_register_algs() a managed interface
Make qce_register_algs() a managed interface. This allows us to further simplify the remove() callback.
Signed-off-by: Bartosz Golaszewski
crypto: qce - make qce_register_algs() a managed interface
Make qce_register_algs() a managed interface. This allows us to further simplify the remove() callback.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| cf96b0d6 | 03-Dec-2024 |
Bartosz Golaszewski <bartosz.golaszewski@linaro.org> |
crypto: qce - convert qce_dma_request() to use devres
Make qce_dma_request() into a managed interface. With this we can simplify the error path in probe() and drop another operations from remove().
crypto: qce - convert qce_dma_request() to use devres
Make qce_dma_request() into a managed interface. With this we can simplify the error path in probe() and drop another operations from remove().
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 6bca1f0c | 03-Dec-2024 |
Bartosz Golaszewski <bartosz.golaszewski@linaro.org> |
crypto: qce - shrink code with devres clk helpers
Use devm_clk_get_optional_enabled() to avoid having to enable the clocks separately as well as putting the clocks in error path and the remove() cal
crypto: qce - shrink code with devres clk helpers
Use devm_clk_get_optional_enabled() to avoid having to enable the clocks separately as well as putting the clocks in error path and the remove() callback.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| d66b1ab3 | 03-Dec-2024 |
Bartosz Golaszewski <bartosz.golaszewski@linaro.org> |
crypto: qce - remove unneeded call to icc_set_bw() in error path
There's no need to call icc_set_bw(qce->mem_path, 0, 0); in error path as this will already be done in the release path of devm_of_ic
crypto: qce - remove unneeded call to icc_set_bw() in error path
There's no need to call icc_set_bw(qce->mem_path, 0, 0); in error path as this will already be done in the release path of devm_of_icc_get().
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| e80cf84b | 03-Dec-2024 |
Bartosz Golaszewski <bartosz.golaszewski@linaro.org> |
crypto: qce - unregister previously registered algos in error path
If we encounter an error when registering alorithms with the crypto framework, we just bail out and don't unregister the ones we su
crypto: qce - unregister previously registered algos in error path
If we encounter an error when registering alorithms with the crypto framework, we just bail out and don't unregister the ones we successfully registered in prior iterations of the loop.
Add code that goes back over the algos and unregisters them before returning an error from qce_register_algs().
Cc: stable@vger.kernel.org Fixes: ec8f5d8f6f76 ("crypto: qce - Qualcomm crypto engine driver") Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 1e620445 | 22-Feb-2023 |
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org> |
crypto: qce - Add a QCE IP family compatible 'qcom,qce'
The added 'qcom,qce' compatible value will serve as a sole QCE IP family compatible, since a particular QCE IP version is discoverablem thus,
crypto: qce - Add a QCE IP family compatible 'qcom,qce'
The added 'qcom,qce' compatible value will serve as a sole QCE IP family compatible, since a particular QCE IP version is discoverablem thus, if it'd be needed to differentiate various IP versions, it can be obtained in runtime.
Two IP version based compatibles are left untouched to preserve backward DTB ABI compatibility.
Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 167af1f3 | 22-Feb-2023 |
Thara Gopinath <thara.gopinath@gmail.com> |
crypto: qce - Make clocks optional
On certain Snapdragon processors, the crypto engine clocks are enabled by default by security firmware and the driver should not handle the clocks. Make acquiring
crypto: qce - Make clocks optional
On certain Snapdragon processors, the crypto engine clocks are enabled by default by security firmware and the driver should not handle the clocks. Make acquiring of all the clocks optional in crypto engine driver, so that the driver initializes properly even if no clocks are specified in the dt.
Tested-by: Jordan Crouse <jorcrous@amazon.com> Signed-off-by: Thara Gopinath <thara.gopinath@gmail.com> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> [Bhupesh: Massage the commit log] Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| e9c195aa | 04-Nov-2021 |
Chengfeng Ye <cyeaa@connect.ust.hk> |
crypto: qce - fix uaf on qce_skcipher_register_one
Pointer alg points to sub field of tmpl, it is dereferenced after tmpl is freed. Fix this by accessing alg before free tmpl.
Fixes: ec8f5d8f ("cry
crypto: qce - fix uaf on qce_skcipher_register_one
Pointer alg points to sub field of tmpl, it is dereferenced after tmpl is freed. Fix this by accessing alg before free tmpl.
Fixes: ec8f5d8f ("crypto: qce - Qualcomm crypto engine driver") Signed-off-by: Chengfeng Ye <cyeaa@connect.ust.hk> Acked-by: Thara Gopinath <thara.gopinath@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| b4cb4d31 | 04-Nov-2021 |
Chengfeng Ye <cyeaa@connect.ust.hk> |
crypto: qce - fix uaf on qce_ahash_register_one
Pointer base points to sub field of tmpl, it is dereferenced after tmpl is freed. Fix this by accessing base before free tmpl.
Fixes: ec8f5d8f ("cryp
crypto: qce - fix uaf on qce_ahash_register_one
Pointer base points to sub field of tmpl, it is dereferenced after tmpl is freed. Fix this by accessing base before free tmpl.
Fixes: ec8f5d8f ("crypto: qce - Qualcomm crypto engine driver") Signed-off-by: Chengfeng Ye <cyeaa@connect.ust.hk> Acked-by: Thara Gopinath <thara.gopinath@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|