Commit 37801a3
selinux: avoid dereference of garbage after mount failure
In case kern_mount() fails and returns an error pointer return in the
error branch instead of continuing and dereferencing the error pointer.
While on it drop the never read static variable selinuxfs_mount.
Cc: stable@vger.kernel.org
Fixes: 0619f0f ("selinux: wrap selinuxfs state")
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>1 parent 4cece76 commit 37801a3
1 file changed
+7
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2123 | 2123 | | |
2124 | 2124 | | |
2125 | 2125 | | |
2126 | | - | |
2127 | 2126 | | |
2128 | 2127 | | |
2129 | 2128 | | |
| |||
2145 | 2144 | | |
2146 | 2145 | | |
2147 | 2146 | | |
2148 | | - | |
2149 | | - | |
| 2147 | + | |
| 2148 | + | |
2150 | 2149 | | |
2151 | | - | |
2152 | | - | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
2153 | 2153 | | |
| 2154 | + | |
2154 | 2155 | | |
2155 | 2156 | | |
2156 | 2157 | | |
2157 | 2158 | | |
2158 | 2159 | | |
2159 | 2160 | | |
| 2161 | + | |
2160 | 2162 | | |
2161 | 2163 | | |
2162 | 2164 | | |
| |||
0 commit comments