Vulnerabilities > CVE-2021-47248 - Race Condition vulnerability in Linux Kernel
Summary
In the Linux kernel, the following vulnerability has been resolved: udp: fix race between close() and udp_abort() Kaustubh reported and diagnosed a panic in udp_lib_lookup(). The root cause is udp_abort() racing with close(). Both racing functions acquire the socket lock, but udp{v6}_destroy_sock() release it before performing destructive actions. We can't easily extend the socket lock scope to avoid the race, instead use the SOCK_DEAD flag to prevent udp_abort from doing any action when the critical race happens. Diagnosed-and-tested-by: Kaustubh Pandey <[email protected]>
Vulnerable Configurations
Common Weakness Enumeration (CWE)
Common Attack Pattern Enumeration and Classification (CAPEC)
- Leveraging Race Conditions This attack targets a race condition occurring when multiple processes access and manipulate the same resource concurrently and the outcome of the execution depends on the particular order in which the access takes place. The attacker can leverage a race condition by "running the race", modifying the resource and modifying the normal execution flow. For instance a race condition can occur while accessing a file, the attacker can trick the system by replacing the original file with his version and cause the system to read the malicious file.
- Leveraging Time-of-Check and Time-of-Use (TOCTOU) Race Conditions This attack targets a race condition occurring between the time of check (state) for a resource and the time of use of a resource. The typical example is the file access. The attacker can leverage a file access race condition by "running the race", meaning that he would modify the resource between the first time the target program accesses the file and the time the target program uses the file. During that period of time, the attacker could do something such as replace the file and cause an escalation of privilege.
References
- https://git.kernel.org/stable/c/2f73448041bd0682d4b552cfd314ace66107f1ad
- https://git.kernel.org/stable/c/2f73448041bd0682d4b552cfd314ace66107f1ad
- https://git.kernel.org/stable/c/5a88477c1c85e4baa51e91f2d40f2166235daa56
- https://git.kernel.org/stable/c/5a88477c1c85e4baa51e91f2d40f2166235daa56
- https://git.kernel.org/stable/c/65310b0aff86980a011c7c7bfa487a333d4ca241
- https://git.kernel.org/stable/c/65310b0aff86980a011c7c7bfa487a333d4ca241
- https://git.kernel.org/stable/c/8729ec8a2238152a4afc212a331a6cd2c61aeeac
- https://git.kernel.org/stable/c/8729ec8a2238152a4afc212a331a6cd2c61aeeac
- https://git.kernel.org/stable/c/a0882f68f54f7a8b6308261acee9bd4faab5a69e
- https://git.kernel.org/stable/c/a0882f68f54f7a8b6308261acee9bd4faab5a69e
- https://git.kernel.org/stable/c/a8b897c7bcd47f4147d066e22cc01d1026d7640e
- https://git.kernel.org/stable/c/a8b897c7bcd47f4147d066e22cc01d1026d7640e
- https://git.kernel.org/stable/c/e3c36c773aed0fef8b1d3d555b43393ec564400f
- https://git.kernel.org/stable/c/e3c36c773aed0fef8b1d3d555b43393ec564400f