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

Commit 34606355 authored by Siena Richard's avatar Siena Richard
Browse files

ASoC: msm: qdsp6v2: extend validation of virtual address



Validate a buffer virtual address is fully within the region before
returning the region to ensure functionality for an extended edge
case.

Change-Id: Iba3e080889980f393d6a9f0afe0231408b92d654
Signed-off-by: default avatarSiena Richard <sienar@codeaurora.org>
CRs-fixed: 1108461
parent 2f817b68
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
/* Copyright (C) 2008 Google, Inc.
 * Copyright (C) 2008 HTC Corporation
 * Copyright (c) 2009-2016, The Linux Foundation. All rights reserved.
 * Copyright (c) 2009-2017, The Linux Foundation. All rights reserved.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
@@ -119,7 +119,10 @@ static int audio_aio_ion_lookup_vaddr(struct q6audio_aio *audio, void *addr,
	list_for_each_entry(region_elt, &audio->ion_region_queue, list) {
		if (addr >= region_elt->vaddr &&
			addr < region_elt->vaddr + region_elt->len &&
			addr + len <= region_elt->vaddr + region_elt->len) {
			addr + len <= region_elt->vaddr + region_elt->len &&
			addr + len > addr) {
			/* to avoid integer addition overflow */

			/* offset since we could pass vaddr inside a registerd
			* ion buffer
			*/