aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/connector/cn_proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/connector/cn_proc.c')
-rw-r--r--drivers/connector/cn_proc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c
index fce2000eec31..1110478dd0fd 100644
--- a/drivers/connector/cn_proc.c
+++ b/drivers/connector/cn_proc.c
@@ -313,6 +313,12 @@ static void cn_proc_mcast_ctl(struct cn_msg *msg,
313 (task_active_pid_ns(current) != &init_pid_ns)) 313 (task_active_pid_ns(current) != &init_pid_ns))
314 return; 314 return;
315 315
316 /* Can only change if privileged. */
317 if (!capable(CAP_NET_ADMIN)) {
318 err = EPERM;
319 goto out;
320 }
321
316 mc_op = (enum proc_cn_mcast_op *)msg->data; 322 mc_op = (enum proc_cn_mcast_op *)msg->data;
317 switch (*mc_op) { 323 switch (*mc_op) {
318 case PROC_CN_MCAST_LISTEN: 324 case PROC_CN_MCAST_LISTEN:
@@ -325,6 +331,8 @@ static void cn_proc_mcast_ctl(struct cn_msg *msg,
325 err = EINVAL; 331 err = EINVAL;
326 break; 332 break;
327 } 333 }
334
335out:
328 cn_proc_ack(err, msg->seq, msg->ack); 336 cn_proc_ack(err, msg->seq, msg->ack);
329} 337}
330 338