From 32c229060ca33b816c50eedc136ea2800f9974df Mon Sep 17 00:00:00 2001 From: Karthikeyan Ramasubramanian Date: Thu, 15 Dec 2016 08:13:20 -0700 Subject: net: ipc_router: Register services only on client port Allowing services to be registered on a non-client port will cause either an existing service or a control port to be over-written. This will cause undefined functional behavior. Allow the services to be registered only on client ports. CRs-Fixed: 1101792 Change-Id: If6cfc75e9314204b7b44957f1598a8a2e1a45325 Signed-off-by: Karthikeyan Ramasubramanian --- net/ipc_router/ipc_router_core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ipc_router/ipc_router_core.c b/net/ipc_router/ipc_router_core.c index 008d034f..d23799a 100644 --- a/net/ipc_router/ipc_router_core.c +++ b/net/ipc_router/ipc_router_core.c @@ -2809,6 +2809,9 @@ int msm_ipc_router_register_server(struct msm_ipc_port *port_ptr, if (!port_ptr || !name) return -EINVAL; + if (port_ptr->type != CLIENT_PORT) + return -EINVAL; + if (name->addrtype != MSM_IPC_ADDR_NAME) return -EINVAL; -- cgit v1.1