Greg Croa-Hartman rÀÀkis, kuidas Rust vÔib aidata tuuma Linuxi vigade vastu vÔitlemisel.

Greg Kroah-Hartman, who is responsible for maintaining the stable and 'staging' branches of the Linux kernel and serves as the maintainer for 16 subsystems of the kernel, presented a talk at Rust Week 2026, discussing how the Rust language can help prevent vulnerabilities in the kernel that arise from typical mistakes made by C developers related to memory handling, locks, error processing, and dealing with untrusted data. The main advantage of Rust is its ability to identify such errors during compilation rather than through human code reviews. However, Rust is not viewed as a panacea that will eliminate all problems, and there are no plans to rewrite the kernel in Rust; it is expected that Rust will gradually be integrated through its use for new drivers and subsystems.

As an example of kernel errors that could be avoided with Rust, an issue in the Bluetooth subsystem that went unnoticed for 15 years and a problem in the Xen hypervisor were mentioned. In the first case, a developer dereferenced a pointer without checking, and in the second case, a lock was forgotten in the error handling code.
According to Greg, most errors in the kernel are caused by such minor issues that accumulate over time and surface as vulnerabilities. In Rust, many of these problems are prevented by the compiler. For instance, Rust abstractions for locks in the kernel only allow access to internal pointers of structures after acquiring the corresponding lock, which is released automatically. Without acquiring the lock, it is impossible to access the structure pointers in Rust.

Greg believes that such capabilities in Rust would have prevented 60% of the errors detected in the kernel, and the checks performed by the compiler would save maintainers time from having to discuss error handling correctness and the justification for placing locks in the right spots with the authors. Moreover, the introduction of Rust support has already positively influenced the C code in the kernel by tidying up the C code and interfaces, as well as borrowing some development techniques (for example, locks with limited scope have been implemented).

TĂ€nu tĂŒpihaldussĂŒsteemile, mis tagab kindlate reeglite jĂ€rgimise, ja pideva integreerimise sĂŒsteemide rakendamisele, mis kontrollivad koodi kogumise ajal, saavad muutuste vaatlejad Rustis keskenduda tööloogika kontrollimisele, mitte ressurssidega manipuleerimise jĂ€lgimisele. Rusti kasutamine vĂ”imaldab ka andmete, mis tulevad varustuselt vĂ”i vĂ€liste sĂŒsteemidelt, eest hoolikamalt suhtuda. Seda saavutatakse, eristades usaldusvÀÀrseid ja usaldamatuid andmeid tĂŒpihaldustasandil: arendaja peab lihtsalt analĂŒĂŒsima, kui liikuda usaldamatust olekust usaldatavasse seisundisse.

Viimasel ajal avaldab Linuxi tuumaturvalisuse meeskond iga pĂ€ev umbes 13 haavatavuse raporteid, mis tundub varasemate haavatavuste tuvastamise dĂŒnaamikaga vĂ”rreldes mĂ”istuse maalt vĂ€lja minevana (nĂ€iteks eilse pĂ€eva jooksul avaldati 277 haavatavuse raporteid tuumas). Gregi arvates on Rusti kasutamine ĂŒks tĂ”husamaid viise vĂ€hendada tuumas vigu, mis on pĂ”hjustatud traditsioonilistest vigadest, mis on seotud vigade kĂ€sitlemise ja ressursside haldamisega. Rusti toetus on tuumas juba katsetamisest kaugemale jĂ”udnud ja möödunud aasta lĂ”pus tunnustati seda tuuma pĂ”hifunktsioonina.

MĂ€ngi videot


Allikas: opennet.ru
Osta usaldusvÀÀrne hostimine veebilehtede jaoks DDoS-i kaitsega, VPS VDS serverid đŸ”„ Osta usaldusvÀÀrne hostimine veebilehtede jaoks DDoS-i kaitsega, VPS VDS serverid | ProHoster