CVE-2022-50699
Use-After-Sleep Bug in Linux Kernel SELinux convert_context() Function
Publication date: 2025-12-24
Last updated on: 2025-12-24
Assigner: kernel.org
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| linux | linux_kernel | 5.10.0 |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-UNKNOWN |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability in the Linux kernel's SELinux component involves improper use of memory allocation flags in the convert_context() function. Specifically, convert_context() was using GFP_KERNEL (which can sleep) in a context where sleeping is not allowed (inside a spin_lock_irqsave critical section). This could cause a BUG warning due to a sleeping function being called from an invalid context. The fix involved adding a gfp_t argument to convert_context() to properly use GFP_KERNEL or GFP_ATOMIC depending on the caller, preventing sleeping in atomic contexts.
How can this vulnerability impact me? :
This vulnerability can cause kernel BUG warnings and potentially system instability or crashes because a sleeping function was called from an invalid atomic context. This can affect system reliability and may lead to unexpected behavior or denial of service in environments using SELinux on the Linux kernel.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
You can detect this vulnerability by monitoring your system logs for the specific SELinux warning messages related to convert_context(), such as: 'SELinux: Converting 162 SID table entries...' and 'BUG: sleeping function called from invalid context'. Checking for these messages in the kernel logs (e.g., using 'dmesg' or 'journalctl') can help identify if the issue is occurring. For example, you can run commands like 'dmesg | grep SELinux' or 'journalctl -k | grep convert_context' to look for relevant warnings.
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation involves updating the Linux kernel to a version where this vulnerability is fixed, as the issue is resolved by properly handling GFP_KERNEL and GFP_ATOMIC flags in convert_context() and related functions. Until an update is applied, monitoring for the warning messages and avoiding workloads or operations that trigger the problematic code paths may reduce exposure.