17 Commits

Author SHA1 Message Date
Abinath S
41fedaff65 asoc: codec: avoid out of bound write to map array
added check for port num and channel iteration are lessthan 8
to avoid out of bound write to 8x8 map array.

Change-Id: I4c6fe13a5eb09be623a1c40ce16c5a5e4246e021
Signed-off-by: Abinath S <quic_abins@quicinc.com>
2025-03-13 01:23:08 +02:00
Shaik Jabida
7441b2abba dsp: q6voice: Adds checks for an integer overflow
there is no check for cvs_voc_pkt[2],when receives
0xffffffff from ADSP which results in an integer overflow
Fix is to address this.

Signed-off-by: Shaik Jabida <quic_sjabida@quicinc.com>
(cherry picked from commit 4524418cd14dce47e4ea7234618f919e28dbbe5a)
Change-Id: I2edaef7a22bf0e8d517b3269d004992a3ca35d4f
2024-11-07 12:29:52 +02:00
Sandhya Mutha Naga Venkata
2691212173 dsp: q6voice: Adds checks for an integer overflow
there is no check for cvs_voc_pkt[2],when recieves
0xffffffff from ADSP which results in an integer overflow
Fix is to address this.

Change-Id: Ie935dd8823981ec260d77f5117f4ef0b0fc08f60
Signed-off-by: Ramireddy KrishnaKanth Reddy <quic_ramikris@quicinc.com>
(cherry picked from commit 4524418cd14dce47e4ea7234618f919e28dbbe5a)
Signed-off-by: Sandhya Mutha Naga Venkata <quic_smuthana@quicinc.com>
2024-11-07 12:29:35 +02:00
Soumya Managoli
fe0d9d97a6 dsp: q6lsm: Address use after free for mmap handle
The global declared mmap_handle can be left dangling
for case when the handle is freed by the calling function.
Fix is to address this. Also add a check to make sure
the mmap_handle is accessed legally.

Change-Id: I367f8a41339aa0025b545b125ee820220efedeee
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2024-01-07 16:55:13 +02:00
Soumya Managoli
ee61fea98c ASoC: msm-pcm-host-voice: Check validity of session idx
Added check for voice session index.

Change-Id: Ifff36add5d62f2fdc3395de1447075d297f2c2df
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2024-01-07 16:54:00 +02:00
Soumya Managoli
5d0165981d ASoC: msm-pcm-voip: Avoid interger underflow
There is no check for voip pkt pkt_len,if it contains the
minimum required data. This can lead to integer underflow.
Add check for the same.

Change-Id: I91d4f2ad8dfb060cdb2ab9e36dc9f886ea40908a
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-11-07 01:17:43 +02:00
Soumya Managoli
74a44694c4 ASoC: msm-pcm-host-voice: Address buffer overflow in hpcm copy
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-11-07 01:17:43 +02:00
Shalini Manjunatha
2921cb868a BACKPORT: dsp: afe: check for param size before copying
Check for the proper param size before copying,
to avoid buffer overflow.

Original-Change-Id: I70c52e6ab76f528ea3714784ab9013b070839c40
Signed-off-by: Shalini Manjunatha <quic_c_shalma@quicinc.com>
Change-Id: Ic7fa9b3dd047d8eeba3cea02b99d6bc5b9df8daf
2023-11-07 01:17:43 +02:00
Soumya Managoli
799272e197 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.

Original-Change-Id: I4c9d7215b9c7345637e1eb3a1992a41fef71c5cb
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
Change-Id: I55fd3ea6bf214e3852c58f8dcae9ada4723fa7d8
2023-11-07 01:17:43 +02:00
Karthikeyan Mani
cffb9c9276 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>
2023-11-07 01:17:42 +02:00
siimsek
3016d51b1c ASoC: wcd_cpe: Fix enum-conversion warnings
techpack/audio/asoc/codecs/wcd_cpe_services.c:658:17: error: implicit
conversion from enumeration type 'enum cpe_svc_result' to different
enumeration type 'enum cmi_api_result' [-Werror,-Wenum-conversion]
        notif.result = result;
                     ~ ^~~~~~
techpack/audio/asoc/codecs/wcd_cpe_services.c:1350:8: error: implicit
conversion from enumeration type 'enum cpe_svc_result' to different
enumeration type 'enum cpe_process_result' [-Werror,-Wenum-conversion]
                rc = cpe_send_msg_to_inbox(t_info, 0, m);
                   ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.

Change-Id: Ib9fce60017066e9c96e79195d7dba9ffb9177148
2023-10-26 13:42:53 +03:00
Shalini Manjunatha
3ce191ae1e BACKPORT: 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-10-02 21:04:14 +03:00
Soumya Managoli
a5b8455c18 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-10-02 21:04:10 +03:00
Nathan Chancellor
549658cce5 ASoC: wcd_cpe_core: Fix buffer overflow in wcd_cpe_init
Clang warns:

../techpack/audio/asoc/codecs/wcd_cpe_core.c:1981:2: warning: 'snprintf'
size argument is too large; destination buffer has size 11, but size
argument is 13 [-Werror,-Wfortify-source]
        snprintf(proc_name, (sizeof("cpe") + sizeof("_state") +
        ^
1 warning generated.

Fixes: 8e2277f79f ("audio-lnx: Initial change for techpack of audio drivers.")
Change-Id: Ide9f1ba2b854ca854918f8ebfd22f8d24c12164b
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2022-09-09 05:50:59 +03:00
Danny Lin
9a33b12a5e techpack: audio: Remove build timestamps
These are causing parts of techpack/audio to get rebuilt on every build
for no reason.

Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Change-Id: I4cf8e7ae1cc9492254af7fa8ba81594555e10d6d
2022-08-26 23:37:35 +03:00
Michael Bestas
af08067480 Add 'techpack/audio/' from tag 'android-13.0.0_r0.2'
git-subtree-dir: techpack/audio
git-subtree-mainline: 8ae7b4ca85
git-subtree-split: 7180968095
Change-Id: Id0c2fb0923f1bcd677aacbb931d99564d881dbfb
2022-08-26 23:34:03 +03:00
Bryan Huntsman
fe62387756 techpack: add a snapshot of tech package support
Add a snapshot of tech package support from msm-4.19 to msm-4.14 from
commits as of:
'commit <50327f3450f1> (techpack: add tech package support)'
'commit <8082260ee599> (techpack: set configuration default to yes)'
'commit <776ec744ee23> (techpack: Kbuild: Fix to compile the techpack
completely)'.

Change markings to 4.14 style.

Change-Id: I446e7cf0f185181caa5e62cf42a2ff972f99be35
Signed-off-by: Xiaowen Wu <wxiaowen@codeaurora.org>
2020-05-05 15:35:43 -04:00