3475是什么罩杯| 无名指为什么叫无名指| 健谈是什么意思| 移动电源和充电宝有什么区别| 术后吃什么水果| 梦到丢了一只鞋是什么意思| 共济失调是什么意思| 乙状结肠冗长是什么意思| 山水不相逢什么意思| 男女更年期分别在什么年龄| cpp是什么意思| 蕈是什么意思| olp是什么意思| 早晨起床手肿胀是什么原因| 抗衰老吃什么| 吃什么水果对肝好| 烤冷面是什么做的| 氟斑牙是什么原因造成的| 鹿角粉有什么功效和作用| 风湿因子高是什么原因引起的| 梦到牛是什么预兆| 小姐的全套都有什么| 白天咳嗽晚上不咳嗽是什么原因| 低钠有什么症状和危害| 智齿长什么样| 荷尔蒙爆发是什么意思| 鹿晗什么星座| esd手术是什么意思| 身上长小红点是什么原因| 无拘无束的意思是什么| 水鱼是什么| 食道好像有东西堵着是什么原因| 胎动少是什么原因| 2.5什么星座| 依赖是什么意思| 什么杯子不能装水| 喝柠檬水有什么作用与功效| 4月20是什么星座| 925银是什么意思| 羊宝是什么东西| 早餐什么时候吃最好| 早上左眼跳是什么预兆| 大陆对什么| 梦见买猪肉是什么预兆| 奶粉可以做什么美食| 金球奖什么时候颁发| 14年婚姻是什么婚| 老炮是什么意思| 梅毒为什么会自愈| 灵芝的功效与作用是什么| 四月27日是什么星座| 肾结石不能吃什么食物| 胳膊上的花是打了什么疫苗| 眼睛黑色部分叫什么| 代茶饮是什么意思| hrd是什么意思| 胎位loa是什么位置| eligible是什么意思| 1995是什么年| 胃出血什么症状| 三岁看大七岁看老什么意思| 沉住气是什么意思| 世侄是什么意思| 书房字画写什么内容好| 7月18号是什么日子| 吃酸的有什么好处| 为什么女追男没好下场| 肝的主要功能是什么| 冰毒是什么| 为什么印度叫阿三| 周二右眼皮跳是什么预兆| 牙齿酸痛是什么原因| la是什么意思| 长痱子是什么原因| 姑姑的孙子叫我什么| 每天熬夜有什么危害| 胃复安是什么药| 佝偻病缺少什么元素| 银色山泉香水什么牌子| 有龙则灵的灵是什么意思| v是什么化学元素| 打喷嚏流鼻涕吃什么药| 暂停服务是什么意思| 久字五行属什么| 心机什么意思| 坐月子什么意思| 茶颜悦色什么好喝| 建日是什么意思| 中指和无名指一样长代表什么| 名人轶事是什么意思| 34是什么意思| 阴历六月十九是什么日子| 老年人流鼻血是什么原因| 构树是什么树| 扁平足是什么| 状元是什么意思| 石斛主治什么| 吃什么食物| 狮子座跟什么星座最配| 欧尼酱什么意思| 喝酒后吃什么解酒最快| 1月24日什么星座| 像什么一样| 挖矿是什么| 渡劫什么意思| 堃字的寓意是什么意思| lalpina是什么牌子| 品牌logo是什么意思| 脱发去医院挂什么科| 麦霸什么意思| 夏天感冒咳嗽吃什么药| 吃什么美容养颜抗衰老| 耳闷耳堵是什么原因引起的| 经期吃什么食物比较好| 做梦死人了是什么征兆| 笙是什么意思| 割包皮有什么影响| 外阴瘙痒用什么药| henry是什么意思| 脑浆是什么颜色| 手痛挂什么科| 心悸是什么原因造成的| 电灯泡是什么意思| 男同是什么意思| 血气是什么意思| 诙谐幽默是什么意思| 克罗恩病是什么病| 梦见自己抬棺材是什么意思| 刚产下的蚕卵是什么颜色| 青春永驻是什么意思| 预计是什么意思| 中国第一大姓是什么| 肩膀疼是什么原因| 黄芪不能和什么一起吃| 家有一老如有一宝是什么意思| 什么是长孙| 欠佳是什么意思| 瞌睡多什么原因| 腮腺炎看什么科室| 二级产前超声检查是什么| 做梦梦见狗是什么意思| 糖尿病吃什么| 奶盖是什么| 脚后筋疼是什么原因引起的| 几成是什么意思| 欢乐海岸有什么好玩的| 胆小如鼠的意思是什么| 贵州有什么好吃的| 晚上睡觉脚冰凉是什么原因| 星座是什么意思| 84是什么意思| 蛇形分班是什么意思| 子宫直肠窝积液是什么意思| 人设崩塌是什么意思| ipv是什么疫苗| 杀青是什么意思| 康熙雍正乾隆是什么关系| 什么叫生僻字| 疯狗病症状都有什么| 生气发抖是什么原因| 红细胞偏高是什么原因| 千叶豆腐是什么做的| 宫内孕和宫外孕有什么区别| 星星为什么会眨眼| 士加一笔是什么字| 心肌供血不足吃什么| 胆固醇高不可以吃什么食物| 6.7是什么星座| 血液透析是什么意思| 10月14日什么星座| 甘草泡水喝有什么功效| camouflage什么意思| 厦门房价为什么那么高| 8月15日什么星座| 水瓶座与什么星座最配| 喝水有什么好处| 什么啤酒好喝| 左肋骨下面是什么器官| 交叉感染是什么意思| 加拿大属于什么洲| 神经衰弱吃什么| 梦见狐狸是什么预兆| 湿气重吃什么水果| 庚子是什么意思| 晧字五行属什么| 眼睛干涩是什么原因| 小孩黑眼圈很重是什么原因| 梦见自己尿裤子了是什么意思| cba什么意思| 京东pop是什么意思| 什么水果降火| b型钠尿肽测定是什么检查| 什么是花胶| 北极熊代表什么生肖| 娃娃脸是什么意思| 乙肝表面抗原阳性是什么意思| 葵花宝典是什么意思| 下巴疼是什么原因| 无名指长痣代表什么| 为什么会有高血压| 投影是什么意思| 宇宙的外面是什么| pa什么意思| 法西斯战争是什么意思| 新零售是什么意思| 中午吃什么饭家常菜| 高血压的人不能吃什么| 1967属什么生肖| 花柳病是什么病| 有妇之夫是什么意思| 精子有点黄是什么原因| 木乃伊是什么| 朋友圈屏蔽显示什么| 山药与什么食物相克| 荨麻疹吃什么中药| 刹那芳华是什么意思| 赴汤蹈火的汤是什么意思| 珑骧包属于什么档次| 乌龟肺炎用什么药| 朝鲜的货币叫什么| 什么节日吃汤圆| 银925什么意思| 烤箱可以烤些什么东西| 柯字五行属什么| 女生的下面长什么样| 没有美瞳护理液用什么代替| 南宁晚上有什么好玩的地方| 郁郁寡欢的意思是什么| 什么是三位一体| 抠脚大汉什么意思| 为什么会心梗| 梦见卖鱼是什么意思| 潮湿的近义词是什么| 新生儿黄疸高有什么风险| 归脾丸的功效与作用治什么病| 头孢什么时候吃| 月经推迟什么原因| 床上有横梁有什么害处| 梦见自己生了个儿子是什么意思| 银耳钉变黑了说明什么| 1950属什么生肖| 骨质疏松是什么症状| 6月11号是什么星座| 为什么我的眼里常含泪水| 小三阳是什么病| 5月24日什么星座| 琳五行属什么| 男人说冷静一段时间是什么意思| 男人有卧蚕代表什么| 血压计什么牌子好| 反讽是什么意思| 牛油果是什么味道的| 3月6号是什么星座的| 胃疼喝什么可以缓解| 兔和什么相冲| 费心是什么意思| 突然全身抽搐是什么病| 什么是八字生辰八字| 左脸颊有痣代表什么| 破伤风针有什么作用| 小米粥和什么搭配最好最养胃| 柏拉图爱情是什么意思| 血hcg是什么意思| 女人梦见桃子预示什么| 百度
Skip to content

Artwork: Susan Haejin Lee

How Rust developers are making the web safer

The Rust programming language makes it easier to build safer software. What will it take to Rust All the Things?

Klint Finley // October 14, 2021

The ReadME Project amplifies the voices of the open source community: the maintainers, developers, and teams whose contributions move the world forward every day.

Let's say you're building an email client in C++. Your new application will run on a workstation used by several different people every day. But somewhere along the line you made a mistake. By sending themselves a specially crafted email, they can overflow your application’s memory buffer and send the application commands to retrieve email from other users’ inboxes.

This buffer overflow bug is a classic example of a memory safety issue, and it's one of the most common types of security problems in software. Around 70 percent of all security issues fixed between 2004 and 2018 in Microsoft products were memory safety issues, according to a presentation by Matt Miller of the Microsoft Security Response Centre, which triages all of the company's reported security issues.

Memory safety is a huge issue. Operating systems need to ensure that individual applications don’t leak data to each other. Web browsers need to ensure that a web app open in one tab can't grab data from another tab. Cloud computing platforms need to ensure that one user can't read data from another user.

“Memory safety isn’t just a technical issue, it’s a social issue as well,” Internet Security Research Group Executive Director Joshua Aas. “Memory safety issues don’t just produce buggy software. They can crash services that people rely on to make a living or find employment. Security flaws can rob us of our privacy. Software can and should be built in better ways.”

In October 2020, the Internet Security Research Group launched a program called Prossimo dedicated to promoting memory safety on the internet. So far their key initiatives are using the Rust programming language, which was open sourced by Mozilla in 2010 and makes it easier to write memory safe code.

C, C++, and other programming languages that require developers to write code to manage their software's memory are considered “memory unsafe” because even small bugs can create memory safety issues. "No matter how talented your developers are, they're going to make mistakes," Aas says. "The world's greatest, most competent systems programming teams routinely create memory safety issues. Just look at the security patch notes for practically any major project and you'll see example after example."

As Laura Thomson, VP of Engineering at the cloud edge computing company Fastly, puts it: "Writing C is like doing brain surgery unassisted."

Writing software in "memory safe" languages that automatically manage memory has long been shown to reduce this entire class of security vulnerability. Nonetheless, C and C++ code is still everywhere. Operating systems, networking software, web browsers, and hardware drivers have all traditionally been written in C or its object-oriented successor C++. Whether you're using Android, iOS, Windows, Linux, or a Mac, there's a lot of C/C++ under the hood despite the use of memory safe languages like C#, Java, and Swift in many applications.

There's a good reason for that. C and C++ are fast. They're reliable. Programmers already know how to use them, there are thousands of open source libraries written in them, and they have compilers for practically every thinkable chipset.?

Hands typing on the keyboard of a laptop

Prossimo is focused on memory safety overall, not just Rust. But Rust may be more likely to disrupt the status quo in systems programming than any other language.?

"Rust is the first of a new set of languages introduced over the past 20 or so years that can really be used for things we've been stuck building in C or assembly code before," says Fastly CTO Tyler McMullen says. "It's memory performant, and has a compelling type system that lets you express higher-level concepts in a low-level language." Plus it interoperates well with other languages and can run on many platforms ranging from embedded systems to servers.

And Rust has traction. Rust was ranked the “most loved” programming language in Stack Overflow’s 2021 Developer Survey— the sixth year in a row the language took the top spot. Meanwhile, it’s become increasingly popular for everything from scientific computing to open source projects such as Deno, the new server-side JavaScript platform built by Node.js creator Ryan Dahl.

This year, Mozilla transferred stewardship of Rust to the Rust Foundation, a coalition founded by Amazon Web Services, Facebook, Google, Huawei, Microsoft, and Mozilla. It's a sign that the industry's biggest players are serious about the future of Rust.

Facebook, for example, now has hundreds of developers working with Rust, including some contributors to the core Rust programming language. Facebook isn’t abandoning other languages, but Rust is used for projects throughout the company, including the Diem blockchain, the Move programming language, and the next version of their Buck tool. “One of our primary goals being involved in the foundation is to work closely with the other excellent foundation members, and the Rust community, to help the Rust maintainers do their great work more efficiently in order to make Rust a mainstream language of choice for systems programming and beyond,” says Joel Marcey, Open Source Developer Advocate at Facebook and Member Director at the Rust Foundation.

Many companies are now using Rust to help secure their cloud computing platforms, including Amazon Web Services, Cloudflare, Fastly, and Microsoft Azure.?

"I wasn't sold on it a few years ago," McMullen says. But Fastly’s WebAssembly team asked to build some projects using Rust and McMullen was impressed with the performance and safety of the language. Now Rust is a core part of the company's stack. "Basically everything new we do on the backend is written in Rust," Thomson says. "The compute services our customers use to run code are all built on Rust."

McMullen says their goal is to make their entire data plane pipeline memory safe. "This is the sort of environment where we can't trust anyone," he says. "We can't trust the traffic coming in, we can't trust the code running on the servers. Writing in a language like Rust makes it easier to not have to trust."

AWS uses Rust in the networking stacks of multiple services, including EC2, S3, and CloudFront, says Shane Miller, the head of the Rust Platform team at Amazon Web Services. The cloud platform built much of its open source, container-oriented virtualization system Firecracker in Rust, as well as its Linux-based container operating system Bottlerocket. "Rust quickly became critical for delivering infrastructure at scale at AWS," says Miller, who is also chair of the Rust Foundation.

Doing greenfield development in memory-safe languages is a good start. But making the web more memory safe will require refactoring of older software as well. One of the most ambitious Rust programming language efforts is the push to add support for Rust in Linux, an undertaking not yet endorsed by Linus Torvalds, who told ZDnet that when it comes to Rust he's in the "wait and see camp."

In the meantime, the Rust for Linux team is working to make Rust and the kernel play nice together. For example, the Rust standard library assumes that memory allocations never return errors—a concept known as “infallible allocation.” When memory allocations fail, processes are terminated.? The catch is that this can cause kernel panics—in other words, the operating system halts entirely in response to what it considers a fatal error. That’s bad news if you’re running multiple workloads in parallel. The Rust for Linux team, sponsored by Google, recently worked around the issue using a custom Rust library, but project lead Miguel Ojeda wrote that he hopes to see the issue fixed upstream in Rust itself. "We have already started this process and some changes have been already accepted upstream," he wrote to the kernel mailing list.

If and when Rust for Linux is merged, it will be the first time the Linux kernel has officially supported a language other than C or assembly, says kernel developer Greg Kroah-Hartman.

Linux isn't the only operating system using Rust. In 2019, Adam Burch of Microsoft's Hyper-V engineering team announced in a blog post that he was rewriting a low-level system component of the Windows codebase in Rust, though he couldn't say what component. "Though the project is not yet finished, I can say that my experience with Rust has been generally positive. It’s a good choice for those looking to avoid common mistakes that often lead to security vulnerabilities in C++ code bases."

A laptop with code on the screen, sitting next to notebooks and pencils

Rusting All The Things

If you’re ready to put Rust to use yourself, the Rust community offers a wide variety of resources for learning the language. But be warned. As much as Rust’s fans love the language, it does come with a catch: many programmers complain that Rust has a steep learning curve compared to other modern languages. "Engineers compare learning Rust to learning to eat your veggies," Miller says. "They love it once they understand it, but it can be daunting. So one thing I'm focusing on is turning the broccoli into a brownie. Making the learning experience awesome."

To address the issue, Amazon Web Services is hiring experts in computer science education to consult on the design of the language. Some of the improvements are straightforward, like providing additional code examples in the documentation. Other ideas the company hopes to contribute to Rust are more complex. For example, rethinking Rust’s compilers.

But even for Rust’s biggest fans it's still hard to imagine all of the world's memory unsafe code being rewritten in Rust. It takes a long time for old code to be retired, especially if it already works well. Thompson Reuters estimates that there are still around 220 billion lines of COBOL, an even older language that dates back to the 1950s, in production, powering about 43 percent of banking systems and 95 percent of ATM swipes. Fortran is likewise still common in business applications around the world.

That said, not all old C/C++ code needs to be rewritten.? "We're not trying to address thousands of projects," Aas says. "We're focused on the critical components that just about everyone uses. Things like web servers, kernels, TLS, DNS, NTP—the core fabric of the internet."

"In some cases you can replace software component by component," Aas explains. "You can replace a memory unsafe library for a memory safe one and, over time, make the entire application more memory safe.”

Prossimo's work with Curl is a great example of this. Curl is written mostly in C, but Prossimo sponsored efforts to add support for Rust-based TLS and HTTP networking libraries in Curl. That makes it possible to use Rust for the parts of the application that touch the edge of the network without having to completely rewrite Curl. Curl doesn't default to using the Rust-based libraries, but anyone who prefers them can turn them on. "Our hope is that as the memory safe modules are tested and improved that they'll eventually become the default in all the major Linux distributions," Aas says.

Meanwhile, there are ways to sandbox memory unsafe code to minimize the risks associated with it. For example, Fastly is running much of their C/C++-based software through their Rust-based WebAssembly run-time. "It's a neat little way of putting all that software into Rust," McMullen says.

Bugs, including security vulnerabilities, are of course inevitable. But it’s entirely possible to eliminate a large swath of memory safety issues by choosing a programming language that protects against them. Rust offers an increasingly popular language that is not only performant, powerful, and open source, but also makes the internet safer for everyone.

About The
ReadME Project

Coding is usually seen as a solitary activity, but it’s actually the world’s largest community effort led by open source maintainers, contributors, and teams. These unsung heroes put in long hours to build software, fix issues, field questions, and manage communities.

The ReadME Project is part of GitHub’s ongoing effort to amplify the voices of the developer community. It’s an evolving space to engage with the community and explore the stories, challenges, technology, and culture that surround the world of open source.

Follow us:

Nominate a developer

Nominate inspiring developers and projects you think we should feature in The ReadME Project.

Support the community

Recognize developers working behind the scenes and help open source projects get the resources they need.

Sign up for the newsletter

Sharpen your open source skills with tips, tools, and insights. Delivered monthly.

什么然有序 疝气是什么症状 yjs是什么意思 什么自语 梦见发面是什么意思
五马长枪是什么意思 缺铁性贫血吃什么好 必修课是什么意思 脑死亡是什么原因引起的 睡眠质量差吃什么药
运费险是什么意思 代入感是什么意思 轻度肠上皮化生是什么意思 梦到自己长白头发是什么意思 长孙皇后叫什么名字
三天打鱼两天晒网什么意思 结痂是什么意思 偷鸡不成蚀把米是什么生肖 鱼龙混杂什么意思 六月中旬是什么时候
盛情难却是什么意思hcv9jop5ns6r.cn 弊是什么意思hcv8jop1ns6r.cn 屁股出血什么原因hcv8jop2ns5r.cn 苦瓜汤为什么要放黄豆hcv9jop3ns1r.cn 法图麦在回族什么意思hcv7jop7ns1r.cn
公费是什么意思hcv7jop6ns9r.cn 世界上最软的东西是什么hcv7jop6ns2r.cn 摇头晃脑是什么生肖hcv8jop4ns4r.cn 克罗恩病有什么症状hcv7jop9ns6r.cn 抗链o高是什么原因hcv7jop9ns0r.cn
应届是什么意思hcv8jop6ns5r.cn 茶学专业学什么hcv8jop5ns2r.cn 八格牙路是什么意思hcv8jop4ns6r.cn 火龙果有什么好处hcv9jop2ns4r.cn 肚脐上方是什么器官hcv9jop8ns1r.cn
咳嗽可以吃什么食物cj623037.com 双侧筛窦粘膜增厚是什么意思hcv9jop6ns9r.cn 褪黑素有什么副作用hcv8jop9ns7r.cn 贬低是什么意思hcv9jop6ns3r.cn 何辅堂是什么电视剧hcv9jop0ns9r.cn
百度