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

Commit e79ade59 authored by Abir Ghosh's avatar Abir Ghosh
Browse files

qbt_handler: Memset userspace struct to zero



Explicitly memset struct to zero before sending
to userspace. This is to prevent padded bytes
from possibly leaking kernel memory contents to
userspace.

Change-Id: Id3e873164430c34195344884b2899e61aa060dfc
Signed-off-by: default avatarAbir Ghosh <abirg@codeaurora.org>
parent 0086d774
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
 */

#define DEBUG
@@ -371,6 +371,8 @@ static long qbt_ioctl(
	{
		struct qbt_wuhb_connected_status wuhb_connected_status;

		memset(&wuhb_connected_status, 0,
				sizeof(wuhb_connected_status));
		wuhb_connected_status.is_wuhb_connected =
				drvdata->is_wuhb_connected;
		rc = copy_to_user((void __user *)priv_arg,