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:
parent
751bbb9017
commit
3ce6f6f3b5
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue