CVE-2024-35904: selinux: avoid dereference of garbage after mount failure

Description

In the Linux kernel, the following vulnerability has been resolved:

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.

Classification

CVE ID: CVE-2024-35904

Affected Products

Vendor: Linux

Product: Linux

Exploit Prediction Scoring System (EPSS)

EPSS Score: 0.04% (probability of being exploited)

EPSS Percentile: 5.08% (scored less or equal to compared to others)

EPSS Date: 2025-02-04 (when was this score calculated)

References

https://git.kernel.org/stable/c/477ed6789eb9f3f4d3568bb977f90c863c12724e
https://git.kernel.org/stable/c/68784a5d01b8868ff85a7926676b6729715fff3c
https://git.kernel.org/stable/c/37801a36b4d68892ce807264f784d818f8d0d39b

Timeline