Commit Graph

19 Commits

Author SHA1 Message Date
Gaurav Kashyap
0a7a6f1501 qcedev: vote for crypto clocks during module close
When qcedev module is exiting, it disconnects SPS.
At this times, crypto clocks need to be turned on
or it will cause a synchronous abort.

Tests: rmmod on the qcedev module.

Change-Id: I1721fe408392ef81b07a6c08d2196b2413ba2b2f
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
Signed-off-by: Nageswara reddy Karnati <quic_nkarnati@quicinc.com>
2023-05-02 01:38:31 -07:00
Gaurav Kashyap
3ae07bc558 qcedev: check num_fds during unmap
check the num_fds passed into unmap buf ioctl,
or else it can lead to an out of bounds access.

Test: Build compilation. qcedev tests.

Change-Id: I206ba01dfa989346ade769a0f68b372b21f84043
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
Signed-off-by: Pranav Lavhate <quic_plavhate@quicinc.com>
2022-11-02 23:42:57 -07:00
Monika Singh
595a9a1296 crypto: Fix possible stack out of bound error
Adding fix to check the upper limit on the length
of the destination array while copying elements
from source address to avoid stack out of bound error.

Change-Id: I39d5768fa97f9d269cfb101a389bb771d13c7538
Signed-off-by: Monika Singh <monising@codeaurora.org>
2021-02-01 23:46:33 +05:30
Anmolpreet Kaur
4130da7ced qcedev : Solve compilation issues
This change solves compilation issues that
came up while enabling qcedev driver in
sdxlemur.

Change-Id: Iaa261681a3cef421dcb21908e1402b146e912a55
Signed-off-by: Anmolpreet Kaur <anmolpre@codeaurora.org>
2020-12-15 23:07:56 +05:30
qctecmdr
e3bf003c8b Merge "crypto: Fix possible stack out of bound error" 2020-09-04 18:40:15 -07:00
Tanwee Kausar
5e3618d4ee crypto: Fix possible stack out of bound error
Adding fix to check the upper limit on the length
of the destination array while copying elements from
source address to avoid stack out of bound error.

Change-Id: Ieb24e8f9b4a2b53fbc9442b25d790b12f737d471
Signed-off-by: Tanwee Kausar <tkausar@codeaurora.org>
2020-09-04 00:04:17 -07:00
Tanwee Kausar
2348ac7cfd kernel: crypto: Possible null pointer dereference
Removing possible null pointer derefrence during error
exit.

Change-Id: Ic7246a39685942f308b35ab2b5f8f30a834e5f4c
Signed-off-by: Tanwee Kausar <tkausar@codeaurora.org>
2020-08-24 14:07:19 -07:00
qctecmdr
ce059a4d06 Merge "crypto: msm: Fix null pointer dereference" 2020-07-22 18:52:08 -07:00
Tanwee Kausar
d6ccbf749e crypto: msm: Fix null pointer dereference
Fixing possible null pointer dereference of sg_src
when nbytes exceed.

Change-Id: I91a2a274f11646bc65c4eb0d14a82d4ed81f4e42
Signed-off-by: Tanwee Kausar <tkausar@codeaurora.org>
2020-07-21 15:16:57 -07:00
qctecmdr
6ee581de55 Merge "crypto: msm: change clock operation in qcedev driver" 2020-07-04 14:21:04 -07:00
Prerna Kalla
80acd2bcf5 crypto: msm: make qcrypto and qcedev independent of DEBUG_FS
qcrypto_init() and qcedev_init() should not be dependent on
DEBUG_FS API's returning success. Continue device init,when
DEBUG_FS is disabled.

Change-Id: I32cca791db545f5f2f9ea7871c091b121082dfbc
Signed-off-by: Prerna Kalla <prernak@codeaurora.org>
2020-05-19 21:56:21 -07:00
Zhen Kong
f0f008a041 crypto: msm: change clock operation in qcedev driver
Make change to enable/disable clock just before/after crypto operation.

Change-Id: I0fad859b142ccc6250d597e07aff7c530d40154f
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2020-04-18 20:31:44 -07:00
Prerna Kalla
c95de1aead crypto: msm: restrict value of num_fds to QCEDEV_MAX_BUFFERS
Set the max value of num_fds to QCEDEV_MAX_BUFFERS to prevent
out of bound access of fd, fd_size, fd_offset array.

Change-Id: I88889472a4bd14f786588bd2c9e06e69a98e94c9
Signed-off-by: Prerna Kalla <prernak@codeaurora.org>
2020-04-01 08:45:09 -07:00
Zhen Kong
79539b14be crypto: msm: add compat_qcedev to support 32bit process
add snapshot of compat_qcedev.c and compat_qcedev.h from
msm-4.19 commit 52d84be6ae6e151ba ("crypto: msm: qcrypto:
Fix null pointer dereference error in qcrypto driver")
with changes to comply with msm-5.4 format requirement.

Change-Id: Ib80bc4fdec58392246bfcec1b08620dcde0a6608
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2020-02-20 14:28:31 -08:00
Jordan Crouse
feba5ac0b5 crypto: msm: Rename qcrypto module
There is already a qcrypto module defined in drivers/crypto/qce so
rename this one to qcrypto-msm to avoid an error while building with
'allmodconfig'.

Change-Id: Ic0dedbadb33e28eccd952c6f9c01c8b8208ad2ec
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2020-02-11 10:17:04 -08:00
Jordan Crouse
a3b509cd7e crypto: msm: Build qcedev and qcedev-smmu together
qcedev.c and qcedev_smmu.c are clearly not expected to be compiled
as separate modules so bundle them together as one.

Change-Id: Ic0dedbad96baebac00448edf4cf440d1e0edd41c
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2020-02-11 10:17:03 -08:00
Jordan Crouse
ddaf16c9fb crypto: msm: Fix compile errors
Fix an out of order definition of MODULE_DEVICE_TABLE, add missing
brackets to fix a suspect indentation warning and mark an
implcit switch fall through.

Fixes: 377c69bf3e ("crypto: msm: Add QTI crypto drivers")
Change-Id: Ic0dedbada33fd2e5c692e5f0d64fd0e7b7afb5f1
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2020-02-11 10:17:02 -08:00
Jordan Crouse
2a6e1c50db crypto: msm: Fix incorrect boolean logic
Fix the following warning from gcc 7.4.1 with -Werror enabled:

 drivers/crypto/msm/qce50.c:4668:28: error: ‘~’ on a boolean expression
  [-Werror=bool-operation]
  pce_dev->cadence_flag = ~pce_dev->cadence_flag;

 drivers/crypto/msm/qce50.c:4668:28: note: did you mean to use logical not?.

Fixes: 377c69bf3e ("crypto: msm: Add QTI crypto drivers")
Change-Id: Ic0dedbad73c49d059d68d9412009b74583d33154
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2020-02-11 10:16:14 -08:00
Zhen Kong
377c69bf3e crypto: msm: Add QTI crypto drivers
This is a snapshot of the crypto drivers as of msm-4.19
commit 52d84be6ae6e151ba ("crypto: msm: qcrypto: Fix null
pointer dereference error in qcrypto driver")
with changes to comply with msm-5.4 format requirement.

Change-Id: Ic566a15e41511d229a9e476c03962753da583946
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2020-01-06 14:24:28 -08:00