From: Philipp Reisner Date: Tue, 13 Oct 2009 09:28:16 +0000 (+0200) Subject: dst/connector: Disallow unpliviged users to configure dst X-Git-Tag: v2.6.31.5~15 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=060425ef1d42f59b9b3faed31406e9e59c7464a0;p=karo-tx-linux.git dst/connector: Disallow unpliviged users to configure dst (cherry picked from commit dbbb3431228784612848a1ec6061c78b4b708b5c) Signed-off-by: Philipp Reisner Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/dst/dcore.c b/drivers/staging/dst/dcore.c index 32f102d5c21b..5546898dbdb4 100644 --- a/drivers/staging/dst/dcore.c +++ b/drivers/staging/dst/dcore.c @@ -854,6 +854,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;