Skip to content

Commit 17d213f

Browse files
Li Zefantorvalds
authored andcommitted
devcgroup: always show positive major/minor num
# echo "b $((0x7fffffff)):$((0x80000000)) rwm" > devices.allow # cat devices.list b 214748364:-21474836 rwm though a major/minor number of 0x800000000 is meaningless, we should not cast it to a negative value. Signed-off-by: Li Zefan <[email protected]> Acked-by: Serge Hallyn <[email protected]> Cc: Serge Hallyn <[email protected]> Cc: Paul Menage <[email protected]> Cc: Pavel Emelyanov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 0302c01 commit 17d213f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

security/device_cgroup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static void devcgroup_destroy(struct cgroup_subsys *ss,
222222
#define DEVCG_DENY 2
223223
#define DEVCG_LIST 3
224224

225-
#define MAJMINLEN 10
225+
#define MAJMINLEN 13
226226
#define ACCLEN 4
227227

228228
static void set_access(char *acc, short access)
@@ -254,7 +254,7 @@ static void set_majmin(char *str, unsigned m)
254254
if (m == ~0)
255255
sprintf(str, "*");
256256
else
257-
snprintf(str, MAJMINLEN, "%d", m);
257+
snprintf(str, MAJMINLEN, "%u", m);
258258
}
259259

260260
static int devcgroup_seq_read(struct cgroup *cgroup, struct cftype *cft,

0 commit comments

Comments
 (0)