Commit 355b8ad
selinux: avoid dereference of garbage after mount failure
commit 37801a3 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CVE-2024-35904
(cherry picked from commit 477ed6789eb9f3f4d3568bb977f90c863c12724e linux-6.6.y)
Signed-off-by: Massimiliano Pellizzer <massimiliano.pellizzer@canonical.com>
Acked-by: Manuel Diewald <manuel.diewald@canonical.com>
Acked-by: Guoqing Jiang <guoqing.jiang@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>1 parent 803f6c4 commit 355b8ad
1 file changed
+7
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2208 | 2208 | | |
2209 | 2209 | | |
2210 | 2210 | | |
2211 | | - | |
2212 | 2211 | | |
2213 | 2212 | | |
2214 | 2213 | | |
| |||
2230 | 2229 | | |
2231 | 2230 | | |
2232 | 2231 | | |
2233 | | - | |
2234 | | - | |
| 2232 | + | |
| 2233 | + | |
2235 | 2234 | | |
2236 | | - | |
2237 | | - | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
2238 | 2238 | | |
| 2239 | + | |
2239 | 2240 | | |
2240 | 2241 | | |
2241 | 2242 | | |
2242 | 2243 | | |
2243 | 2244 | | |
2244 | 2245 | | |
| 2246 | + | |
2245 | 2247 | | |
2246 | 2248 | | |
2247 | 2249 | | |
| |||
0 commit comments