Saved in:
Bibliographic Details
Main Authors: Dai, Yuxuan, Feng, Yang
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2504.14500
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866918065256529920
author Dai, Yuxuan
Feng, Yang
author_facet Dai, Yuxuan
Feng, Yang
contents The pinning APIs of Rust language guarantee memory location stability for self-referential and asynchronous constructs, as long as used according to the pinning API contract. Rust ensures violations of such contract are impossible in regular safe code, but not in unsafe code where unsafe pinning APIs can be used. Library authors can encapsulate arbitrary unsafe code within regular library functions. These can be freely called in higher-level code without explicit warnings. Therefore, it is crucial to analyze library functions to rule out pinning API contract violations. Unfortunately, such testing relies on manual analysis by library authors, which is ineffective. Our goal is to develop a methodology that, given a library, attempts to construct programs that intentionally breach the pinning API contract by chaining library function calls, thereby verifying their soundness. We introduce RPIL, a novel intermediate representation that models functions' critical behaviors pertaining to pinning APIs. We implement PinChecker, a synthesis-driven violation detection tool guided by RPIL, which automatically synthesizes bug-revealing programs. Our experiments on 13 popular Rust libraries from crates.io found 2 confirmed bugs.
format Preprint
id arxiv_https___arxiv_org_abs_2504_14500
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle PinChecker: Identifying Unsound Safe Abstractions of Rust Pinning APIs
Dai, Yuxuan
Feng, Yang
Software Engineering
D.2.5
The pinning APIs of Rust language guarantee memory location stability for self-referential and asynchronous constructs, as long as used according to the pinning API contract. Rust ensures violations of such contract are impossible in regular safe code, but not in unsafe code where unsafe pinning APIs can be used. Library authors can encapsulate arbitrary unsafe code within regular library functions. These can be freely called in higher-level code without explicit warnings. Therefore, it is crucial to analyze library functions to rule out pinning API contract violations. Unfortunately, such testing relies on manual analysis by library authors, which is ineffective. Our goal is to develop a methodology that, given a library, attempts to construct programs that intentionally breach the pinning API contract by chaining library function calls, thereby verifying their soundness. We introduce RPIL, a novel intermediate representation that models functions' critical behaviors pertaining to pinning APIs. We implement PinChecker, a synthesis-driven violation detection tool guided by RPIL, which automatically synthesizes bug-revealing programs. Our experiments on 13 popular Rust libraries from crates.io found 2 confirmed bugs.
title PinChecker: Identifying Unsound Safe Abstractions of Rust Pinning APIs
topic Software Engineering
D.2.5
url https://arxiv.org/abs/2504.14500