Executive brief
A vulnerability in the Linux kernel's networking component could allow a local attacker to cause a system deadlock, leading to a complete service outage. The issue occurs when specific background tracing programs attempt to delete network socket information while the system is handling hardware interrupts. This results in a 'lock inversion' where the system becomes stuck waiting for resources that will never be released.
Technical details
A deadlock vulnerability exists in the BPF sockmap and sockhash components of the Linux kernel due to improper lock management. BPF tracing programs, which can be invoked from any interrupt context, may attempt to delete elements from a sockmap using map_delete_elem. Because the locks used in sockmap are not hardirq-safe by design, invoking these operations when interrupts are disabled can lead to a lock inversion deadlock. The fix involves detecting if map_delete_elem is called from a context where interrupts are disabled and returning an error (EOPNOTSUPP) to prevent the deadlock. This issue primarily affects availability (Denial of Service).
Affected products
- Linux Linux Kernel 4.20 to 5.4.274, 5.5 to 5.10.215, 5.11 to 5.15.154, 5.16 to 6.1.85, 6.2 to 6.6.26, 6.7 to 6.8.5
Timeline
- 2024-04-10: patched: Commits merged into various stable branches.
- 2024-05-19: disclosed: Initial publication of the CVE.
References
- https://git.kernel.org/stable/c/668b3074aa14829e2ac2759799537a93b60fef86
- https://git.kernel.org/stable/c/6af057ccdd8e7619960aca1f0428339f213b31cd
- https://git.kernel.org/stable/c/a44770fed86515eedb5a7c00b787f847ebb134a5
- https://git.kernel.org/stable/c/d1e73fb19a4c872d7a399ad3c66e8ca30e0875ec
- https://git.kernel.org/stable/c/dd54b48db0c822ae7b520bc80751f0a0a173ef75
- https://git.kernel.org/stable/c/f7990498b05ac41f7d6a190dc0418ef1d21bf058
- https://git.kernel.org/stable/c/ff91059932401894e6c86341915615c5eb0eca48