{"id":37708,"date":"2019-10-31T22:19:14","date_gmt":"2019-10-31T19:19:14","guid":{"rendered":"https:\/\/prohoster.info\/blog\/frejmvork-dlya-napisaniya-zashhishhyonnyh-drajverov-dlya-yadra-linux-na-yazyke-rust\/"},"modified":"2019-10-31T22:19:14","modified_gmt":"2019-10-31T19:19:14","slug":"frejmvork-dlya-napisaniya-zashhishhyonnyh-drajverov-dlya-yadra-linux-na-yazyke-rust","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/news\/frejmvork-dlya-napisaniya-zashhishhyonnyh-drajverov-dlya-yadra-linux-na-yazyke-rust","title":{"rendered":"A framework for writing secure drivers for the Linux kernel in Rust","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Josh Triplett, who works at Intel and is part of the committee overseeing the development of Crates.io, spoke at the Open Source Technology Summit. <noindex><a rel=\"nofollow\" href=\"https:\/\/hub.packtpub.com\/rust-is-the-future-of-systems-programming-c-is-the-new-assembly-intel-principal-engineer-josh-triplett\/\">presented<\/a><\/noindex> the working group aimed at bringing the Rust language up to parity with C in the area of systems programming. <\/p>\n<p>In the working group currently being formed, Rust developers are collaborating with engineers from Intel to prepare specifications defining the functionality that needs to be implemented in Rust for system programming. System programming often requires low-level manipulations such as executing privileged processor instructions and obtaining detailed information about the processor's state. Among the already developing capabilities for Rust, support for unnamed structures, unions, assembler inserts (the &#171;asm!&#187; macro), and the BFLOAT16 floating-point number format is noteworthy.<\/p>\n<p>Josh believes that the future of systems programming belongs to Rust, while the C language, in modern realities, is competing for a place once held by Assembly.<br \/>\nRust not only frees developers from the C language's inherent problems arising from low-level memory manipulation but also provides the ability to apply modern programming paradigms in development.<\/p>\n<p>During <noindex><a rel=\"nofollow\" href=\"https:\/\/lwn.net\/Articles\/797714\/\">discussing<\/a><\/noindex> of the presentation<br \/>\nJosh expressed the idea of adding the ability to develop drivers in Rust to the Linux kernel, which would allow for the creation of safe and higher-quality drivers with minimal effort, free from issues such as accessing memory after it has been freed, dereferencing null pointers, and buffer overflows.  <\/p>\n<p>Greg Kroah-Hartman, who is responsible for maintaining the stable branch of the Linux kernel, expressed his readiness to add a framework for developing drivers in Rust to the kernel if it offers real advantages over C, such as providing safe wrappers over the kernel API. Additionally, Greg considers this framework only as an option, not active by default, to avoid including Rust among the kernel's build dependencies.<\/p>\n<p>It turns out that several teams are already working in this direction. For example, developers from &#171;Fish in a Barrel&#187; <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/fishinabarrel\/linux-kernel-module-rust\">prepared<\/a><\/noindex> A toolkit for writing loadable modules for the Linux kernel in Rust, using layers of abstraction over kernel interfaces and structures to enhance security. The layers are automatically generated based on existing kernel header files using a utility. <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/rust-lang\/rust-bindgen\">bindgen<\/a><\/noindex>. The Clang compiler is used to build the layers. The modules built, in addition to the layers, utilize the staticlib package.<\/p>\n<p>Simultaneously <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/lizhuohua\/linux-kernel-module-rust\">is being developed<\/a><\/noindex> another project focused on developing drivers for embedded systems and Internet of Things devices, which also uses bindgen to generate layers based on kernel header files. The framework aims to enhance driver safety without making changes to the kernel \u2014 instead of creating additional isolation levels for drivers within the kernel, it proposes to block issues at the compilation stage by using the safer Rust language. This approach is expected to be of interest to hardware manufacturers developing proprietary drivers quickly without conducting a thorough audit.<\/p>\n<p>Not all intended functionality has been implemented yet, but the framework is already quite usable and has been used to write a working driver for the LAN9512 USB Ethernet controller supplied with the Raspberry Pi 3 board. The existing smsc95xx driver, written in C, was used as a reference implementation for writing the Rust driver. It is noted that the module size and runtime overhead when developing a driver in Rust are minimal, allowing the framework to be applied to resource-constrained devices.<\/p>\n<p><noindex><a rel=\"nofollow\" name=\"link\"><\/a><\/noindex><\/p>\n<p>Source: <a \ncontent=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/www.opennet.ru\/opennews\/art.shtml?num=51401\">opennet.ru<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0414\u0436\u043e\u0448 \u0422\u0440\u0438\u043f\u043b\u0435\u0442 (Josh Triplett), \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Intel \u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432 \u043a\u043e\u043c\u0438\u0442\u0435\u0442, \u043a\u0443\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 Crates.io, \u0432 \u0441\u0432\u043e\u0451\u043c \u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043d\u0430 \u043a\u043e\u043d\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0438 Open Source Technology Summit \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0433\u0440\u0443\u043f\u043f\u0443, \u043d\u0430\u0446\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043d\u0430 \u0434\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u044f\u0437\u044b\u043a\u0430 Rust \u0434\u043e \u043f\u0430\u0440\u0438\u0442\u0435\u0442\u0430 \u0441 \u044f\u0437\u044b\u043a\u043e\u043c \u0421\u0438 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0412 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0433\u0440\u0443\u043f\u043f\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 Rust \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u0430\u043c\u0438 \u0438\u0437 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-37708","post","type-post","status-publish","format-standard","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0414\u0436\u043e\u0448 \u0422\u0440\u0438\u043f\u043b\u0435\u0442 (Josh Triplett), \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Intel \u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432 \u043a\u043e\u043c\u0438\u0442\u0435\u0442, \u043a\u0443\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 Crates.io, \u0432 \u0441\u0432\u043e\u0451\u043c \u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043d\u0430 \u043a\u043e\u043d\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0438 Open Source Technology Summit\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/news\/frejmvork-dlya-napisaniya-zashhishhyonnyh-drajverov-dlya-yadra-linux-na-yazyke-rust\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0437\u0430\u0449\u0438\u0449\u0451\u043d\u043d\u044b\u0445 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u044f\u0434\u0440\u0430 Linux \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Rust | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0414\u0436\u043e\u0448 \u0422\u0440\u0438\u043f\u043b\u0435\u0442 (Josh Triplett), \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Intel \u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432 \u043a\u043e\u043c\u0438\u0442\u0435\u0442, \u043a\u0443\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 Crates.io, \u0432 \u0441\u0432\u043e\u0451\u043c \u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043d\u0430 \u043a\u043e\u043d\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0438 Open Source Technology Summit\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/news\/frejmvork-dlya-napisaniya-zashhishhyonnyh-drajverov-dlya-yadra-linux-na-yazyke-rust\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-10-31T19:19:14+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-10-31T19:19:14+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47A framework for writing secure drivers for the Linux kernel in Rust | ProHoster","description":"Josh Triplett, working at Intel and part of the committee overseeing the development of Crates.io, in his presentation at the Open Source Technology Summit","canonical_url":"https:\/\/prohoster.info\/en\/blog\/news\/frejmvork-dlya-napisaniya-zashhishhyonnyh-drajverov-dlya-yadra-linux-na-yazyke-rust","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0437\u0430\u0449\u0438\u0449\u0451\u043d\u043d\u044b\u0445 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u044f\u0434\u0440\u0430 Linux \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Rust | ProHoster","og:description":"\u0414\u0436\u043e\u0448 \u0422\u0440\u0438\u043f\u043b\u0435\u0442 (Josh Triplett), \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Intel \u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432 \u043a\u043e\u043c\u0438\u0442\u0435\u0442, \u043a\u0443\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 Crates.io, \u0432 \u0441\u0432\u043e\u0451\u043c \u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043d\u0430 \u043a\u043e\u043d\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0438 Open Source Technology Summit","og:url":"https:\/\/prohoster.info\/en\/blog\/news\/frejmvork-dlya-napisaniya-zashhishhyonnyh-drajverov-dlya-yadra-linux-na-yazyke-rust","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-10-31T19:19:14+00:00","article:modified_time":"2019-10-31T19:19:14+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"37708","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-23 18:58:59","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-03-01 01:22:28","updated":"2026-01-23 18:58:59","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/37708","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=37708"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/37708\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=37708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=37708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=37708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}