diff options
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r-- | security/selinux/hooks.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 24ab4148547c..61a53367d029 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -2132,18 +2132,14 @@ static inline void flush_unauthorized_files(const struct cred *cred, | |||
2132 | return; | 2132 | return; |
2133 | 2133 | ||
2134 | devnull = dentry_open(&selinux_null, O_RDWR, cred); | 2134 | devnull = dentry_open(&selinux_null, O_RDWR, cred); |
2135 | if (!IS_ERR(devnull)) { | 2135 | if (IS_ERR(devnull)) |
2136 | /* replace all the matching ones with this */ | 2136 | devnull = NULL; |
2137 | do { | 2137 | /* replace all the matching ones with this */ |
2138 | replace_fd(n - 1, get_file(devnull), 0); | 2138 | do { |
2139 | } while ((n = iterate_fd(files, n, match_file, cred)) != 0); | 2139 | replace_fd(n - 1, devnull, 0); |
2140 | } while ((n = iterate_fd(files, n, match_file, cred)) != 0); | ||
2141 | if (devnull) | ||
2140 | fput(devnull); | 2142 | fput(devnull); |
2141 | } else { | ||
2142 | /* just close all the matching ones */ | ||
2143 | do { | ||
2144 | replace_fd(n - 1, NULL, 0); | ||
2145 | } while ((n = iterate_fd(files, n, match_file, cred)) != 0); | ||
2146 | } | ||
2147 | } | 2143 | } |
2148 | 2144 | ||
2149 | /* | 2145 | /* |