diff mbox

[6/8] dst/connector: Disallow unpliviged users to configure dst

Message ID 1254487211-11810-7-git-send-email-philipp.reisner@linbit.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Philipp Reisner Oct. 2, 2009, 12:40 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/staging/dst/dcore.c b/drivers/staging/dst/dcore.c
index 3943c91..ee16010 100644
--- a/drivers/staging/dst/dcore.c
+++ b/drivers/staging/dst/dcore.c
@@ -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;