Commit graph

900 commits

Author SHA1 Message Date
Vignesh Kulothungan
a935cbe437 msm: adm: validate ADSP payload size before access
Check the size of ADSP payload before accessing it.

CRs-Fixed: 2380694
Change-Id: Icdc19a85b39a397ba6d7177f42ece4626b901832
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2019-05-22 12:18:41 -07:00
Linux Build Service Account
44d964e1d2 Merge "dsp: afe: check for minimum size before payload access" 2019-05-21 18:16:58 -07:00
Karthikeyan Mani
a919f50d96 dsp: afe: check for minimum size before payload access
Check if payload data is atleast the minimum expected size
before accessing the data in it.

Change-Id: Ia1295ca5ad5d002122e416fae53588681da687ea
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-05-21 10:37:29 -07:00
Vatsal Bucha
f455966ef0 msm: qdsp6v2: Check size of payload before access
Check size of payload array before access in qdsp_mvm_callback.

Change-Id: I81d945f963cfb4a3cb26155700b82880d891ec5e
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-05-21 05:43:31 -07:00
Karthikeyan Mani
26ac9f568e dsp: afe: check for payload size before payload access
Check if payload data is big enough before accessing
the data in it.

Change-Id: I939f205a8cebf6ef4859f81fae5429bca013d540
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-05-20 00:39:09 -07:00
kunleiz
15c87d11b5 lsm: check payload size validity before using it as array index
Payload size validity is not checked before using it in array index.
Check payload size to avoid out-of-boundary memory.

Change-Id: Ic0b06bb331fc1753ff7543bb218ab12d6a4a3ca8
Signed-off-by: kunleiz <kunleiz@codeaurora.org>
2019-04-29 02:14:22 -07:00
Xiaojun Sang
1b75396524 dsp: asm: validate payload size before access
Payload size is not checked before payload access. Check it
to avoid out-of-boundary memory access.

Change-Id: Iaa39ee4ea5489bb5579e7b7d5dfada12d88c5809
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2019-04-10 15:36:09 +08:00
Linux Build Service Account
dd45e2fcea Merge "msm: asm: validate ADSP data before access" 2019-04-02 14:00:26 -07:00
Linux Build Service Account
1dc6edb0ef Merge "dsp: q6voice: Check size of shared memory buffer before access" into msm-4.4.c10 2019-04-02 13:42:06 -07:00
Xiaojun Sang
950b66256c asoc: check payload length against structure size
Payload length must exceed structure size. Otherwise, it may
lead to out-of-boundary memory access.

Change-Id: I090de5116ab04a4ca2b9c485e17617fe9e861ad5
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2019-04-01 19:56:53 -07:00
Vatsal Bucha
920b58ced9 dsp: q6voice: Check size of shared memory buffer before access
Check buffer size in qdsp_cvs_callback before access in
ul_pkt.

Change-Id: Ic19994b46086709231656ec747d2df988b7a512f
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-04-01 04:42:20 -07:00
Vignesh Kulothungan
ed93ca6232 msm: asm: validate ADSP data before access
Validate buffer index obtained from ADSP token before using it.

CRs-Fixed: 2372302
Change-Id: I5c3b1634bd08b516844638dd67f726a882edfc17
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2019-03-28 18:29:01 -07:00
Xiaojun Sang
7289a6a51e dsp: validate token before usage as array index
Token from DSP might be invalid for array index. Validate the
token before being used as array index.

Change-Id: I9f47e1328d75d9f9acf7e85ddb452019b6eced0a
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2019-03-26 05:23:32 -07:00
Rohit kumar
8c12285cf3 dsp: asm: Add check for num_channels before calling q6asm_map_channels
Channel_mapping array size varies for different commands.
Add check for num_channels before calling q6asm_map_channels.

Change-Id: Iccbcfe82f716fc0ffe0a26b1779dcaa1c3cb805b
Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
2019-03-01 03:42:08 -08:00
Soumya Managoli
c29b12e26d ASoC: msm: qdsp6v2: Handle invalid session for dtmf enable
If session id is invalid then dtmf voice info will also
be invalid.

Add check to return error if session id is invalid.

CRs-Fixed: 2306771
Change-Id: I362340f9f666c95949eaa94d0ced4cb3a1b9abab
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
2018-09-17 03:53:13 -07:00
Tanya Dixit
700502714a rtac: Add mutex lock to ensure proper fops access
Add mutex lock in rtac_open and rtac_release
to avoid usage count discrepancies leading
to multiple calls to unmap memory resulting in
null pointer dereference.

CRs-Fixed: 2271712
Change-Id: Ie6da28837c352030b8d7e377d68a70cf04e7072a
Signed-off-by: Tanya Dixit <tdixit@codeaurora.org>
2018-09-11 19:07:54 +05:30
Soumya Managoli
5206b51937 asoc : msm: Fix zero size pointer issue
APPS crashes randomly due to invalid memory allocation
in q6asm_audio_client_buf_free_contiguous.
Added check to return error if memory allocation size is 0.

Change-Id: I40f49aa147d513b29b56224a5ee77ccbb2dcc110
CRs-Fixed: 2285272
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
2018-09-04 04:53:26 -07:00
Erin Yan
2a7de56683 q6asm: retry asm_open_read and asm_open_loopback when session id conflict
The ADSP asm session ids are managed by the kernel driver. It's all right
for native use cases. But for virtualization use cases, there's no way to
synchronize the session ids' status among virtual machines.  Playing back
in one virtual machine is probably failed, because the session id may had
been occupied by a use case in another virtual machine.

The patch allowed audio capture stream and loopback stream to try all
available session ids in case of session id conflict error, to support
concurrent playback from multiple virtual machines.

Change-Id: I01b4da65f3e5716dd14c20c614b53f3c45dd9ea3
Signed-off-by: Erin Yan <xinyey@codeaurora.org>
2018-08-14 19:49:31 -07:00
Satish Babu Patakokila
595690c416 ASoC: msm: Fix config control indices for TX DAIs
Correct the config control indices for TX DAIs of MI2S interface.

Change-Id: Ie8bf646a0c1fbd30abdb34703ae1f90ed9b484e8
Signed-off-by: Satish Babu Patakokila <sbpata@codeaurora.org>
2018-07-10 03:50:13 -07:00
Soumya Managoli
06cd2ea4b5 ASoC: msm: qdsp6v2: Update LSM param hdr size
q6lsm_pack_params requires param hdr size
to be filled and sent as argument.
Change is to update size with param_hdr_v3 struct size.

Change-Id: Id2380f3ceb887e1fc73b7f5f8e28ac93029082e4
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
2018-07-06 05:01:11 -07:00
Ramprasad Katkam
804e259983 ASoC: msm: qdsp6v2: Add mutex protection for rtac cal apis
Add mutex lock protection to synchronize rtac
calibration set and get api calls.

Change-Id: Ieb2d01642ecefff6405bb59554157c304b4b651d
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-07-02 07:06:01 -07:00
Linux Build Service Account
b6a5f53741 Merge "ASoC: msm: qdsp6v2: add routing from MM6 to SEC MI2S RX" 2018-06-27 14:44:12 -07:00
Linux Build Service Account
daa592e855 Merge "ASoC: msm: Support different POPPs to single COPP" 2018-06-21 13:37:46 -07:00
Linux Build Service Account
b60fb8e724 Merge "ASoC: msm: qdsp6v2: Fix rtac memory unmap issue in ASM driver" 2018-06-21 04:04:07 -07:00
Linux Build Service Account
8164a41508 Merge "ASoC: msm: qdsp6v2: Fix return code check in adm driver" 2018-06-21 04:04:06 -07:00
Linux Build Service Account
9b81f1aebb Merge "ASoC: msm: qdsp6v2: Fix AFE RTC set parameter" 2018-06-21 04:04:05 -07:00
Derek Chen
a83fb6663f ASoC: msm: qdsp6v2: add routing from MM6 to SEC MI2S RX
Add routing support from multimedia6 frontend
to secondary MI2S RX backend.

