Commit Graph

2102 Commits

Author SHA1 Message Date
jitendrathakare 335822d09c qseecom : Clear client handle after unmap the resources
When unloading the app, reset all client members to NULL
to protect from accessing the memory after being freed.

Change-Id: I573b9c6fde03539522d2b04724a2246660c62518
Signed-off-by: jitendra thakare <jitendrathakare@codeaurora.org>
2020-04-20 20:13:59 +02:00
Zhen Kong 266819e84c qseecom: check invalid handle for app loaded query request
Check if the handle data_type received from userspace is valid
for app loaded query request to avoid the offset boundary check
for qseecom_send_modfd_resp is bypassed.

Change-Id: I5f3611a8f830d6904213781c5ba70cfc0ba3e2e0
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2019-12-06 19:35:20 +01:00
jitendrathakare 28f945bd7a qseecom: correct range check in __qseecom_update_cmd_buf_64
Make change to validate if there exists enough space to write a
unit64 instead of a unit32 value, in __qseecom_update_cmd_buf_64.

Change-Id: Iabf61dea240f16108e1765585aae3a12d2d651c9
Signed-off-by: jitendra thakare <jitendrathakare@codeaurora.org>
2019-09-28 20:28:33 +02:00
Monika Singh 38e6900756 ARM: dts: msm: Untrusted pointer dereference
To avoid access of variable after being freed, using
list_first_entry_safe function to iterate over list
of given type, safe against removal of list entry.

Change-Id: I70611fddf3e9b80b1affa3e5235be24eac0d0a58
Signed-off-by: Monika Singh <monising@codeaurora.org>
2019-09-11 19:44:53 +02:00
Brahmaji K 2d37893dce qseecom: Fix accessing userspace memory in kernel space
Use put_user API to write the data from kernel space to
userspace to avoid accessing userspace memory directly
in kernel space.

Bug: 65468973
Change-Id: I649fe2597e80ccad50cf16b355e220734810e94c
Signed-off-by: Brahmaji K <bkomma@codeaurora.org>
2019-07-27 22:11:00 +02:00
Zhen Kong 1aaa82aefa qseecom: Add a new smc cmd to check RPMB key provision status
A new smc cmd is added to check RPMB key provision status

Change-Id: I50411bf9ae7f31589be34d7b5aaf48f2c12f0018
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2019-07-27 22:10:55 +02:00
Vatsal Bucha acb7b45709 qdsp6v2: q6usm: Check size of payload before access
Check size of payload array before access in q6usm_callback.

Change-Id: Id0c85209a053f9dfdb53133aeb6b2510ecf18eb8
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-07-27 22:10:54 +02:00
Vatsal Bucha 3befe291bf qdsp6v2: q6usm: Check size of payload before access
Check size of payload before access in q6usm_mmapcallback.

Change-Id: Iff0672532c2ea40e7129237a92d8365d6b554cf2
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-07-27 22:10:54 +02:00
Xiaoyu Ye a56475d829 dsp: codecs: fix range check for audio buffer copying
The range checking for audio buffer copying in function
"audio_in_write" is using the incorrect buffer size.
Change it to the actual allocated audio buffer size.

Change-Id: Ib7aaa2163c0d99161369eb85d09dc2d23d8c787b
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2019-07-27 22:08:47 +02:00
syphyr ef1d9a501e qseecom: Fix typo in format specifier
Change-Id: Ibbeac5fe01f21a4e88a642cc29d9c04e2e0804cb
2019-07-27 21:44:44 +02:00
Zhen Kong a178120006 qseecom: fix an app unloading issue when the app is blocked
Reset app_crash flag to make sure app entry is not freed when
there is another client still being blocked on the same app.

Change-Id: I25d236abc97e60fe8a4abbbc8c086291c764a9c1
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2018-08-20 12:03:48 +02:00
LuK1337 65f8423215 Import T813XXS2BRC2 kernel source changes
Change-Id: I90bb6c013287c1edbf8ca607d1666cc4c62d504e
2018-05-26 00:39:42 +02:00
LuK1337 39a771baad Merge tag 'LA.BR.1.3.6-05410-8976.0' of https://source.codeaurora.org/quic/la/kernel/msm-3.10 into HEAD
"LA.BR.1.3.6-05410-8976.0"
2018-02-06 13:11:45 +01:00
Tanya Dixit 45c8b061e2 drivers: qdsp6v2: Add mutex unlock to properly release lock
Add mutex unlock in function audio_effects_shared_ioctl
at appropriate place to prevent use after free.

CRs-Fixed: 2123291
Change-Id: Ie0d321dc8cc20a295d102a44faea7e5710834932
Signed-off-by: Tanya Dixit <tdixit@codeaurora.org>
2018-01-21 21:04:36 -08:00
syphyr 592bd31e86 Revert "Revert "qseecom: Fix accessing userspace memory in kernel space""
This reverts commit bbf22dd75c.

Change-Id: I231e4bb0053f8f6cfbefd087d5639827b728b824
2017-10-16 00:33:47 +02:00
syphyr bbf22dd75c Revert "qseecom: Fix accessing userspace memory in kernel space"
This reverts commit f7e7462b51.

Change-Id: I46305e98766b689c4e261e6ffd10d38bc997a8a3
2017-09-25 10:53:20 +02:00
LuK1337 97104ad488 Merge tag 'LA.BR.1.3.6-04710-8976.0' of https://source.codeaurora.org/quic/la/kernel/msm-3.10 into HEAD
"LA.BR.1.3.6-04710-8976.0"
2017-09-15 11:27:24 +02:00
Brahmaji K f7e7462b51 qseecom: Fix accessing userspace memory in kernel space
Use put_user API to write the data from kernel space to
userspace to avoid accessing userspace memory directly
in kernel space.

Change-Id: I649fe2597e80ccad50cf16b355e220734810e94c
Signed-off-by: Brahmaji K <bkomma@codeaurora.org>
2017-09-06 00:01:57 -07:00
yidongh e83913d1f9 ASoC: msm: qdspv2: initialize struct member before being used
Initialize member value of struct audio_aio_write_param after declaration.

CRs-Fixed: 2091953
Change-Id: Iaf3ff1232e85ae8d26e9d97ce4c2aa3408da7a80
Signed-off-by: Yidong Huang <yidongh@codeaurora.org>
2017-08-22 02:28:51 -07:00
LuK1337 ea03599937 Merge tag 'LA.BR.1.3.6-04110-8976.0' of https://source.codeaurora.org/quic/la/kernel/msm-3.10 into HEAD
"LA.BR.1.3.6-04110-8976.0"

Change-Id: Ie9bc105eee4263ab1ec2f91556feca988522808f
2017-07-08 18:34:23 +02:00
Divya Ojha 5c719bab05 ASoC: msm: qdsp6v2: make audio debugfs read and release exclusive
A thread can read audio debugfs entry while another closes the
device. Protect these operations with a mutex and before read
check audio data for a valid pointer.

Change-Id: If29a308c1a8329d7befd047d41abe5f6ab626199
Signed-off-by: Divya Ojha <dojha@codeaurora.org>
2017-07-05 23:33:29 -07:00
Divya Ojha b9faf02678 ASoC: msm: qdsp6v2: make audio debugfs read and release exclusive
A thread can read audio debugfs entry while another closes the
device. Protect these operations with a mutex and before read
check audio data for a valid pointer.

Change-Id: If29a308c1a8329d7befd047d41abe5f6ab626199
Signed-off-by: Divya Ojha <dojha@codeaurora.org>
2017-07-04 17:41:07 +05:30
Siena Richard fc3412db48 ASoC: msm: qdsp6v2: extend validation of virtual address
Validate a buffer virtual address is fully within the region for an
extended edge case.

CRs-Fixed: 2049911
Signed-off-by: Siena Richard <sienar@codeaurora.org>
Change-Id: I4c56fdd42336d00a2294a8b7cc17c74606e56be2
2017-06-01 10:20:26 -07:00
LuK1337 18aceede84 Merge tag 'LA.BR.1.3.6-03910-8976.0' of https://source.codeaurora.org/quic/la/kernel/msm-3.10 into HEAD
"LA.BR.1.3.6-03910-8976.0"

Change-Id: I16643fc055aa2965fe5903396a8e5158c42cf1bc
2017-05-26 13:28:48 +02:00
Zhen Kong b55a291adb qseecom: check buffer size when loading firmware images
Make change in __qseecom_load_fw() and qseecom_load_commonlib_image()
to check buffer size before copying img to buffer.

CRs-fixed: 1080290
Change-Id: I0f48666ac948a9571e249598ae7cc19df9036b1d
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2017-05-05 19:20:31 +00:00
kunleiz 774fbff7a8 ASoC: msm: qdspv2: add result check when audio process fail
A audio_process_event_req is not always to success. Therefore,
check the return value for audio_process_event_req, and
initializ usr_evt before using it.

CRs-Fixed: 2029798
Change-Id: I4adf682575f5f9233a1a1a533f9c6361af8a5bcf
Signed-off-by: kunleiz <kunleiz@codeaurora.org>
2017-05-02 21:51:42 -07:00
Zhen Kong 01e113c98f qseecom: add mutex around qseecom_set_client_mem_param
Add mutex around qseecom_set_client_mem_param to prevent an
ioctl thread modifying and corrupting data which is being
processed by another ioctl in the other thread

Change-Id: I0cfb8afab4001c2913be693dfe44c761b9568893
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2017-05-01 03:54:50 -07:00
Divya Ojha 5eeb603903 drivers: qcom: ultrasound: check concurrent device open operations
Make opened device count atomic variable to avoid probable race
condition. Race condition leads to memory leak and list corruption.

Change-Id: I4da98f27d36f616bc8fa7b1a848c20cc7eea04e5
Signed-off-by: Divya Ojha <dojha@codeaurora.org>
2017-04-24 11:40:12 +05:30
Luca Stefani ff1ebfd98d This is the 3.10.102 stable release
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXXS5iAAoJEE44bZycYXAvDj8P/jbhmGAgW6tw2cnS90QIZDqG
 M/nclEId61jICNvbfP6zsioKeWyrmzr5G7NjqTThsSNhCo/DXs3ddMqLy3pOaFdq
 mytXtHIUpwZoplEib+ODinW40CMqnu11XSWEcee2nrsPuGNsnc7BY0wmFBa6UVCV
 rOZef9SN9lJcZSYY/auvgLDXOXdQ+NMxp5hau30aF5HBO8hTDXStjPRcUwCvz7aR
 govTQJHlS4HzLH3JOYS3Dt8IYFDOrKhQIby2nFdw7eiUxHCRy2F0asabTh3DzCw1
 iLvFroozjyVXwozfWMqLCvMa+514MXJy8Nkva6xiAHraC8UrgfPtcNsTdgtkdH9T
 V2Am9b0L7yiBdG6hsZLxkU3akk7vU/0dtppwzvudANT6i2tGcDSBeaZq3T2pAv7B
 7coY53GzHZdQnbdTZbYeS1fxebxyXw50D5OJkF8DyLhoL7Uj2Dvv0QdjKv+U/e5D
 VQ+ZyGcBdCLuOzflXysI10E01y0/M3FrkubgGBM4Oh0eYKCHJaHG/NCZy5JY/qxy
 S0phem8RbeZPbcL14z+5buWIi1lUkTiCIMG8c32ZEmDh84drnICqABA0RzKmqdkj
 ucQa+PzkMQ1DyhAMUl/CwpBfSqf1Zs3agLo78Kp5MTGfeAA90m0SeVqhmDgWhwqG
 HhSlsPFfMfmJl5S0uJpQ
 =UhFl
 -----END PGP SIGNATURE-----

Merge tag 'v3.10.102' into HEAD

This is the 3.10.102 stable release

Change-Id: Ic7d338fb190966b26aa151361fc37414f701d8b2
2017-04-18 17:22:08 +02:00
LuK1337 4e71469c73 Merge tag 'LA.BR.1.3.6-03510-8976.0' into HEAD
Change-Id: Ie506850703bf9550ede802c13ba5f8c2ce723fa3
2017-04-18 12:11:50 +02:00
LuK1337 fc9499e55a Import latest Samsung release
* Package version: T713XXU2BQCO

Change-Id: I293d9e7f2df458c512d59b7a06f8ca6add610c99
2017-04-18 03:43:52 +02:00
Linux Build Service Account 516ca9cf18 Merge "ASoC: qdsp6v2: Remove Eagle code" 2017-04-13 17:08:51 -07:00
Alexy Joseph 367fab472d ASoC: qdsp6v2: Remove Eagle code
Eagle driver is not in use any more.
Remove the code and associated calls
to it.

CRs-Fixed: 1103106
Change-Id: Ice5333861beda9538f0783b70b3267523d16fd2b
Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
2017-04-11 19:13:47 +05:30
kunleiz 95e72ae928 ASoC: msm: qdspv2: add mutex to prevent access same memory simultaneously
Add mutex protection to avoid simultaneous access the
same memory by multiple threads.

CRs-Fixed: 2013494
Change-Id: I440ea633ceb7312637c9a3b29d22236166d21a39
Signed-off-by: kunleiz <kunleiz@codeaurora.org>
2017-04-09 01:23:08 -07:00
Zhen Kong ccfb4b622c qseecom: check img_len and mdt_len against ion buf len
Variable "load_img_req.img_len" and "load_img_req.mdt_len" are
from user land, so check their values against ion buf length
to avoid buffer overread on QSEE side.

Change-Id: I9e8bfe32d3b0cd5b441ad724543c56467fa5e4da
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2017-03-27 02:00:33 -07:00
Zhen Kong 53ad76cced qseecom: fix potential memory leak in __qseecom_update_cmd_buf_64
__qseecom_update_cmd_buf_64() called __qseecom_allocate_sg_list_buffer()
to allocate memory from within a for loop. Should it fail on any other
than the first time through the loop, the prior allocations will not be
deallocated, make change to deallocate memory in this error case.

