REDHAT-BUG-2360236: Medium severity Linux Kernel Linux kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved:
md: fix mddev uaf while iterating allmddevs list
While iterating allmddevs list from mdnotifyreboot() and mdexit(), listforeachentrysafe is used, and this can race with deletint the next mddev, causing UAF:
t1: spinlock //listforeachentrysafe(mddev, n, ...) mddevget(mddev1) // assume mddev2 is the next entry spinunlock t2: //remove mddev2 ... mddevfree spinlock listdel spinunlock kfree(mddev2) mddevput(mddev1) spinlock //continue dereference mddev2->allmddevs
The old helper foreachmddev() actually grab the reference of mddev2 while holding the lock, to prevent from being freed. This problem can be fixed the same way, however, the code will be complex.
Hence switch to use listforeachentry, in this case mddevput() can free the mddev1 and it's not safe as well. Refer to mdseqshow(), also factor out a helper mddevputlocked() to fix this problem.
Affected Software
Event History
Frequently Asked Questions
What is the severity of REDHAT-BUG-2360236?
The severity of REDHAT-BUG-2360236 is classified as high due to the potential risk of use-after-free vulnerabilities.
How do I fix REDHAT-BUG-2360236?
To fix REDHAT-BUG-2360236, update the Linux kernel to the latest version provided by your distribution.
What systems are affected by REDHAT-BUG-2360236?
REDHAT-BUG-2360236 affects systems running the affected versions of the Linux kernel.
What is the nature of the vulnerability in REDHAT-BUG-2360236?
The vulnerability in REDHAT-BUG-2360236 is a use-after-free (UAF) issue occurring during the iteration of the all_mddevs list.
When was REDHAT-BUG-2360236 discovered?
REDHAT-BUG-2360236 was identified as a bug in the Linux kernel related to memory management issues.