Merge tag 'LA.UM.9.14.r1-24900-LAHAINA.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel into android13-5.4-lahaina

"LA.UM.9.14.r1-24900-LAHAINA.QSSI14.0"

* tag 'LA.UM.9.14.r1-24900-LAHAINA.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel:
  dsp: q6lsm: Check size of payload before access

Change-Id: I782131a810aaecf254b92d94e2db252c3741784e
This commit is contained in:
Michael Bestas 2024-08-05 22:14:56 +03:00
commit 7262b988ea
No known key found for this signature in database
GPG key ID: CC95044519BE6669

View file

@ -2129,8 +2129,18 @@ static int q6lsm_mmapcallback(struct apr_client_data *data, void *priv)
lsm_common.set_custom_topology = 1;
return 0;
}
/*
The payload_size can be either 4 or 8 bytes.
It has to be verified whether the payload_size is
atleast 4 bytes. If it is less, returns errorcode.
if (data->payload_size < (2 * sizeof(uint32_t))) {
The opcode for 4 bytes is 0x12A80
The opcode for 8 bytes is 0x110E8.
*/
if (data->payload_size < (2 * sizeof(uint16_t))) {
pr_err("%s: payload has invalid size[%d]\n", __func__,
data->payload_size);
return -EINVAL;