dst/connector: Disallow unpliviged users to configure dst

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Philipp Reisner 2009-10-02 02:40:09 +00:00 committed by David S. Miller
parent 24836479a1
commit 5788c56891

View file

@ -855,6 +855,11 @@ static void cn_dst_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp)
struct dst_node *n = NULL, *tmp;
unsigned int hash;
if (!cap_raised(nsp->eff_cap, CAP_SYS_ADMIN)) {
err = -EPERM;
goto out;
}
if (msg->len < sizeof(struct dst_ctl)) {
err = -EBADMSG;
goto out;