projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
selinux: fix off-by-one in setprocattr
[firefly-linux-kernel-4.4.55.git]
/
security
/
selinux
/
hooks.c
diff --git
a/security/selinux/hooks.c
b/security/selinux/hooks.c
index d0cfaa9f19d08034a3c3600d8381ed166a369388..4b56c3b6c25ffbc446a94fed875f55a2cd5d6b87 100644
(file)
--- a/
security/selinux/hooks.c
+++ b/
security/selinux/hooks.c
@@
-5640,7
+5640,7
@@
static int selinux_setprocattr(struct task_struct *p,
return error;
/* Obtain a SID for the context, if one was specified. */
- if (size && str[
1] && str[1
] != '\n') {
+ if (size && str[
0] && str[0
] != '\n') {
if (str[size-1] == '\n') {
str[size-1] = 0;
size--;