Change-Id: I8cb71a3b141249d8266aec4890632f200d147405
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2017-03-12 23:01:03 -07:00
Linux Build Service Account 75e0785e63 Merge "misc: qcom: qdsp6v2: Add range check in function aac_in_ioctl_shared" 2017-03-08 07:52:45 -08:00
Siena Richard 3e59c6edcb ASoC: msm: qdsp6v2: extend validation of virtual address
Validate a buffer virtual address is fully within the region before
returning the region to ensure functionality for an extended edge
case.

Change-Id: Iba3e080889980f393d6a9f0afe0231408b92d654
Signed-off-by: Siena Richard <sienar@codeaurora.org>
CRs-fixed: 1108461
2017-03-07 23:05:51 -08:00
Xiaoyu Ye 1ff52b8fc1 misc: qcom: qdsp6v2: Add range check in function aac_in_ioctl_shared
Add range check for cfg->sample_rate to prevent the user space from
providing an invalid sample rate.

CRs-Fixed: 1108109
Change-Id: I17ccda0901aa4ad84d6e2f78679d71aa327f42eb
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2017-03-07 15:19:41 -08:00
Linux Build Service Account b6221838be Merge "qseecom: release memory when failed to get fw size" 2017-02-08 14:56:59 -08:00
Linux Build Service Account 1750226d77 Merge "qseecom: fix incomplete error handling for several functions" 2017-01-30 21:53:34 -08:00
Zhen Kong abbe909b74 qseecom: release memory when failed to get fw size
release app list entry when __qseecom_get_fw_size() returns error.

Change-Id: I82406c39a2def87395811f442f39b57201766091
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2017-01-30 03:36:50 -08:00
Zhen Kong ea1eb5865a qseecom: fix incomplete error handling for several functions
Perform a complete or adequate check of return codes for several
functions, including __qseecom_enable_clk, ion_do_cache_op and
ion_sg_table(), used by qseecom.

Change-Id: Ib1682bdc6d3034a22586af62a3d8986c54d369d5
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2017-01-30 15:01:45 +05:30
Zhen Kong 9c9c161925 qseecom: improve input validatation for qseecom_send_service_cmd
Make change to improve input validation on request and response
buffers' address and length for qseecom_send_service_cmd.

Change-Id: I047e3264333d767541e43b7dadd1727232fd48ef
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2017-01-27 03:23:00 -08:00
kunleiz 17743ef87b ASoC: msm: qdspv2: add mutex lock when access output buffer length
Add mutex protection to avoid access output_len in parallel.

CRs-Fixed: 1104067
Change-Id: I4e17258e2abee9cd68152f4b79520b00003aa80d
Signed-off-by: kunleiz <kunleiz@codeaurora.org>
2017-01-19 13:29:19 +05:30
Zhen Kong 7191fa54dd qseecom: improve error checks in qseecom_probe()
Make change in qseecom_probe() to improve the error return value
checks on some subfunctions, and free memory allocated within
qseecom_retrieve_ce_data.

CRs-fixed: 1075082
Change-Id: I971e555ec8d02ccf4382e83132a696b065a8ff12
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2017-01-10 15:48:56 +05:30
Brahmaji K 12e2488f45 msm-3.18: drivers : added validation of input/output buffer sizes
This change fixes issues reagrding the ioctl
QSEECOM_IOCTL_MDTP_CIPHER_DIP_REQ uncovered by fuzzy tests.
Modified handler of above ioctl, not to allow input/output
buffer sizes greater than a fixed defined size.

Change-Id: I69f94a29d939341564f6f3ebfda48fceaa934542
Signed-off-by: Brahmaji K <bkomma@codeaurora.org>
2017-01-03 22:26:04 -08:00
Zhen Kong 6c3d41026e qseecom: whitelist support for kernel client and listener
Add whitelist support for listener to send modified resp to TZ;
also add whitelist support for kernel client; and change the method
to check whitelist feature.

Change-Id: I0030b0008d6224cda3fdc1f80308a7e9bcfe4405
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Signed-off-by: Mallikarjuna Reddy Amireddy <mamire@codeaurora.org>
2017-01-03 14:29:15 +05:30
Linux Build Service Account 3885b8e79b Merge "qseecom: check buffer size when loading firmware images" 2016-12-26 04:49:31 -08:00
Zhen Kong b2617293f6 qseecom: check buffer size when loading firmware images
Make change in __qseecom_load_fw() and qseecom_load_commonlib_image()
to check buffer size before copying img to buffer.

CRs-fixed: 1080290
Change-Id: I0f48666ac948a9571e249598ae7cc19df9036b1d
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2016-12-24 04:15:00 -08:00