Skip to content

Various small-ish UB and Safety Fixes. - #319

Merged
phip1611 merged 9 commits into
mainfrom
ub2
Sep 4, 2026
Merged

Various small-ish UB and Safety Fixes.#319
phip1611 merged 9 commits into
mainfrom
ub2

Conversation

@phip1611

@phip1611 phip1611 commented Sep 4, 2026

Copy link
Copy Markdown
Member

No description provided.

new_boxed derives the allocation layout from tag_size, but derives the
Box's fat pointer from T::dst_len(&header), which reads the size back
from the header. If Header::set_size stores the size lossily (e.g.
truncates it to a smaller integer), the two disagree. Protect against
that.
The MaybeDynSized contract documents BASE_SIZE as the true structure
size without any implicit padding.
The resolution and character_size fields were Rust tuples inside the
repr(C, packed) struct. Tuples are repr(Rust) and have no layout
guarantee.
e/session_01GcU1hQr2jcCBdCtFgJshca
Remove it so the deprecated getter behaves exactly like the
elf_sections_tag()/sections() path it is documented to be replaced by.
The framebuffer serialization path was fixed a while ago; the whole
builder test runs cleanly under Miri. The leftover comment wrongly
suggests a known, unfixed soundness issue.
@phip1611
phip1611 enabled auto-merge September 4, 2026 07:36
@phip1611
phip1611 added this pull request to the merge queue Sep 4, 2026
Merged via the queue into main with commit 9b964ce Sep 4, 2026
29 checks passed
@phip1611
phip1611 deleted the ub2 branch September 4, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant