Commit Graph

268 Commits

Author SHA1 Message Date
Om Prakash Singh
dd578986f7 qcedev: fix qcedev_async_req status update in req_done
Issue:
  qcedev_async_req status is updated after sending complete signal
  that makes qcedev_ioctl exit and freed the memory.

Fix:
  update qcedev_async_req status before sending complete signal.

Change-Id: I6c224b4775b8860c1c50f9a1f9e3705a6ca76e34
Signed-off-by: Om Prakash Singh <quic_omprsing@quicinc.com>
(cherry picked from commit 582cf8006a08f459573a30821270d72fd8788b15)
2024-02-29 03:51:58 -08:00
Daniel Perez-Zoghbi
fd37da76a2 qcedev: Increase offload timeout
In an offload crypto operation there are some expected errors, e.g.
KeyPauseError. We have a shortened wait time to capture these errors,
however the current wait time of 20ms was too short and some valid
operations were timing out just before the request is completed, causing
a race condition. Here we change to 50ms as a normal operation should
not take this long. Calculated by 8 requests submitted * 4MB (max size)
at about 5Gbps processing rate. This is a conservative estimate.

Change-Id: I5bccd81ca3dda9d4fca1f302b7961dbdb22f9f58
Signed-off-by: Daniel Perez-Zoghbi <quic_dperezzo@quicinc.com>
2024-02-06 00:12:10 -08:00
Ravi Kumar Bokka
ded9715963 securemsm-kernel: smcinvoke: removal of double unlock corner case
In mem-map lock api its suppose to enter and exit with holding
lock but there is scenario where we are unlocking in locked API.

Change-Id: I79d8dc350df00d086c9d4d8a58a7b928734be598
Signed-off-by: Nitin LNU <quic_nlakra@quicinc.com>
(cherry picked from commit 657c43f2b767274f940efd66b6d685cf7a0c9884)
2024-01-24 15:21:18 +05:30
qctecmdr
7859e078ed Merge "securemsm-kernel: Add support for Bazel for monaco" 2023-11-14 07:34:46 -08:00
qctecmdr
a9fbe05aa5 Merge "securemsm-kernel: Enable smmu-proxy compilation" 2023-11-11 11:58:39 -08:00
qctecmdr
b263ab047a Merge "driver : hdcp_qseecom: Retry HDCP key verify when Qseecomd down" 2023-11-10 01:00:05 -08:00
qctecmdr
fcdba8461b Merge "securemsm-kernel: smmu-proxy: Fix compilation issues related to printing" 2023-11-09 19:11:52 -08:00
songrui
a3040bbd65 securemsm-kernel: Enable smmu-proxy compilation
Resolve compilation issues related to printing
caused by kernel upgrade.

Change-Id: I34db6dab0af32b75d0877ae55e6a493004e11de9
Signed-off-by: songrui <quic_songrui@quicinc.com>
2023-11-10 10:19:29 +08:00
qctecmdr
6244e24998 Merge "securemsm-kernel: Update hardcoded paths" 2023-11-09 13:28:12 -08:00
songrui
fc436040e9 securemsm-kernel: smmu-proxy: Fix compilation issues related to printing
Resolve compilation issues related to printing caused by kernel upgrade

Change-Id: Iaf55c59e77c7f23581372db711debf6059c380dd
Signed-off-by: songrui <quic_songrui@quicinc.com>
2023-11-08 14:26:36 +08:00
Shubham Dhiman
bae6b391eb driver : hdcp_qseecom: Retry HDCP key verify when Qseecomd down
HDCP has a dependency on Qseecomd for HDCP key
verification and other SCM calls. Qseecomd takes
a lot of time to be available during boot because
of which HDCP init fails.
Adding retry mechanism only when there is hdcp key
verification failure due to Qseecomd not starting
in time. For other error codes, like HDCP key not
programmed, there will be no retry.
If Qseecomd doesn’t come up within maximum retries,
code will stop retrying and hdcp key verification
will fail. For each retry, there is a sleep of 100ms.
The number of retries can be changed from the dtsi file.
By default, we are allowing 40 retries but it can be
changed. 40 retries are based on the qseecomd KPI which
can be anywhere between 2.9 sec to 3.6 sec.

Change-Id: I3661b349ec44604147d6e6700307fa416904bbfa
Signed-off-by: Shubham Dhiman <quic_shubhamd@quicinc.com>
2023-11-06 14:44:18 -05:00
Santosh Dronamraju
320d8fa045 securemsm-kernel: Enable SMCINVOKE driver for HGY
Add flags for each feature and these flags to use
enable/disable features.

Enable SMCINVOKE driver and disable other drivers
on HGY platform.

Change-Id: I5eca4771aaa3001ecc0d8c06060c951923aa0619
Signed-off-by: Santosh Dronamraju <quic_sdronamr@quicinc.com>
2023-11-01 11:58:11 -07:00
Manasa M
df9e5f2fd1 securemsm-kernel: Add support for Bazel for monaco
Add support for Bazel for monaco.

Change-Id: I158a781252a983aed43ae5d1b11cfe444739cd07
Signed-off-by: Manasa M <quic_manam@quicinc.com>
2023-10-31 12:13:56 +05:30
Ananth Sadvi Bogavalli
cac00bd15a securemsm-kernel: Update hardcoded paths
Updating the hardcoded path to store into a variable to support
multiple vendor components in parallel for build compilations.

Tests:
Compilation validation and device is booting up successfully.

Change-Id: I6a058e538a5050066de0737b834ec182c1283fc3
Signed-off-by: Ananth Sadvi Bogavalli <quic_abogaval@quicinc.com>
2023-10-25 11:21:44 +05:30
Anmolpreet Kaur
77752c91fd securemsm: smcinvoke: Change zero length arrays to flexible arrays
In latest kernel upgrade Zero Length arrays are not allowed.
Replace with Flexible arrays.

Change-Id: Ide4ce5ac5f75197a432fb99333a702cdc4ff88c5
Signed-off-by: Anmolpreet Kaur <quic_anmolpre@quicinc.com>
2023-10-20 20:32:07 +05:30
qctecmdr
026f1690e3 Merge "securemsm-kernel: Compile sec-module-symvers conditionally" 2023-10-16 21:17:00 -07:00
Anmolpreet Kaur
8f9a7a029a securemsm-kernel: Compile sec-module-symvers conditionally
Compile sec-module-symvers only if at least  one of the
ENABLE_SECUREMSM_QTEE_DLKM or ENABLE_SECUREMSM_DLKM is true.

Change-Id: Ibf69d19ef311d02862f8a87dabd01875ae2cdcab
Signed-off-by: Anmolpreet Kaur <quic_anmolpre@quicinc.com>
2023-10-12 09:35:03 -07:00
qctecmdr
7c7cc79348 Merge "securemsm-kernel: Add support for Bazel for niobe" 2023-10-12 00:18:05 -07:00
qctecmdr
fdeef9c344 Merge "securemsm-kernel: enable non-qtee modules" 2023-10-06 23:40:40 -07:00
qctecmdr
77139b8b34 Merge "securemsm-kernel: Fix compilation errors" 2023-10-05 17:38:58 -07:00
qctecmdr
65bfc927ea Merge "securemsm-kernel: change the CMO's clean and flush" 2023-10-04 22:53:14 -07:00
qctecmdr
039380b55c Merge "qseecom: check for state first before performing ioctl" 2023-10-04 22:53:14 -07:00
Gaurav Kashyap
154b6011b0 securemsm-kernel: enable non-qtee modules
Fix compilation issues and enable all modules bound
by TARGET_KERNEL_DLKM_SECURE_MSM_OVERRIDE.

Change-Id: Id8e2d5ecb580d5fd200fe5e5e899202046136976
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2023-10-04 11:50:16 -07:00
Anmolpreet Kaur
61706292b1 securemsm-kernel: Fix compilation errors
kernel-qcom 6.1 has some changes in api definations
and header file locations. This change fixes compilation
errors related to those changes.

Change-Id: I6162ffe9e671a8e94d80e9ec01839566c617aa03
Signed-off-by: Anmolpreet Kaur <quic_anmolpre@quicinc.com>
2023-09-29 17:17:48 -07:00
Nitin LNU
88d0774828 qseecom: check for state first before performing ioctl
Before initating the ioctl lets first check the state of qseecom
is yet ready or not.

Test:
1. L0 Validation
2. Introduced a sleep in init path and tested the qseecom node.

Change-Id: Ic93ab91a4281ff615b629fdeb936fcd924589b5d
Signed-off-by: Nitin LNU <quic_nlakra@quicinc.com>
2023-09-29 07:34:21 -07:00
Nitin LNU
f0c078a367 qseecom: Change the clean and invalidation way for dmabuf
dmabuf having the changes in 6.1 for clean and invalidate ,
made similar changes to do invalidation and clean in
qseecom corresponding to dmabuf changes.

Change-Id: I23a9686ce4902d86c8ef60c099fcc4394356e114
Signed-off-by: Nitin LNU <quic_nlakra@quicinc.com>
2023-09-28 07:49:30 -07:00
Seshu Madhavi Puppala
3561b03e10 securemsm-kernel: Add support for Bazel for niobe
Add support for Bazel for niobe.

Change-Id: Id04b39ed3b863aca923ec924a7d0ccb01cab421f
Signed-off-by: Seshu Madhavi Puppala <quic_spuppala@quicinc.com>
2023-09-25 02:32:21 -07:00
Nitin LNU
c5627e0e69 securemsm-kernel: change the CMO's clean and flush
Change DMA HEAP CMO's clean and flush as per changes
for 6.1 kernel.

Change-Id: Ie36fc1efdeecd1ab1afd3d9a59372b762bb8ad0d
Signed-off-by: Nitin LNU <quic_nlakra@quicinc.com>
2023-09-22 03:49:08 -07:00
Sheik Anwar Shabic Y
c363344909 securemsm-kernel: Fix misra issues in hdcp driver
Initialized the uninitialized variable to prevent potential errors.

Change-Id: I2fc05486a246fe3c05997b24587638928a0769ec
Signed-off-by: Sheik Anwar Shabic Y <quic_sheikanw@quicinc.com>
2023-09-22 14:42:25 +05:30
qctecmdr
f5557b6e65 Merge "securemsm-kernel: Add rules to build qtee modules on sun" 2023-09-20 02:06:53 -07:00
qctecmdr
bf4015d2f7 Merge "securemsm-kernel: qseecom: remove ion.h header include" 2023-09-19 14:43:12 -07:00
Anmolpreet Kaur
e22a42f5fe securemsm-kernel: Add rules to build qtee modules on sun
Add changes to support compilation and enablement for
qtee modules on sun. These changes do not enable the
compilation but add a support to enable the driver
compilation just by setting ENABLE_SECUREMSM_QTEE_DLKM to true.

1. Flag ENABLE_SECUREMSM_QTEE_DLKM ensures that we can
enable compilation and enablement of smcinvoke,tzlog and qseecom
driver irrespective of high level KERNEL_DLKM* flags.
2. BUILD.bazel and build/sun.bzl changes to enable bazel
configurations for smcinvoke and tzlog driver once they are enabled
in Android.mk.

Change-Id: I5574c4b328266c3344aac435d034e6639a05fb12
Signed-off-by: Anmolpreet Kaur <quic_anmolpre@quicinc.com>
2023-09-19 23:02:36 +05:30
qctecmdr
a3aa2b7dc0 Merge "qrng: fix module remove sequence" 2023-09-14 20:14:51 -07:00
qctecmdr
1a392c58fd Merge "qcedev: Fix null-ptr-deref in qcedev_cipher_req_cb" 2023-09-13 14:20:49 -07:00
qctecmdr
dea84289f9 Merge "Fix for StsHostTestCases (CVE_2016_6752) failure" 2023-09-13 09:53:07 -07:00
Om Prakash Singh
d374955003 qrng: fix module remove sequence
Module remove call is not cleaning up char dev completely.

Update remove call sequence to call class_destroy, device_destroy
and cdev_del to clean up char dev complexly.

Change-Id: I07f28c27ac0ca78cb8223118bd0be3b3a5654224
Signed-off-by: Om Prakash Singh <quic_omprsing@quicinc.com>
2023-09-13 20:26:53 +05:30
Anmolpreet Kaur
ec134edd3b securemsm-kernel: qseecom: remove ion.h header include
ion is deprecated now. Removing header as it is no longer
needed.

Test:
Tested compilation on sun and pineapple builds.

Change-Id: Ic67d389b7161e7c1daade147a719140456156ca3
Signed-off-by: Anmolpreet Kaur <quic_anmolpre@quicinc.com>
2023-09-12 06:34:34 -07:00
qctecmdr
dc7a556fa0 Merge "sec-kernel: Enable LV securemsmdlkm" 2023-09-11 07:45:19 -07:00
kodanda rami reddy v
f93cb74fda Fix for StsHostTestCases (CVE_2016_6752) failure
StsHostTestCases-android.security.sts.Poc16_11#testPocCVE_2016_6752 is
failed due to assertion error due to address pattern.

Change-Id: Id1bdf0637ac9ee1bc493e87147128153faaed546
Signed-off-by: kodanda rami reddy v <quic_kreddyv@quicinc.com>
2023-09-10 19:56:10 -07:00
qctecmdr
5c778942e7 Merge "securemsm-kernel: Fix format-specifier errors" 2023-09-06 21:07:39 -07:00
Anmolpreet Kaur
2e42ca628b securemsm-kernel: Fix format-specifier errors
Moving to a new kernel version has led to
enablement of new compiler warnings. These
issues came during compilation enablement
of securemsm modules for sun.

Change-Id: Id807a642b9465dda79680c28d4a6eeef64a45eba
Signed-off-by: Anmolpreet Kaur <quic_anmolpre@quicinc.com>
2023-09-05 08:53:17 -07:00
jianshu
cee3f2165c sec-kernel: Enable LV securemsmdlkm
The clean command will clear the KERNEL_SRC path, then cause
securemsmdlkm compile fail.

Change-Id: I3b956f87b2d46d21399104796ac5f7d2a5521cbd
Signed-off-by: jianshu <quic_jianshu@quicinc.com>
2023-09-04 23:35:06 -07:00
Amirreza Zarrabi
73d246b23b securemsm-kernel: smcinvoke: Add missing unlock on function return
Also reset the output buffer after processing.

Change-Id: Ib8d9b3ffe4c25c3c699df561d7f37776a8fcd538
Signed-off-by: Amirreza Zarrabi <quic_azarrabi@quicinc.com>
2023-09-04 22:07:01 -07:00
qctecmdr
0876cca974 Merge "securemsm-kernel: Fixed multiple listener registration on same fd" 2023-09-04 02:45:24 -07:00
qctecmdr
2f83bab3e0 Merge "securemsm-kernel: Add framework to piggy back for call back" 2023-09-04 00:31:29 -07:00
Udit Tiwari
48d10387ac qcedev: Fix null-ptr-deref in qcedev_cipher_req_cb
adding missing NULL check for qcedev_areq in
qcedev_offload_cipher_req_cb and qcedev_cipher_req_cb.

Change-Id: Ibbb037b12b1c6264376fe1f3185bd0b392447a65
Signed-off-by: Udit Tiwari <quic_utiwari@quicinc.com>
2023-08-31 13:02:53 +05:30
qctecmdr
e43059f322 Merge "securemsm-kernel: fix smcinvoke dependency" 2023-08-30 00:51:19 -07:00
qctecmdr
ae7eb3e1c9 Merge "pineapple:Fix smcinvoke_dlkm.ko dependency error when DLKM is enabled" 2023-08-30 00:51:19 -07:00
Xhoendi Collaku
cd59be71f8 pineapple:Fix smcinvoke_dlkm.ko dependency error when DLKM is enabled
Adding conditional check in securemsm_kernel_vendor_board.mk.

Change-Id: Icf7fe1f03ff7016381f5fdbc81946d799169c5b6
Signed-off-by: Xhoendi Collaku <quic_xcollaku@quicinc.com>
2023-08-28 15:55:42 -07:00
Chris Goldsworthy
009ea1b0a5 smmu-proxy: Correctly allow a DMA-BUF to be mapped as RW
mem_buf_retrieve() is what will actually create a DMA-BUF, along with
the struct file that underpins the DMA-BUF's lifetime and user space
interface. The FD RWX permissions are set during this time, and
currently, we just supply a flags value of 0, corresponding to
read-only. Set the file permissions as O_RDWR accordingly.

Separately, dma_buf_fd(), which just exposes a DMA-BUF's struct file
to user space, ignores all other arguments other than O_CLOEXEC, so
discard the other arguments.

Change-Id: I5e81909f3b87edb28cbbb087ec1994004fd82e45
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
2023-08-25 13:41:35 -07:00