Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 562179ef authored by Michael Bestas's avatar Michael Bestas
Browse files

Merge tag 'LA.UM.9.12.r1-17400-SMxx50.QSSI13.0' of...

Merge tag 'LA.UM.9.12.r1-17400-SMxx50.QSSI13.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel into android13-4.19-kona

"LA.UM.9.12.r1-17400-SMxx50.QSSI13.0"

* tag 'LA.UM.9.12.r1-17400-SMxx50.QSSI13.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel:
  dsp: q6asm: Add check for ADSP payload size
  ASoC: msm-audio-effects-q6-v2: Add BPF order check
  dsp: q6afe: Add check for fbsp state
  ASoC: msm-lsm-client: Integer overflow check
  dsp: Correct copyright info

 Conflicts:
	techpack/audio/dsp/msm_audio_ion.c

Change-Id: If36269f6078703b3da8486049b07b993d190ccc3
parents 44dd4522 53af5447
Loading
Loading
Loading
Loading
+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>
@@ -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;
+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>
@@ -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);

+0 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2013-2019, 2020, The Linux Foundation. All rights reserved.
 *
 * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
 */

+14 −0
Original line number Diff line number Diff line
@@ -9974,6 +9974,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__);
@@ -9995,6 +9996,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__,
@@ -10013,6 +10020,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__);
@@ -10034,6 +10042,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__,
+10 −1
Original line number Diff line number Diff line
@@ -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: