In the Linux kernel, a vulnerability has been discovered and resolved, which caused a lock held when returning to userspace. The vulnerability was reported by syzbot and was identified as causing a failure condition for the AFS (Andrew File System) merge preference rule. The vulnerability has been assigned the identifier CVE-2025-21672.

In this post, we will discuss the details of this vulnerability, the code snippet to fix it, and the original references to understand the issue better. This will help developers and security researchers get a comprehensive understanding of the issue and its impact.

Exploit Details

The issue was due to the held inode lock not being released when argc is less than , causing the function to return directly. This results in a lock held when returning to the user's pace, leading to a potential security vulnerability.

The fix involves storing the error in the 'ret' variable and jumping to the 'done' label to clean up instead of directly returning.

Here is the code snippet that implements the fix

// afs: Fix merge preference rule failure condition
if (argc < ) {
   ret = argc;
   goto done;      // jump to done label to clean up instead of returning directly
}

The original issue was discovered and reported by syzbot. You can review the syzbot report here for more details.

The fix for this issue was provided by Lizhi Xu, and you can refer to their original patch here.

Conclusion

The resolution of CVE-2025-21672 has fixed a potential security vulnerability in the Linux kernel regarding the AFS merge preference rule failure condition. The syzbot report provided crucial insights into the issue, and the code provided by Lizhi Xu helped resolve it promptly. It is crucial for developers and security researchers to stay updated with such vulnerability fixes and apply patches as soon as they are available to ensure the security of their systems.

Timeline

Published on: 01/31/2025 12:15:28 UTC
Last modified on: 02/03/2025 20:04:22 UTC