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

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

Merge "soc: qcom: hab: add the buffer size sanity check for exporting a buffer"

parents d1a6be9a 44ab3c21
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
 */
#include "hab.h"
#include "hab_grantable.h"
@@ -241,7 +241,8 @@ int hab_mem_export(struct uhab_context *ctx,
	int page_count;
	int compressed = 0;

	if (!ctx || !param || !param->buffer)
	if (!ctx || !param || !param->buffer || !param->sizebytes
		|| ((param->sizebytes % PAGE_SIZE) != 0))
		return -EINVAL;

	vchan = hab_get_vchan_fromvcid(param->vcid, ctx, 0);