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

Commit 16b07e4c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dsp: q6usm: Check size of payload before access"

parents 36582f1e 72347428
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -498,6 +498,11 @@ static int32_t q6usm_mmapcallback(struct apr_client_data *data, void *priv)
	uint32_t token;
	uint32_t *payload = data->payload;

	if (data->payload_size < (2 * sizeof(uint32_t))) {
		pr_err("%s: payload has invalid size[%d]\n", __func__,
		       data->payload_size);
		return -EINVAL;
	}
	pr_debug("%s: ptr0[0x%x]; ptr1[0x%x]; opcode[0x%x]\n",
		 __func__, payload[0], payload[1], data->opcode);
	pr_debug("%s: token[0x%x]; payload_size[%d]; src[%d]; dest[%d];\n",