aboutsummaryrefslogtreecommitdiffstats
path: root/security/device_cgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/device_cgroup.c')
-rw-r--r--security/device_cgroup.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/security/device_cgroup.c b/security/device_cgroup.c
index baf348834b66..ddd92cec78ed 100644
--- a/security/device_cgroup.c
+++ b/security/device_cgroup.c
@@ -222,7 +222,7 @@ static void devcgroup_destroy(struct cgroup_subsys *ss,
222#define DEVCG_DENY 2 222#define DEVCG_DENY 2
223#define DEVCG_LIST 3 223#define DEVCG_LIST 3
224 224
225#define MAJMINLEN 10 225#define MAJMINLEN 13
226#define ACCLEN 4 226#define ACCLEN 4
227 227
228static void set_access(char *acc, short access) 228static void set_access(char *acc, short access)
@@ -254,7 +254,7 @@ static void set_majmin(char *str, unsigned m)
254 if (m == ~0) 254 if (m == ~0)
255 sprintf(str, "*"); 255 sprintf(str, "*");
256 else 256 else
257 snprintf(str, MAJMINLEN, "%d", m); 257 snprintf(str, MAJMINLEN, "%u", m);
258} 258}
259 259
260static int devcgroup_seq_read(struct cgroup *cgroup, struct cftype *cft, 260static int devcgroup_seq_read(struct cgroup *cgroup, struct cftype *cft,
@@ -300,7 +300,7 @@ static int may_access_whitelist(struct dev_cgroup *c,
300 continue; 300 continue;
301 if (whitem->minor != ~0 && whitem->minor != refwh->minor) 301 if (whitem->minor != ~0 && whitem->minor != refwh->minor)
302 continue; 302 continue;
303 if (refwh->access & (~(whitem->access | ACC_MASK))) 303 if (refwh->access & (~whitem->access))
304 continue; 304 continue;
305 return 1; 305 return 1;
306 } 306 }
@@ -382,6 +382,8 @@ static ssize_t devcgroup_access_write(struct cgroup *cgroup, struct cftype *cft,
382 case 'a': 382 case 'a':
383 wh.type = DEV_ALL; 383 wh.type = DEV_ALL;
384 wh.access = ACC_MASK; 384 wh.access = ACC_MASK;
385 wh.major = ~0;
386 wh.minor = ~0;
385 goto handle; 387 goto handle;
386 case 'b': 388 case 'b':
387 wh.type = DEV_BLOCK; 389 wh.type = DEV_BLOCK;