projects/linux·commit d3498fba

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security

d3498fba · Linus Torvalds <[email protected]> · 2017-02-08 09:59:45 -08:00

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
Commit
d3498fbaf386f9d540cdde7211ebb2d502b2b365
Parents
23fbe2cd · 0c461cb7

Merge commit. Changes below are compared with the first parent: 23fbe2cd.

Changes

1 files changed · +1 −1

FileStatusAddDelContent
security/selinux/hooks.cmodified+1−1View file

security/selinux/hooks.c

View file
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index c7c6619..d98550a 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--;