Commit Graph

4142 Commits

Author SHA1 Message Date
qctecmdr
5423d9ef23 Merge "ASoC: dsp: q6core: Avoid use after free" 2023-08-01 05:50:22 -07:00
qctecmdr
3523bb525a Merge "ASoC: Resolve use after free in listen sound client" 2023-08-01 05:50:22 -07:00
Soumya Managoli
a69e001b34 ASoC: Resolve use after free in listen sound client
Updated get_param_payload buffer ptr to NULL
after free to avoid use after free issue.

Change-Id: I86da8c12a0bdccce690f67b037198b67640e339b
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-07-31 16:10:36 +05:30
Soumya Managoli
e3971c3e31 ASoC: dsp: q6core: Avoid use after free
Add check for AVCS_CMD_RSP_LOAD_MODULE response payload
to avoid its access after free.

Change-Id: I3023e6676a27fe33d2cc0f44a49813f0ed0ebe3b
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-07-25 23:08:50 -07:00
Soumya Managoli
bbf1413556 ASoC: msm-lsm-client: Integer overflow check
Add integer overflow check for lsm_params_get_info size.

Change-Id: I1130b5294f5de65eb8c595030c4db221337b1c8a
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-07-19 22:43:33 -07:00
Shalini Manjunatha
ba56a64009 asoc:msm-lsm-client: check for param size before copying
check for the proper param size before copying,
to avoid OOB memory access of buffer.

Change-Id: I8e9bd3b4be9a2797e76dce403578c038fc07dd58
Signed-off-by: Shalini Manjunatha <quic_c_shalma@quicinc.com>
2023-07-13 05:19:47 -07:00
Shalini Manjunatha
f47869b550 ASoC: msm-pcm-q6-v2: Add dsp buf check
Fix is to add check for this ADSP returned buf offset + size,
if it is within the available buf size range

Change-Id: I400cc4f5c07164f0a9b405ebea144ea0ae4b6cf2
Signed-off-by: Shalini Manjunatha <quic_c_shalma@quicinc.com>
2023-06-27 16:30:54 +05:30
Boyuan Yan
1a53e0ded7 ASoC: Add the judgment for TDM
Add support to remove unnecessary TDM route where TDM is not need.

Change-Id: I56aee33cbb9ecbc190fc24bfa14a071263661292
Signed-off-by: Boyuan Yan <quic_boyuyan@quicinc.com>
2023-06-21 00:19:25 -07:00
qctecmdr
25d4369a38 Merge "asoc: swrm: disable bus reset based on swrm verison" 2023-06-02 20:48:35 -07:00
qctecmdr
2078a881a3 Merge "dsp: afe: Add check for num_channels" 2023-06-02 00:34:00 -07:00
Vijay Kumar Maddula
40946c4d07 asoc: swrm: disable bus reset based on swrm verison
Bus reset is creating mismatch in interrupt generation sequence
and leading to audio playback mute.
Disabling bus reset for soundwire master version 1.5

Change-Id: I1d41a8d11d1f86c8a538f0b8d234bb6d001268ad
Signed-off-by: Vijay Kumar Maddula <quic_vmaddula@quicinc.com>
2023-06-01 23:09:38 -07:00
qctecmdr
5b442f55ec Merge "ASoC: msm-pcm-voip: Avoid interger underflow" 2023-06-01 12:27:26 -07:00
qctecmdr
f84fb83ead Merge "dsp: afe: check for param size before copying" 2023-06-01 12:27:26 -07:00
qctecmdr
1ec47d24b6 Merge "dsp: afe: Add check for sidetone iir config copy size" 2023-06-01 12:27:26 -07:00
qctecmdr
e9cdb60d7b Merge "ASoC: msm-pcm-host-voice: Address buffer overflow in hpcm playback copy" 2023-06-01 12:27:25 -07:00
qctecmdr
b1e8cf3187 Merge "dsp: q6core: validate payload size before access for AVCS" 2023-06-01 12:27:25 -07:00
qctecmdr
6ca72c1cd0 Merge "dsp: asm: validate payload size before access" 2023-06-01 12:27:25 -07:00
qctecmdr
efbb81f9ad Merge "soc: swr-mstr-ctrl: add new lock to sync runtime_resume and runtime_suspend" 2023-05-31 20:48:04 -07:00
Soumya Managoli
7db940a090 dsp: afe: Add check for sidetone iir config copy size
Avoid OOB access of sidetone iir config array when
iir_num_biquad_stages returned from cal block is > 10

Change-Id: I45b95e8bdd1a993a526590c94cf2f9a85c12af37
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-05-30 11:44:18 +05:30
Soumya Managoli
e21e857f42 ASoC: msm-pcm-host-voice: Address buffer overflow in hpcm playback copy
Add buf len check for the playback data before copy
to avoid OOB issues.

Change-Id: I737d09e275463292365cd183b9a43d09ff9ccbf2
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-05-29 15:41:20 +05:30
Soumya Managoli
1a2e110c23 ASoC: msm-pcm-voip: Avoid interger underflow
There is no check for voip pkt pkt_len,if it contains the
min required data. This can lead to integer underflow.
Add check for the same.

Change-Id: I40242429542b6c32a0e6c3bbe03975c244c2f61a
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-05-29 15:06:54 +05:30
Shalini Manjunatha
b7599b3751 dsp: asm: validate payload size before access
Payload size is not checked before payload access. Check size
to avoid out-of-boundary memory access.

Change-Id: I1bd8281ad263b8c0102335504a740312755b8d15
Signed-off-by: Shalini Manjunatha <quic_c_shalma@quicinc.com>
2023-05-25 00:03:31 -07:00
Shalini Manjunatha
2046b3b25b dsp: afe: check for param size before copying
check for the proper param size before copying,
to avoid buffer overflow.

Change-Id: I70c52e6ab76f528ea3714784ab9013b070839c40
Signed-off-by: Shalini Manjunatha <quic_c_shalma@quicinc.com>
2023-05-24 23:33:07 -07:00
Shalini Manjunatha
502410201a dsp: q6core: validate payload size before access for AVCS
Payload size is not checked before payload access for AVCS.
Check size to avoid out-of-boundary memory access.

Change-Id: I6de3342617bd4f3fb8849ad2230dd57c07469372
Signed-off-by: Shalini Manjunatha <quic_c_shalma@quicinc.com>
2023-05-24 06:58:06 -07:00
qctecmdr
98fd7ebdbc Merge "ASoC: msm-pcm-voip: Avoid interger underflow" 2023-05-20 08:24:31 -07:00
qctecmdr
259e975f99 Merge "dsp: q6adm: Resolve mem corruption in adm cb" 2023-05-20 08:24:31 -07:00
qctecmdr
bec8d6d97f Merge "dsp: q6core: Avoid OOB access in q6core" 2023-05-20 08:24:31 -07:00
qctecmdr
e04569edc4 Merge "ASoC: msm-pcm-host-voice: Address buffer overflow in hpcm capture copy" 2023-05-20 08:24:31 -07:00
qctecmdr
3742f71065 Merge "dsp: q6voice: Add buf size check for cvs cal data" 2023-05-20 08:24:31 -07:00
Soumya Managoli
2f6eb70111 ASoC: msm-pcm-voip: Avoid interger underflow
There is no check for voip pkt pkt_len,if it contains the
min required data. This can lead to integer underflow.
Add check for the same.

Change-Id: I4f57eb125967d52ad8da60d21a440af1f81d2579
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-05-17 18:39:17 +05:30
Soumya Managoli
7756692d54 ASoC: msm-pcm-host-voice: Address buffer overflow in hpcm capture copy
There is no check for the copy data size of the
ADSP returned payload. Add check for the max
hpcm_buf_node size before copy to avoid
buffer out of bounds issue.

Change-Id: Id647888430ce302359a857ef54d321bee99889bf
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-05-17 18:32:01 +05:30
Soumya Managoli
3b0442cec3 dsp: q6core: Avoid OOB access in q6core
"num_services", a signed integer when compared
with constant results in conversion of signed integer
to max possible unsigned int value when "num_services"
is a negative value. This can lead to OOB read.
Fix is to handle this case.

Change-Id: Id6a8f150d9019c972a87f789e4c626337a97bfff
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-05-17 18:26:51 +05:30
Soumya Managoli
8c0d7cffab dsp: q6voice: Add buf size check for cvs cal data
Check for the max size of cvs command register
calibration data that can be copied else will
result in buffer overflow.

Change-Id: Id7a4c5a9795143798b68dfde779f17fb450e3848
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-05-17 15:59:27 +05:30
Soumya Managoli
3ebb66aa5d ASoC: msm-pcm-host-voice: Handle OOB access in hpcm_start
There is no error check for case when hpcm_start
is called for the same RX or TX tap points multiple times.
This can result in OOB access of struct vss_ivpcm_tap_point.
Handle this scenario with appropriate no_of_tp check.

Change-Id: Ib384d21c9bf372f3e5d78f64b5c056e836728399
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-05-17 13:35:43 +05:30
Soumya Managoli
2e8272c7f6 dsp: afe: Add check for num_channels
Check for valid num_channels before accessing.

Change-Id: I8f39d12e2f5f52fa145fbd3aed2b023afaa2b53b
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-05-16 12:03:56 +05:30
Soumya Managoli
19791049de soc: swr-mstr-ctrl: add new lock to sync runtime_resume and runtime_suspend
runtime_suspend may get from multi functions and reslock is
unlock and lock inbetween which may cause clk count mismatch
with multi rutime_suspend called. Add new lock to make sure
runtime_suspend is run in sequence.

Change-Id: Ie465ded6dc1db1244035e9f4d216466b630df82b
Signed-off-by: Meng Wang <mengw@codeaurora.org>
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-04-24 18:35:42 +05:30
Soumya Managoli
5b1fd59531 soc: reduce the auto suspend timeout when swr event finished
the APSS would suspend within ~120ms after audio off, if system suspend
swrm_suspend() is called before swrm_runtime_suspend. The clock stop
sequence require writing IPC and expect interrupt, which would stop
the APSS to be suspended. Reduce the auto suspend time specifically when
swr event is done can call the swrm_runtime_suspend

Change-Id: Iee0c9143d65e5a8e68a8e20ab73bea9def1920bd
Signed-off-by: Junkai Cai <junkai@codeaurora.org>
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-04-24 11:34:26 +05:30
Soumya Managoli
dcfb376d70 dsp: q6adm: Resolve mem corruption in adm cb
Conversion of negative "num_modules" var value
will result in max possible unsigned int value
and hence can cause mem corruption when accessed.

Resolve this by assigning the same data type
to "num_modules" var as used in the calling fn.

Change-Id: I4c9d7215b9c7345637e1eb3a1992a41fef71c5cb
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-04-05 16:02:15 +05:30
qctecmdr
fad96773ea Merge "asoc: compress: Modify incorrect partial buffer size check" 2023-03-24 03:14:32 -07:00
qctecmdr
3a37affb89 Merge "dsp: Add check for negative value size" 2023-03-24 03:14:32 -07:00
Shalini Manjunatha
1b16d157fa asoc: compress: Modify incorrect partial buffer size check
Due to incorrect check for buffer size calculation during partial buffer size check,
which is part of code for gapless playback support in GKI mode,
partial buffers are missed from sending to DSP causing buffer handling issues.

Change-Id: Ic6f5a3ce6958ddc94dc7bb7e92ebb778aa13cb64
Signed-off-by: Shalini Manjunatha <quic_c_shalma@quicinc.com>
2023-03-20 12:17:44 +05:30
Long Li
b39f6924f3 asoc: msm-pcm-routing-auto: Add checks to enable senary port
Add checks to enable senary port.

Change-Id: I100d785842780ad32e8693f3b4a77dbfb0d5746b
Signed-off-by: Long Li <quic_lonli@quicinc.com>
2023-03-13 15:40:26 +05:30
Sujin Panicker
2bd17f3f0d dsp: Add check for negative value size
There is a possibility where an access
to /dev/msm_audio_cal from third party
could pass negative size which would
lead to crash.
Avoid this by negative value size check.

Change-Id: Id36c5f10dccbd7d0ee85aa3310badec6815237a2
Signed-off-by: Sujin Panicker <quic_spanic@quicinc.com>
2023-02-22 22:02:36 -08:00
qctecmdr
819940c283 Merge "asoc: Fix possible overflow in routing driver" 2023-02-22 02:44:15 -08:00
Kishan Kumar Majeti
6a133ce3b4 asoc: Fix possible overflow in routing driver
Send SOC_NO_PM in reg filed to avoid overflow in DAPM operation

Change-Id: Id4845f1513612b54c7949d7c5c921f0529e5b847
Signed-off-by: Kishan Kumar Majeti <quic_kkmajeti@quicinc.com>
2023-02-21 13:46:56 +05:30
Manoj Kumar N D
8440c8f137 asoc : Update proper comment for endpoint 2
Update proper description to explain
the usage of endpoint ID 2.

Change-Id: I45a52ef43c3fcd42f97de37e7bb80517dfe09db3
Signed-off-by: Manoj Kumar N D <quic_mnd@quicinc.com>
2023-02-19 22:56:12 -08:00
Manoj Kumar N D
60eaf5fe50 asoc : mark used cal block as stale
Mark the used cal block as stale so that it is not reused.

Change-Id: I142d21d6d32a1b5ad24c3a2708b1df023d70947e
Signed-off-by: Manoj Kumar N D <quic_mnd@quicinc.com>
2023-02-13 05:16:11 -08:00
qctecmdr
381b946f06 Merge "asoc: Add build option for qcs6490" 2023-02-08 22:34:31 -08:00
qctecmdr
7d18564cd4 Merge "asoc: kona: Add QUAD I2S EBIT clk define to kona" 2023-02-08 10:19:23 -08:00
Boyuan Yan
8972574067 asoc: Add build option for qcs6490
Add build option for qcs6490.

Change-Id: I2cd3ac1e296c8eb64702d26d0cb461052bc3ade2
Signed-off-by: Boyuan Yan <quic_boyuyan@quicinc.com>
2023-02-07 01:37:53 -08:00