HomePhabricator

[msan] Add stat-family interceptors on Linux

Authored by foobarrior on Oct 20 2021, 4:53 PM.

Description

[msan] Add stat-family interceptors on Linux

Add following interceptors on Linux: stat, lstat, fstat, fstatat.

This fixes use-of-uninitialized value on platforms with GLIBC 2.33+.
In particular: Arch Linux, Ubuntu hirsute/impish.

The tests should have also been failing during the release on the mentioned platforms, but I cannot find any related discussion.

Most likely, the regression was introduced by glibc commit 8ed005daf0ab03e14250032:
all stat-family functions are now exported as shared functions.

Before, some of them (namely stat, lstat, fstat, fstatat) were provided as a part of libc_noshared.a and called their __xstat dopplegangers. This is still true for Debian Sid and earlier Ubuntu's. stat interceptors may be safely provided for them, no problem with that.

Closes https://github.com/google/sanitizers/issues/1452.
See also https://jira.mariadb.org/browse/MDEV-24841

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D111984

Details

Committed
eugenisOct 20 2021, 5:14 PM
Reviewer
eugenis
Differential Revision
D111984: [msan] Add stat-family interceptors on Linux
Parents
rG9ef55ddc3fe2: [lld-macho] Temporarily disable lc-linker-option.ll on Windows
Branches
Unknown
Tags
Unknown