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

Commit 6934abf3 authored by Mohammed Nayeem Ur Rahman's avatar Mohammed Nayeem Ur Rahman
Browse files

adsprpc: Validate fds pointer before de-referencing it



Validate fds pointer before de-referencing it.

Change-Id: I31c84e99a228da0b2bde322714acd2a6e29026c6
Acked-by: default avatarMaitreyi Gupta <maitreyi@qti.qualcomm.com>
Signed-off-by: default avatarMohammed Nayeem Ur Rahman <mohara@codeaurora.org>
parent be9b32f9
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 */
#include <linux/dma-buf.h>
#include <linux/dma-mapping.h>
@@ -1871,6 +1871,7 @@ static int get_args(uint32_t kernel, struct smq_invoke_ctx *ctx)
	}
	PERF_END);
	for (i = bufs; rpra && i < bufs + handles; i++) {
		if (ctx->fds)
			rpra[i].dma.fd = ctx->fds[i];
		rpra[i].dma.len = (uint32_t)lpra[i].buf.len;
		rpra[i].dma.offset = (uint32_t)(uintptr_t)lpra[i].buf.pv;