Vladimir Serbinenko, one of the three maintainers of the GRUB2 bootloader, who has contributed over five thousand changes to the codebase, has proposed the possibility of writing modules for GRUB2 using the Rust language. Vladimir presented the initial results of experiments adding Rust support to GRUB2 and creating the necessary bindings. Changes have also been prepared for GRUB that allow the use of shared libraries ('.so', ET_DYN) for modules, instead of linking at the object file level ('.o', ET_REL).
The initiative is currently positioned as a separate experiment that will not affect GRUB2 development. The optimal application of Rust in GRUB is mentioned as writing modules for new file systems. There is also the possibility of rewriting the code for disk partitions and GPT in Rust.
It is expected that using Rust will help the project reduce the likelihood of certain types of errors, especially in module code that contains many large and complex parsing procedures. In February, an audit of the GRUB codebase revealed 72 security issues, 21 of which were deemed serious vulnerabilities capable of bypassing the UEFI Secure Boot verified boot mechanism. 20 out of 21 vulnerabilities were caused by memory handling errors that led to buffer overflows or dereferencing memory after it was freed.
Additionally, it can be noted that the GNU Boot project has released version 0.1 RC6, which includes the aforementioned vulnerability fixes (in GRUB2, fixes continue to be spread as patches without forming a separate release). The GNU Boot project is developing a replacement for proprietary UEFI and BIOS firmware based on CoreBoot, but applying stricter requirements for including binary components. GNU Boot is presented as 'coreboot-libre', i.e., an edition of CoreBoot free from blobs and non-free components, analogous to how the Linux-libre project develops a clean version of the Linux kernel. Similar projects Libreboot and Canoeboot are also being developed separately.
Source: opennet.ru
