Merge tag 'LA.UM.9.15.2.r1-11100-KAMORTA.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel into android13-4.19-kona
"LA.UM.9.15.2.r1-11100-KAMORTA.QSSI14.0" * tag 'LA.UM.9.15.2.r1-11100-KAMORTA.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel: asoc: codec: avoid out of bound write to map array asoc: codec: avoid out of bound write to map array dsp: q6voice: Changing data type from %d to %ld dsp: q6voice: Add buf size check for cvp cal data Conflicts: techpack/audio/asoc/codecs/wcd938x/wcd938x.c Change-Id: I7d1385928f2945ca39e10a6d5a8b7cc497ea9d26
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -223,6 +224,10 @@ static int rouleur_parse_port_mapping(struct device *dev,
|
||||
|
||||
for (i = 0; i < map_length; i++) {
|
||||
port_num = dt_array[NUM_SWRS_DT_PARAMS * i];
|
||||
if (port_num >= MAX_PORT || ch_iter >= MAX_CH_PER_PORT) {
|
||||
dev_err(dev, "%s: Invalid port or channel number\n", __func__);
|
||||
goto err_pdata_fail;
|
||||
}
|
||||
slave_port_type = dt_array[NUM_SWRS_DT_PARAMS * i + 1];
|
||||
ch_mask = dt_array[NUM_SWRS_DT_PARAMS * i + 2];
|
||||
ch_rate = dt_array[NUM_SWRS_DT_PARAMS * i + 3];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2023,2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -279,6 +279,10 @@ static int wcd937x_parse_port_mapping(struct device *dev,
|
||||
|
||||
for (i = 0; i < map_length; i++) {
|
||||
port_num = dt_array[NUM_SWRS_DT_PARAMS * i];
|
||||
if (port_num >= MAX_PORT || ch_iter >= MAX_CH_PER_PORT) {
|
||||
dev_err(dev, "%s: Invalid port or channel number\n", __func__);
|
||||
goto err_pdata_fail;
|
||||
}
|
||||
slave_port_type = dt_array[NUM_SWRS_DT_PARAMS * i + 1];
|
||||
ch_mask = dt_array[NUM_SWRS_DT_PARAMS * i + 2];
|
||||
ch_rate = dt_array[NUM_SWRS_DT_PARAMS * i + 3];
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -377,6 +378,12 @@ static int wcd938x_parse_port_mapping(struct device *dev,
|
||||
|
||||
for (i = 0; i < map_length; i++) {
|
||||
port_num = dt_array[NUM_SWRS_DT_PARAMS * i];
|
||||
|
||||
if (port_num >= MAX_PORT || ch_iter >= MAX_CH_PER_PORT) {
|
||||
dev_err(dev, "%s: Invalid port or channel number\n", __func__);
|
||||
goto err_pdata_fail;
|
||||
}
|
||||
|
||||
slave_port_type = dt_array[NUM_SWRS_DT_PARAMS * i + 1];
|
||||
ch_mask = dt_array[NUM_SWRS_DT_PARAMS * i + 2];
|
||||
ch_rate = dt_array[NUM_SWRS_DT_PARAMS * i + 3];
|
||||
|
||||
@@ -3221,6 +3221,13 @@ static int voice_send_cvp_register_cal_cmd(struct voice_data *v)
|
||||
voc_get_session_name(v->session_id), v->dev_tx.dev_id,
|
||||
v->dev_rx.dev_id);
|
||||
|
||||
if (col_data->cal_data.size >= MAX_COL_INFO_SIZE) {
|
||||
pr_err("%s: Invalid cal data size %ld!\n",
|
||||
__func__, col_data->cal_data.size);
|
||||
ret = -EINVAL;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
memcpy(&cvp_reg_cal_cmd.cvp_cal_data.column_info[0],
|
||||
(void *) &((struct audio_cal_info_voc_col *)
|
||||
col_data->cal_info)->data,
|
||||
@@ -3381,6 +3388,13 @@ static int voice_send_cvp_register_vol_cal_cmd(struct voice_data *v)
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (col_data->cal_data.size >= MAX_COL_INFO_SIZE) {
|
||||
pr_err("%s: Invalid cal data size %ld!\n",
|
||||
__func__, col_data->cal_data.size);
|
||||
ret = -EINVAL;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
memcpy(&cvp_reg_vol_cal_cmd.cvp_vol_cal_data.column_info[0],
|
||||
(void *) &((struct audio_cal_info_voc_col *)
|
||||
col_data->cal_info)->data,
|
||||
|
||||
Reference in New Issue
Block a user