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
This commit is contained in:
Linus Torvalds 2017-02-08 09:59:45 -08:00
commit d3498fbaf3
1 changed files with 1 additions and 1 deletions

View File

@ -5887,7 +5887,7 @@ static int selinux_setprocattr(struct task_struct *p,
return error; return error;
/* Obtain a SID for the context, if one was specified. */ /* 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') { if (str[size-1] == '\n') {
str[size-1] = 0; str[size-1] = 0;
size--; size--;