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

Commit d8a1e717 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 7e1fc497 41599f4d
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2013-2020, 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/fs.h>
#include <linux/mutex.h>
@@ -2036,6 +2036,12 @@ static int q6lsm_mmapcallback(struct apr_client_data *data, void *priv)
		return 0;
	}

	if (data->payload_size < (2 * sizeof(uint32_t))) {
		pr_err("%s: payload has invalid size[%d]\n", __func__,
			data->payload_size);
		return -EINVAL;
	}

	command = payload[0];
	retcode = payload[1];
	sid = (data->token >> 8) & 0x0F;