{"id":105815,"date":"2022-12-03T15:36:44","date_gmt":"2022-12-03T13:36:46","guid":{"rendered":"https:\/\/prohoster.info\/blog\/novosti-interneta\/okolo-21-novogo-kompiliruemogo-koda-v-android-13-napisano-na-yazyke-rust"},"modified":"2022-12-03T15:36:44","modified_gmt":"2022-12-03T13:36:46","slug":"okolo-21-novogo-kompiliruemogo-koda-v-android-13-napisano-na-yazyke-rust","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/news\/okolo-21-novogo-kompiliruemogo-koda-v-android-13-napisano-na-yazyke-rust","title":{"rendered":"About 21% of the new compiled code in Android 13 is written in Rust.","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Engineers at Google have drawn initial conclusions regarding the implementation of Rust support in the Android platform. In Android 13, approximately 21% of the newly added compileable code is written in Rust, while 79% is in C\/C++. The AOSP (Android Open Source Project) repository contains about 1.5 million lines of code in Rust, associated with new components such as the Keystore2 cryptographic key storage, the UWB (Ultra-Wideband) chip stack, the DNS-over-HTTP3 protocol implementation, the AVF (Android Virtualization Framework), and experimental stacks for Bluetooth and Wi-Fi.     <center><img decoding=\"async\" alt=\"About 21% of the new compiled code in Android 13 is written in Rust.\" src=\"\/wp-content\/uploads\/2022\/12\/6299bf41b363367229b874699034b828.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/center>    <\/p>\n<p>In line with the previously adopted strategy to reduce the risk of vulnerabilities caused by memory handling errors, Rust is currently mainly used for developing new code and gradually enhancing the security of the most vulnerable and critical software components. There is no overarching goal to transition the entire platform to Rust, and legacy code remains in C\/C++, while error resolution is managed through techniques like fuzz testing, static analysis, and methods similar to MiraclePtr (a wrapper over raw pointers that performs additional checks for accessing freed memory areas), the Scudo memory allocator (a safe replacement for malloc\/free), and memory error detection mechanisms such as HWAsan (Hardware-assisted AddressSanitizer), GWP-ASAN, and KFENCE.           <\/p>\n<p>Regarding the statistics on the nature of vulnerabilities in the Android platform, it is noted that as the new code that handles memory unsafely decreases, there is also a reduction in the number of vulnerabilities caused by memory handling errors. For example, the share of vulnerabilities caused by memory issues has shrunk from 76% in 2019 to 35% in 2022. In absolute numbers, in 2019, there were 223 vulnerabilities related to memory handling identified, in 2020 - 150, in 2021 - 100, and in 2022 - 85 (all identified vulnerabilities were in C\/C++ code, no similar issues have been found in Rust code so far). The year 2022 marked the first year when memory-related vulnerabilities ceased to dominate.       <center><img decoding=\"async\" alt=\"About 21% of the new compiled code in Android 13 is written in Rust.\" src=\"\/wp-content\/uploads\/2022\/12\/d75198f9cd7d0b5fdbaa22f56443267b.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/center>      <\/p>\n<p>Since memory-related vulnerabilities are generally the most dangerous, overall statistics also indicate a decrease in the number of critical issues and problems that can be exploited remotely. Meanwhile, the trend in identifying vulnerabilities not related to memory has remained roughly stable over the last four years - around 20 vulnerabilities per month. The proportion of serious issues among vulnerabilities caused by memory handling errors also remains constant (but as the number of such vulnerabilities decreases, so does the number of serious issues).      <center><img decoding=\"async\" alt=\"About 21% of the new compiled code in Android 13 is written in Rust.\" src=\"\/wp-content\/uploads\/2022\/12\/3dd83819e02c176dd56ea170513a07f4.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/center>            <\/p>\n<p>The statistics also track a correlation between the amount of new code that is unsafe in terms of memory management and the number of memory-related vulnerabilities (buffer overflows, accessing already freed memory, etc.). This observation confirms the assumption that the primary focus of introducing safe programming techniques should be on new code rather than rewriting existing code, as the majority of identified vulnerabilities pertain to new code.       <center><img decoding=\"async\" alt=\"About 21% of the new compiled code in Android 13 is written in Rust.\" src=\"\/wp-content\/uploads\/2022\/12\/754ec48c806a10ebc7dbec33c78241f1.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/center><br \/>\n<br \/>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/www.opennet.ru\/opennews\/art.shtml?num=58249\">opennet.ru<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0418\u043d\u0436\u0435\u043d\u0435\u0440\u044b \u0438\u0437 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Google \u043f\u043e\u0434\u0432\u0435\u043b\u0438 \u043f\u0435\u0440\u0432\u044b\u0435 \u0438\u0442\u043e\u0433\u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0432 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 Android \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Rust. \u0412 Android 13 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 21% \u043e\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 Rust, \u0430 79% \u043d\u0430 C\/C++. \u0412 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 AOSP (Android Open Source Project), \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0442\u0435\u043a\u0441\u0442\u044b \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b Android, \u043d\u0430\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 1.5 \u043c\u043b\u043d \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 \u043d\u0430 Rust, [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":105816,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-105815","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0418\u043d\u0436\u0435\u043d\u0435\u0440\u044b \u0438\u0437 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Google \u043f\u043e\u0434\u0432\u0435\u043b\u0438 \u043f\u0435\u0440\u0432\u044b\u0435 \u0438\u0442\u043e\u0433\u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0432 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 Android \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Rust. \u0412 Android 13 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 21% \u043e\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 Rust, \u0430 79% \u043d\u0430 C\/C++.\" \/>\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\/okolo-21-novogo-kompiliruemogo-koda-v-android-13-napisano-na-yazyke-rust\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2\" \/>\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\u041e\u043a\u043e\u043b\u043e 21% \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 Android 13 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Rust | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0418\u043d\u0436\u0435\u043d\u0435\u0440\u044b \u0438\u0437 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Google \u043f\u043e\u0434\u0432\u0435\u043b\u0438 \u043f\u0435\u0440\u0432\u044b\u0435 \u0438\u0442\u043e\u0433\u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0432 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 Android \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Rust. \u0412 Android 13 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 21% \u043e\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 Rust, \u0430 79% \u043d\u0430 C\/C++.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/news\/okolo-21-novogo-kompiliruemogo-koda-v-android-13-napisano-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=\"2022-12-03T13:36:46+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2022-12-03T13:36:46+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\udd47About 21% of the new compileable code in Android 13 is written in Rust | ProHoster","description":"Engineers from Google have reported the first results of implementing Rust language support in the Android platform. In Android 13, approximately 21% of the newly added compileable code is written in Rust, while 79% is in C\/C++.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/news\/okolo-21-novogo-kompiliruemogo-koda-v-android-13-napisano-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\u041e\u043a\u043e\u043b\u043e 21% \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 Android 13 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Rust | ProHoster","og:description":"\u0418\u043d\u0436\u0435\u043d\u0435\u0440\u044b \u0438\u0437 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Google \u043f\u043e\u0434\u0432\u0435\u043b\u0438 \u043f\u0435\u0440\u0432\u044b\u0435 \u0438\u0442\u043e\u0433\u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0432 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 Android \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Rust. \u0412 Android 13 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 21% \u043e\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 Rust, \u0430 79% \u043d\u0430 C\/C++.","og:url":"https:\/\/prohoster.info\/en\/blog\/news\/okolo-21-novogo-kompiliruemogo-koda-v-android-13-napisano-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":"2022-12-03T13:36:46+00:00","article:modified_time":"2022-12-03T13:36:46+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":[],"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/105815","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=105815"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/105815\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media\/105816"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=105815"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=105815"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=105815"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}