aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-02-08 09:59:45 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-08 09:59:45 -0800
commitd3498fbaf386f9d540cdde7211ebb2d502b2b365 (patch)
treedf7cf98c566236986b6cc6f3ca4b95ee14e858a6
parent23fbe2cdc1de80120cf9ccd478ac57c3a3a0764b (diff)
parent0c461cb727d146c9ef2d3e86214f498b78b7d125 (diff)
downloadlinux-btrfs-d3498fbaf386f9d540cdde7211ebb2d502b2b365.tar.gz
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull selinux fix from James Morris: "Fix off-by-one in setprocattr" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: selinux: fix off-by-one in setprocattr
-rw-r--r--security/selinux/hooks.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index c7c6619431d5fb..d98550abe16d40 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -5887,7 +5887,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--;