Powered by OpenAIRE graph
Found an issue? Give us feedback
image/svg+xml art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos Open Access logo, converted into svg, designed by PLoS. This version with transparent background. http://commons.wikimedia.org/wiki/File:Open_Access_logo_PLoS_white.svg art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos http://www.plos.org/ UPCommons. Portal de...arrow_drop_down
image/svg+xml art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos Open Access logo, converted into svg, designed by PLoS. This version with transparent background. http://commons.wikimedia.org/wiki/File:Open_Access_logo_PLoS_white.svg art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos http://www.plos.org/
image/svg+xml art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos Open Access logo, converted into svg, designed by PLoS. This version with transparent background. http://commons.wikimedia.org/wiki/File:Open_Access_logo_PLoS_white.svg art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos http://www.plos.org/
versions View all 2 versions
addClaim

Linux Kernel Exploitation: Weaponizing CVEs

Authors: Calvo Domènech, Bernat;

Linux Kernel Exploitation: Weaponizing CVEs

Abstract

Aquest projecte fi de grau estudia dues vulnerabilitats d'escalat local de privilegis (LPE) trobades en el kernel de Linux: el CVE-2022-0847, també conegut com a "Dirty Pipe", i el CVE-2024-0582, que és més recent. La recerca feta profunditza en el procés d'explotació pas a pas d'aquests CVEs, des de la identificació de les vulnerabilitats fins al desenvolupament d'exploits fiables. El CVE-2022-0847 parteix d'un bug lògic que permet la inicialització d'una estructura pipe_buffer amb flags arbitràries. Aquesta vulnerabilitat es pot explotar preparant estructures pipe_buffer amb la flag PIPE_BUF_FLAG_CAN_MERGE i, posteriorment, inicialitzant-les amb la crida a sistema splice. Aquesta manipulació permet que un pipe_buffer faci referència a una pàgina de la page cache, fet que finalment habilita una escriptura arbitrària de fitxers que permet l'escalada de privilegis. D'altra banda, el CVE-2024-0582 parteix d'un Use-After-Free (UAF) de fins a 128 pàgines dins del subsistema io_uring. Per a explotar aquesta vulnerabilitat, primer es registra un buffer ring en una instància io_uring delegant la seva l'alocatació al kernel mitjançant la flag IOU_PBUF_RING_MMAP. A continuació, el buffer ring es mapeja des de l'espai d'usuari. La implementació d'mmap en el subsistema d'io_uring per defecte genera un mapping amb la flag VM_PFNMAP. A causa d'aquesta flag, el kernel no pot detectar que aquest mapping s'ha fet i, per tant, allibera les pàgines corresponents quan es desregistra el buffer ring. Un cop obtingut el dangling pointer, l'usuari pot forçar que la filp slab cache reutilitzi les pàgines prèviament alliberades mitjançant un spraying d'estructures file. Finalment, és possible modificar el camp f_mode d'una de les estructures file alocatades, afegint-hi les flags FMODE_WRITE i FMODE_CAN_WRITE a través del dangling pointer. Això permet l'escriptura al fitxer desitjat i permet l'escalada de privilegis. Finalment, es pot confirmar que els exploits desenvolupats són capaços d'aprofitar les vulnerabilitats esmentades de manera fiable, demostrant així la gravetat d'aquestes vulnerabilitats i la necessitat d'actualitzacions constants per a mitigar aquest tipus de forats de seguretat.

This project studies two Linux kernel local privilege escalation (LPE) vulnerabilites: CVE-2022-0847, also known as "Dirty Pipe", and the more recent CVE-2024-0582. The research focuses on the step-by-step exploitation process for these CVEs, from vulnerabily identification to the development of reliable exploits. For CVE-2022-0847, a logic bug allows the initialization of a pipe_buffer struct with arbitrary flags. This flaw can be leveraged by preparing pipe_buffer structs with the PIPE_BUF_FLAG_CAN_MERGE flag and later initializing them using the splice syscall. This manipulation allows a pipe_buffer to reference a page from the page cache, ultimately enabling an arbitrary file write and allowing privilege escalation. On the other hand, CVE-2024-0582 comes from a Use-After-Free (UAF) involving up to 128 pages within the io_uring subsystem. To exploit this vulnerability, a buffer ring is first registered in an io_uring instance, delegating its allocation to the kernel using the IOU_PBUF_RING_MMAP flag. Next, the buffer ring is mapped into user space. By default, the mmap implementation of the io_uring subsystem creates a mapping with the VM_PFNMAP flag. Due to this flag, the kernel is unable to detect that this mapping has happened and, therefore, releases the corresponding pages when the ring buffer is unregistered. Once the dangling pointer is obtained, the user can force the filp slab cache to reuse the previously freed pages by performing a file struct spraying. Finally, it is possible to modify the f_mode field of one of the allocated file structs, adding the FMODE_WRITE and FMODE_CAN_WRITE flags through the dangling pointer. This enables writing to the desired file and allows a privilege escalation. Finally, it can be confirmed that the developed exploits are capable of reliably leveraging and exploiting the mentioned vulnerabilities, thereby demonstrating the severity of these flaws and the need for constant updates to mitigate such vulnerabilities.

Country
Spain
Related Organizations
Keywords

FMODE_CAN_WRITE, CVE-2022-0847, PIPE_BUF_FLAG_CAN_MERGE, slab, file, exploit, f_pos, Seguretat informàtica, dirty-pipe, Àrees temàtiques de la UPC::Informàtica::Seguretat informàtica, pipe, Computer security, kernel, splice, UAF, CVE-2024-0582, f_mode, io_uring, cache, linux, mmap, pipe_buffer, IOU_PBUF_RING_MMAP, VM_PFNMAP, FMODE_WRITE

  • BIP!
    Impact byBIP!
    selected citations
    These citations are derived from selected sources.
    This is an alternative to the "Influence" indicator, which also reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically).
    0
    popularity
    This indicator reflects the "current" impact/attention (the "hype") of an article in the research community at large, based on the underlying citation network.
    Average
    influence
    This indicator reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically).
    Average
    impulse
    This indicator reflects the initial momentum of an article directly after its publication, based on the underlying citation network.
    Average
Powered by OpenAIRE graph
Found an issue? Give us feedback
selected citations
These citations are derived from selected sources.
This is an alternative to the "Influence" indicator, which also reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically).
BIP!Citations provided by BIP!
popularity
This indicator reflects the "current" impact/attention (the "hype") of an article in the research community at large, based on the underlying citation network.
BIP!Popularity provided by BIP!
influence
This indicator reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically).
BIP!Influence provided by BIP!
impulse
This indicator reflects the initial momentum of an article directly after its publication, based on the underlying citation network.
BIP!Impulse provided by BIP!
0
Average
Average
Average
Green