Is Rust Used Safely by Software Developers?

07/01/2020
by   Ana Nora Evans, et al.
0

Rust, an emerging programming language with explosive growth, provides a robust type system that enables programmers to write memory-safe and data-race free code. To allow access to a machine's hardware and to support low-level performance optimizations, a second language, Unsafe Rust, is embedded in Rust. It contains support for operations that are difficult to statically check, such as C-style pointers for access to arbitrary memory locations and mutable global variables. When a program uses these features, the compiler is unable to statically guarantee the safety properties Rust promotes. In this work, we perform a large-scale empirical study to explore how software developers are using Unsafe Rust in real-world Rust libraries and applications. Our results indicate that software engineers use the keyword unsafe in less than 30 Rust libraries, but more than half cannot be entirely statically checked by the Rust compiler because of Unsafe Rust hidden somewhere in a library's call chain. We conclude that although the use of the keyword unsafe is limited, the propagation of unsafeness offers a challenge to the claim of Rust as a memory-safe language. Furthermore, we recommend changes to the Rust compiler and to the central Rust repository's interface to help Rust software developers be aware of when their Rust code is unsafe.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/04/2019

Security Implications Of Compiler Optimizations On Cryptography -- A Review

When implementing secure software, developers must ensure certain requir...
research
06/17/2020

Breaking Type-Safety in Go: An Empirical Study on the Usage of the unsafe Package

A decade after its first release, the Go programming language has become...
research
05/19/2019

Safe and Chaotic Compilation for Hidden Deterministic Hardware Aliasing

Hardware aliasing occurs when the same logical address can access differ...
research
02/14/2019

Redundant Loads: A Software Inefficiency Indicator

Modern software packages have become increasingly complex with millions ...
research
08/02/2018

Go-HEP: writing concurrent software with ease and Go

High Energy and Nuclear Physics (HENP) libraries are now required to be ...
research
06/28/2022

Memory Safe Computations with XLA Compiler

Software packages like TensorFlow and PyTorch are designed to support li...
research
10/21/2022

Programming Bare-Metal Accelerators with Heterogeneous Threading Models: A Case Study of Matrix-3000

As the hardware industry moves towards using specialized heterogeneous m...

Please sign up or login with your details

Forgot password? Click here to reset