aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-02 07:45:49 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-02 07:45:49 -0700
commitd40c2f29f3b0f5937bace575722598dac474c478 (patch)
treea757da81f2a5e8a145ccfbecbf624bf673f41f03
parentMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block (diff)
parentselinux: handle files opened with flags 3 by checking ioctl permission (diff)
downloadwireguard-linux-d40c2f29f3b0f5937bace575722598dac474c478.tar.xz
wireguard-linux-d40c2f29f3b0f5937bace575722598dac474c478.zip
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
-rw-r--r--security/selinux/hooks.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 41a049f50f58..c2fef7b12dc7 100644
--- a/security/selinux/hooks.c
+++ b/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;
}