Change-Id: I6755fcf2a0fef0407d3492fe66260d22de2a7daf
Signed-off-by: Derek Chen <chenche@codeaurora.org>
2018-06-21 00:14:48 -07:00
Aditya Bavanari
e4f474eb8e ASoC: msm: qdsp6v2: Fix AFE RTC set parameter
Fix offset address to use set parameter structure while
copying data from user instead of get parameter structure
for AFE_PORT_CMD_SET_PARAM_V3 case.

CRs-Fixed: 2256728
Change-Id: I61e41f366f365734a47080b79179fbe3021ee8a7
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2018-06-19 19:01:12 +05:30
Aditya Bavanari
04708e34ee ASoC: msm: qdsp6v2: Fix rtac memory unmap issue in ASM driver
During unmap of rtac block in ASM, mem_map_handle
address is set to zero instead of the value. Set the
map handle value to zero to avoid issue in freeing the
ion memory.

CRs-Fixed: 2254339
Change-Id: I6584be029d4c8dde235e722149c758df0db9916e
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2018-06-19 17:50:52 +05:30
Vatsal Bucha
f57e402a5a sdm660-internal: Fix DMIC3&4 mute in voice call during APSS sleep
Add ignore sleep for DMIC 3 and 4 to fix mute in voice call.

CRs-Fixed: 2258957
Change-Id: Ia33aec6796e965080a978d3e158d78ae03f9b717
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2018-06-19 05:15:02 -07:00
Aditya Bavanari
c966bc9cff ASoC: msm: qdsp6v2: Fix return code check in adm driver
Return error only if apr_send_pkt() function
return code is less than 0.

CRs-Fixed: 2262017
Change-Id: I98903c6c275f360d32c3af523352071d92d1ef85
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2018-06-19 17:31:10 +05:30
Cong Tang
c1bed40d2d ASoC: msm: Support different POPPs to single COPP
For multi COPP feature it could only allow POPPs with same app_type
to connect single COPP. But it's possible to connect different POPPs
with different app_type to single COPP, to achieve this, it should
skip the app_type check when create copp_idx.

Change-Id: Ic8d7c63d317baba09768d08bc723a6b097322f63
Signed-off-by: Cong Tang <congt@codeaurora.org>
2018-06-18 20:54:41 -07:00
Linux Build Service Account
51b2f06de2 Merge "ASoC: msm: qdsp6v2: add lsm support for tdm ports" 2018-06-15 03:06:20 -07:00
Linux Build Service Account
f8c3bac9ce Merge "ASoC: msm: qdsp6v2: Rx DTMF detection via voice stream callback" 2018-06-15 03:06:19 -07:00
Vatsal Bucha
b9e306af63 ASoC: qdsp6v2: Fix null pointer dereference for prtd pointer
Private data pointer may not be initialized before
access it in adsp_stream_cmd_put. NULL check for prtd
avoids the issue.

CRs-Fixed: 2252497
Change-Id: Ibd888be601d5b42ed4f4644ed22596a26b61f8fe
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2018-06-13 22:59:54 -07:00
Timothy Sham
fe515e9936 ASoC: msm: qdsp6v2: Rx DTMF detection via voice stream callback
Allow msm-pcm-voice-v2 driver to enable Rx DTMF detection and
route the DTMF detection event from QDSP6 to a registered
mixer event callback.

Change-Id: I9ffb714d1ec5dd0f4e2c229830d7170324b295bb
Signed-off-by: Timothy Sham <tsham@codeaurora.org>
2018-06-12 14:00:49 -04:00
Derek Chen
e049020258 ASoC: msm: qdsp6v2: add lsm support for tdm ports
Add LSM routing and kcontrol support for TDM
backend ports.

Change-Id: Ie6d05691a3e763fe1b7f37dd86415091f7da0e6d
Signed-off-by: Derek Chen <chenche@codeaurora.org>
2018-06-08 15:10:11 -07:00
Linux Build Service Account
ebae906ccd Merge "q6asm: retry asm open in case of session id conflict" 2018-06-08 10:20:25 -07:00
Linux Build Service Account
51c5c162c1 Merge "ASoC: msm: Add mixer controls for module enabling" 2018-06-05 20:30:51 -07:00
Han Lu
53c8faf4dc q6asm: retry asm open in case of session id conflict
The ADSP asm session ids are managed by the kernel driver. It's all right
for native use cases. But for virtualization use cases, there's no way to
synchronize the session ids' status among virtual machines.  Playing back
in one virtual machine is probably failed, because the session id may had
been occupied by a use case in another virtual machine.

The patch allowed audio playback stream to try all available session ids
in case of session id conflict error, to support concurrent playback from
multiple virtual machines.

Change-Id: If98d05898cec3f05d80c750ec8a014add3b1f34c
Signed-off-by: Han Lu <hanlu@codeaurora.org>
2018-06-04 00:32:36 -07:00
Linux Build Service Account
addd4dab16 Merge "ASoC: msm: add boot marker for mi2s and auto sound card" 2018-05-29 05:07:37 -07:00
Rahul Sharma
e01d6aedaa ASoC: msm: Add mixer controls for module enabling
Mixer controls are added to enable or disable
ADSP modules.

Change-Id: Ia2471c3fc25429001ccf19d6b30d34d6e2cf9d27
Signed-off-by: Rahul Sharma <rahsha@codeaurora.org>
2018-05-27 16:24:45 +05:30
Linux Build Service Account
7879aadfcc Merge "asoc: msm8998: Add configuration for adaptive bitrate." 2018-05-26 13:26:51 -07:00
Linux Build Service Account
45c4f7d22f Merge "ASoC: msm: Modify buf size check to prevent OOB error" 2018-05-24 02:46:45 -07:00
Soumya Managoli
fd819b7aa3 asoc: msm8998: Add configuration for adaptive bitrate.
Add hostless front end DAI to trigger backend
configuration of BT backend dai required for
configuring BT ABR statistics. Add mixer ctrls
to independently configure TX and RX sample
rates to allow BT RX and TX backends.

Change-Id: Iac3cd5317db2653a87f106d43cfc7fe90e4f4875
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
2018-05-23 22:21:52 -07:00
Zhiqiang Tu
996c86f94e ASoC: msm: add boot marker for mi2s and auto sound card
Add boot marker for booting KPI measurement.

Change-Id: I58fac2a1bed4f9c4e484b3dadb6a766c260f3f06
Signed-off-by: Zhiqiang Tu <ztu@codeaurora.org>
2018-05-22 13:33:41 +08:00
Linux Build Service Account
1ff291a124 Merge "ASoC: msm: check payload size before memory allocation" 2018-05-20 19:31:51 -07:00
Linux Build Service Account
e1c2b1f918 Merge "ASoC: msm: qdsp6v2: return the proper LPASS status" 2018-05-20 19:31:50 -07:00
Linux Build Service Account
45df31e9af Merge "ASoC: msm: qdsp6v2: increase max Rx DTMF duration" 2018-05-16 10:28:44 -07:00
Xiaojun Sang
ad40ee7b44 ASoC: msm: check payload size before memory allocation
Buffer from mixer ctl or ADSP is composed of payload size and
actual payload. On a 32 bit platform, we could have an overflow
if payload size is below UINT_MAX while payload size + sizeof(struct)
is over UINT_MAX. Allocated memory size would be less than expected.
Check payload size against limit before memory allocation.

Change-Id: I0bf19ca7b8c93083177a21ad726122dc20f45551
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2018-05-16 14:28:32 +08:00