msm: ipc: Security updates to IPC Router

With the fine-grained access control in place for QMI clients, default
security check in socket create operation is redundant. Update the
IPC Router to perform the default security check only for the
bind operation, which is used during QMI service registration.

Change-Id: I967dbc3d414d39d307c071ff49c319828b5ed19e
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
This commit is contained in:
Karthikeyan Ramasubramanian 2013-01-24 11:45:41 -07:00 committed by Stephen Boyd
parent 751bbb9017
commit 3ce6f6f3b5
1 changed files with 6 additions and 6 deletions

View File

@ -174,12 +174,6 @@ static int msm_ipc_router_create(struct net *net,
struct msm_ipc_port *port_ptr;
void *pil;
if (!check_permissions()) {
pr_err("%s: %s Do not have permissions\n",
__func__, current->comm);
return -EPERM;
}
if (unlikely(protocol != 0)) {
pr_err("%s: Protocol not supported\n", __func__);
return -EPROTONOSUPPORT;
@ -229,6 +223,12 @@ int msm_ipc_router_bind(struct socket *sock, struct sockaddr *uaddr,
if (!sk)
return -EINVAL;
if (!check_permissions()) {
pr_err("%s: %s Do not have permissions\n",
__func__, current->comm);
return -EPERM;
}
if (!uaddr_len) {
pr_err("%s: Invalid address length\n", __func__);
return -EINVAL;