You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just looked through the patch, and left some comments where there were
changes not included in #5444. They are minimal, but some of them affect
previously public fields. I can include them in #5444, but that is not
for me to decide.
@dybucc I don't think you should include the additional changes in #5444. If necessary the changes such as removing pub from __st_ino, __old_st_blksize and __old_st-* could be made in a seperate PR.
@dybucc I don't think you should include the additional changes in #5444. If necessary the changes
such as removing pub from __st_ino, __old_st_blksize and __old_st-* could be made in a seperate PR.
I’ve removed the unnecessary field-visibility changes from this PR, so it is now superseded by #5444.
However, I note that #5444 was declined for stable. These changes are necessary to prevent Undefined Behavior, as reported in bytecodealliance/rustix#1668.
@tgross35 Since this PR is already targeted at libc-0.2, could these changes still be considered for inclusion here?
xtqqczze
changed the title
fix: use Padding in stat private fields
fix: use Padding in stat padding fields
Sep 7, 2026
The reason will be displayed to describe this comment to others. Learn more.
Realizing now this is targeted for 0.2. I won't want to take this change since these are some of the most popular structs in the crate and they happen to have all fields public on some platforms. Just means there's a higher chance of breakage than most other changes like this.
However, I note that #5444 was declined for stable. These changes are necessary to prevent Undefined Behavior, as reported in bytecodealliance/rustix#1668.
Also, commented on the other thread but so it's here as well: libc's definitions are correct, it's not our bug. rustix is doing a bad assume_init, among many others, and Miri just happened to flag the problem on stat.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use
Paddinginstatandstat64for fields likest_spare,__pad,__unused