Browse Source

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

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6:
  selinux: handle files opened with flags 3 by checking ioctl permission
Linus Torvalds 17 years ago
parent
commit
d40c2f29f3
1 changed files with 6 additions and 0 deletions
  1. 6 0
      security/selinux/hooks.c

+ 6 - 0
security/selinux/hooks.c

@@ -1630,6 +1630,12 @@ static inline u32 file_to_av(struct file *file)
 		else
 			av |= FILE__WRITE;
 	}
+	if (!av) {
+		/*
+		 * Special file opened with flags 3 for ioctl-only use.
+		 */
+		av = FILE__IOCTL;
+	}
 
 	return av;
 }