mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
proc connector: reject unprivileged listener bumps
commit e70ab97799
upstream.
While PROC_CN_MCAST_LISTEN/IGNORE is entirely advisory, it was possible
for an unprivileged user to turn off notifications for all listeners by
sending PROC_CN_MCAST_IGNORE. Instead, require the same privileges as
required for a multicast bind.
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Matt Helsley <matthltc@us.ibm.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Acked-by: Matt Helsley <matthltc@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Qiang Huang <h.huangqiang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f7741e3b3f
commit
2f590c4701
1 changed files with 8 additions and 0 deletions
|
@ -331,6 +331,12 @@ static void cn_proc_mcast_ctl(struct cn_msg *msg,
|
||||||
if (msg->len != sizeof(*mc_op))
|
if (msg->len != sizeof(*mc_op))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* Can only change if privileged. */
|
||||||
|
if (!capable(CAP_NET_ADMIN)) {
|
||||||
|
err = EPERM;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
mc_op = (enum proc_cn_mcast_op*)msg->data;
|
mc_op = (enum proc_cn_mcast_op*)msg->data;
|
||||||
switch (*mc_op) {
|
switch (*mc_op) {
|
||||||
case PROC_CN_MCAST_LISTEN:
|
case PROC_CN_MCAST_LISTEN:
|
||||||
|
@ -343,6 +349,8 @@ static void cn_proc_mcast_ctl(struct cn_msg *msg,
|
||||||
err = EINVAL;
|
err = EINVAL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
cn_proc_ack(err, msg->seq, msg->ack);
|
cn_proc_ack(err, msg->seq, msg->ack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue