Loading asoc/msm-audio-effects-q6-v2.c +9 −0 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/slab.h> Loading Loading @@ -1002,6 +1003,14 @@ int msm_audio_effects_pbe_handler(struct audio_client *ac, pbe->config.reserved = GET_NEXT(values, param_max_offset, rc); if ((pbe->config.bandpass_filter_order > 3) || (pbe->config.bandpass_filter_order < 1)) { pr_err("%s: Invalid BPF order\n", __func__); rc = -EINVAL; goto invalid_config; } p_coeffs = &pbe->config.p1LowPassCoeffs[0]; lpf_len = (pbe->config.xover_filter_order == 3) ? 10 : 5; hpf_len = (pbe->config.xover_filter_order == 3) ? 10 : 5; Loading asoc/msm-lsm-client.c +10 −0 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/init.h> #include <linux/err.h> Loading Loading @@ -2430,6 +2431,15 @@ static int msm_lsm_ioctl(struct snd_pcm_substream *substream, err = -EFAULT; goto done; } if (temp_p_info.param_size > 0 && ((INT_MAX - sizeof(temp_p_info)) < temp_p_info.param_size)) { pr_err("%s: Integer overflow\n", __func__); err = -EINVAL; goto done; } size = sizeof(temp_p_info) + temp_p_info.param_size; p_info = kzalloc(size, GFP_KERNEL); Loading dsp/msm_audio_ion.c +0 −5 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* <<<<<<< HEAD (df9a24 dsp: q6lsm: Add check for payload buffer) * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. ======= * Copyright (c) 2013-2019, 2020, The Linux Foundation. All rights reserved. * * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved. >>>>>>> CHANGE (b0c91b dsp: add lock in ion free to avoid use after free) */ #include <linux/init.h> Loading dsp/q6afe.c +14 −0 Original line number Diff line number Diff line Loading @@ -9611,6 +9611,7 @@ static int afe_spv4_get_calib_data( struct param_hdr_v3 param_hdr; int port = SLIMBUS_4_TX; int ret = -EINVAL; uint32_t th_vi_ca_state; if (!calib_resp) { pr_err("%s: Invalid params\n", __func__); Loading @@ -9632,6 +9633,12 @@ static int afe_spv4_get_calib_data( __func__, port, param_hdr.param_id, ret); goto get_params_fail; } th_vi_ca_state = this_afe.spv4_calib_data.res_cfg.th_vi_ca_state; if (th_vi_ca_state < FBSP_INCORRECT_OP_MODE || th_vi_ca_state > MAX_FBSP_STATE) { pr_err("%s: invalid fbsp state %d\n", __func__, th_vi_ca_state); goto get_params_fail; } memcpy(&calib_resp->res_cfg, &this_afe.spv4_calib_data.res_cfg, sizeof(this_afe.calib_data.res_cfg)); pr_info("%s: state %s resistance %d %d\n", __func__, Loading @@ -9650,6 +9657,7 @@ int afe_spk_prot_get_calib_data(struct afe_spkr_prot_get_vi_calib *calib_resp) struct param_hdr_v3 param_hdr; int port = SLIMBUS_4_TX; int ret = -EINVAL; uint32_t th_vi_ca_state; if (!calib_resp) { pr_err("%s: Invalid params\n", __func__); Loading @@ -9671,6 +9679,12 @@ int afe_spk_prot_get_calib_data(struct afe_spkr_prot_get_vi_calib *calib_resp) __func__, port, param_hdr.param_id, ret); goto get_params_fail; } th_vi_ca_state = this_afe.calib_data.res_cfg.th_vi_ca_state; if (th_vi_ca_state < FBSP_INCORRECT_OP_MODE || th_vi_ca_state > MAX_FBSP_STATE) { pr_err("%s: invalid fbsp state %d\n", __func__, th_vi_ca_state); goto get_params_fail; } memcpy(&calib_resp->res_cfg, &this_afe.calib_data.res_cfg, sizeof(this_afe.calib_data.res_cfg)); pr_info("%s: state %s resistance %d %d\n", __func__, Loading dsp/q6asm.c +10 −1 Original line number Diff line number Diff line Loading @@ -2405,7 +2405,16 @@ static int32_t q6asm_callback(struct apr_client_data *data, void *priv) __func__, data->payload_size); break; case ASM_SESSION_CMDRSP_GET_MTMX_STRTR_PARAMS_V2: q6asm_process_mtmx_get_param_rsp(ac, (void *) payload); payload_size = sizeof(struct asm_mtmx_strtr_get_params_cmdrsp); if (data->payload_size < payload_size) { pr_err("%s: insufficient payload size = %d\n", __func__, data->payload_size); spin_unlock_irqrestore( &(session[session_id].session_lock), flags); return -EINVAL; } q6asm_process_mtmx_get_param_rsp(ac, (struct asm_mtmx_strtr_get_params_cmdrsp *) payload); break; case ASM_STREAM_PP_EVENT: case ASM_STREAM_CMD_ENCDEC_EVENTS: Loading Loading
asoc/msm-audio-effects-q6-v2.c +9 −0 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/slab.h> Loading Loading @@ -1002,6 +1003,14 @@ int msm_audio_effects_pbe_handler(struct audio_client *ac, pbe->config.reserved = GET_NEXT(values, param_max_offset, rc); if ((pbe->config.bandpass_filter_order > 3) || (pbe->config.bandpass_filter_order < 1)) { pr_err("%s: Invalid BPF order\n", __func__); rc = -EINVAL; goto invalid_config; } p_coeffs = &pbe->config.p1LowPassCoeffs[0]; lpf_len = (pbe->config.xover_filter_order == 3) ? 10 : 5; hpf_len = (pbe->config.xover_filter_order == 3) ? 10 : 5; Loading
asoc/msm-lsm-client.c +10 −0 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/init.h> #include <linux/err.h> Loading Loading @@ -2430,6 +2431,15 @@ static int msm_lsm_ioctl(struct snd_pcm_substream *substream, err = -EFAULT; goto done; } if (temp_p_info.param_size > 0 && ((INT_MAX - sizeof(temp_p_info)) < temp_p_info.param_size)) { pr_err("%s: Integer overflow\n", __func__); err = -EINVAL; goto done; } size = sizeof(temp_p_info) + temp_p_info.param_size; p_info = kzalloc(size, GFP_KERNEL); Loading
dsp/msm_audio_ion.c +0 −5 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* <<<<<<< HEAD (df9a24 dsp: q6lsm: Add check for payload buffer) * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. ======= * Copyright (c) 2013-2019, 2020, The Linux Foundation. All rights reserved. * * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved. >>>>>>> CHANGE (b0c91b dsp: add lock in ion free to avoid use after free) */ #include <linux/init.h> Loading
dsp/q6afe.c +14 −0 Original line number Diff line number Diff line Loading @@ -9611,6 +9611,7 @@ static int afe_spv4_get_calib_data( struct param_hdr_v3 param_hdr; int port = SLIMBUS_4_TX; int ret = -EINVAL; uint32_t th_vi_ca_state; if (!calib_resp) { pr_err("%s: Invalid params\n", __func__); Loading @@ -9632,6 +9633,12 @@ static int afe_spv4_get_calib_data( __func__, port, param_hdr.param_id, ret); goto get_params_fail; } th_vi_ca_state = this_afe.spv4_calib_data.res_cfg.th_vi_ca_state; if (th_vi_ca_state < FBSP_INCORRECT_OP_MODE || th_vi_ca_state > MAX_FBSP_STATE) { pr_err("%s: invalid fbsp state %d\n", __func__, th_vi_ca_state); goto get_params_fail; } memcpy(&calib_resp->res_cfg, &this_afe.spv4_calib_data.res_cfg, sizeof(this_afe.calib_data.res_cfg)); pr_info("%s: state %s resistance %d %d\n", __func__, Loading @@ -9650,6 +9657,7 @@ int afe_spk_prot_get_calib_data(struct afe_spkr_prot_get_vi_calib *calib_resp) struct param_hdr_v3 param_hdr; int port = SLIMBUS_4_TX; int ret = -EINVAL; uint32_t th_vi_ca_state; if (!calib_resp) { pr_err("%s: Invalid params\n", __func__); Loading @@ -9671,6 +9679,12 @@ int afe_spk_prot_get_calib_data(struct afe_spkr_prot_get_vi_calib *calib_resp) __func__, port, param_hdr.param_id, ret); goto get_params_fail; } th_vi_ca_state = this_afe.calib_data.res_cfg.th_vi_ca_state; if (th_vi_ca_state < FBSP_INCORRECT_OP_MODE || th_vi_ca_state > MAX_FBSP_STATE) { pr_err("%s: invalid fbsp state %d\n", __func__, th_vi_ca_state); goto get_params_fail; } memcpy(&calib_resp->res_cfg, &this_afe.calib_data.res_cfg, sizeof(this_afe.calib_data.res_cfg)); pr_info("%s: state %s resistance %d %d\n", __func__, Loading
dsp/q6asm.c +10 −1 Original line number Diff line number Diff line Loading @@ -2405,7 +2405,16 @@ static int32_t q6asm_callback(struct apr_client_data *data, void *priv) __func__, data->payload_size); break; case ASM_SESSION_CMDRSP_GET_MTMX_STRTR_PARAMS_V2: q6asm_process_mtmx_get_param_rsp(ac, (void *) payload); payload_size = sizeof(struct asm_mtmx_strtr_get_params_cmdrsp); if (data->payload_size < payload_size) { pr_err("%s: insufficient payload size = %d\n", __func__, data->payload_size); spin_unlock_irqrestore( &(session[session_id].session_lock), flags); return -EINVAL; } q6asm_process_mtmx_get_param_rsp(ac, (struct asm_mtmx_strtr_get_params_cmdrsp *) payload); break; case ASM_STREAM_PP_EVENT: case ASM_STREAM_CMD_ENCDEC_EVENTS: Loading