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

Commit 2e5d74bc authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "net: ipc_router: fix leak of kernel memory to userspace"

parents 39c0df96 4ad825ba
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -496,13 +496,18 @@ static int msm_ipc_router_ioctl(struct socket *sock,

		ret = copy_to_user((void *)arg, &server_arg,
				   sizeof(server_arg));
		if (srv_info_sz) {

		n = min(server_arg.num_entries_found,
			server_arg.num_entries_in_array);

		if (ret == 0 && n) {
			ret = copy_to_user((void *)(arg + sizeof(server_arg)),
					   srv_info, srv_info_sz);
					   srv_info, n * sizeof(*srv_info));
		}

		if (ret)
			ret = -EFAULT;
		kfree(srv_info);
		}
		break;

	case IPC_ROUTER_IOCTL_BIND_CONTROL_PORT: