In this post, we discuss a crucial vulnerability, allocated with the identifier CVE-2024-26612, which was discovered and resolved in the Linux kernel. The vulnerability involved the "netfs" and "fscache" subsystems in the Linux kernel, and could potentially lead to system crashes, instability, and security risks. The fix is included in the mainline kernel, and it is highly recommended to update your Linux distribution to incorporate the patch.

Vulnerability

The vulnerability revolved around the "_fscache_put_cache()_" function, which is a part of the "fscache" subsystem. This function is responsible for dereferencing the "cache" pointer, but an oversight in the code allowed it to dereference the pointer even if it was in an error state or null, hence potentially crashing the system (Oops).

netfs, fscache: Prevent Oops in fscache_put_cache().

This function dereferences "cache" and then checks if it's

The following code snippet outlines the original flawed code that led to this vulnerability

void fscache_put_cache(struct fscache_cache *cache)
{
        kenter("%p{%s}", cache, cache->tag->name);
        if (IS_ERR_OR_NULL(cache))
                return;
        ...
}

Patch

To correct this issue, the order of check and dereference in the "_fscache_put_cache()_" function has been fixed. The new code snippet with the patch applied is shown below:

void fscache_put_cache(struct fscache_cache *cache)
{
        if (IS_ERR_OR_NULL(cache))
                return;
        kenter("%p{%s}", cache, cache->tag->name);
        ...
}

1. CVE-2024-26612 - National Vulnerability Database
2. Linux kernel commit with the patch
3. Linux Kernel Mailing List discussion

Exploit Details

As of now, there have been no known exploits against this vulnerability in the wild. However, considering the potential ramifications of an Oops scenario caused by the improper dereferencing, it is highly recommended to implement the patch as soon as possible.

Conclusion

In conclusion, CVE-2024-26612 is a critical vulnerability in the Linux kernel that was discovered and resolved. The patch is available in the mainline kernel, and it is essential for system administrators and users to update their Linux distributions accordingly to prevent any adverse effects. Stay safe, and keep your systems up to date to ensure the best possible security.

Timeline

Published on: 03/11/2024 18:15:19 UTC
Last modified on: 03/12/2024 12:40:13 UTC