[32/46] dst/connector: Disallow unpliviged users to configure dst

From: Greg KH
Date: Fri Oct 16 2009 - 13:20:13 EST


2.6.31-stable review patch. If anyone has any objections, please let us know.

------------------
From: Philipp Reisner <philipp.reisner@xxxxxxxxxx>

(cherry picked from commit dbbb3431228784612848a1ec6061c78b4b708b5c)

Signed-off-by: Philipp Reisner <philipp.reisner@xxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
drivers/staging/dst/dcore.c | 5 +++++
1 file changed, 5 insertions(+)

--- a/drivers/staging/dst/dcore.c
+++ b/drivers/staging/dst/dcore.c
@@ -854,6 +854,11 @@ static void cn_dst_callback(struct cn_ms
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;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/