aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index e9969a2fc846..28ee187ed224 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1754,7 +1754,8 @@ static inline void flush_unauthorized_files(struct files_struct * files)
1754 get_file(devnull); 1754 get_file(devnull);
1755 } else { 1755 } else {
1756 devnull = dentry_open(dget(selinux_null), mntget(selinuxfs_mount), O_RDWR); 1756 devnull = dentry_open(dget(selinux_null), mntget(selinuxfs_mount), O_RDWR);
1757 if (!devnull) { 1757 if (IS_ERR(devnull)) {
1758 devnull = NULL;
1758 put_unused_fd(fd); 1759 put_unused_fd(fd);
1759 fput(file); 1760 fput(file);
1760 continue; 1761 continue;
@@ -3313,7 +3314,13 @@ static int selinux_socket_getpeername(struct socket *sock)
3313 3314
3314static int selinux_socket_setsockopt(struct socket *sock,int level,int optname) 3315static int selinux_socket_setsockopt(struct socket *sock,int level,int optname)
3315{ 3316{
3316 return socket_has_perm(current, sock, SOCKET__SETOPT); 3317 int err;
3318
3319 err = socket_has_perm(current, sock, SOCKET__SETOPT);
3320 if (err)
3321 return err;
3322
3323 return selinux_netlbl_socket_setsockopt(sock, level, optname);
3317} 3324}
3318 3325
3319static int selinux_socket_getsockopt(struct socket *sock, int level, 3326static int selinux_socket_getsockopt(struct socket *sock, int level,