From: Philipp Reisner Date: Fri, 2 Oct 2009 02:40:09 +0000 (+0000) Subject: dst/connector: Disallow unpliviged users to configure dst X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5788c56891cfb310e419c4f9ae20427851797431;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git dst/connector: Disallow unpliviged users to configure dst Signed-off-by: Philipp Reisner Signed-off-by: David S. Miller --- diff --git a/drivers/staging/dst/dcore.c b/drivers/staging/dst/dcore.c index 3943c91e6c96..ee1601026fb0 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;