Skip to content

PCC: switch "max" facts to "range" facts with two-sided ranges.#7263

Merged
cfallin merged 1 commit into
bytecodealliance:mainfrom
cfallin:pcc-two-sided-range
Oct 17, 2023
Merged

PCC: switch "max" facts to "range" facts with two-sided ranges.#7263
cfallin merged 1 commit into
bytecodealliance:mainfrom
cfallin:pcc-two-sided-range

Conversation

@cfallin
Copy link
Copy Markdown
Member

@cfallin cfallin commented Oct 17, 2023

This is needed for soundness when verifying accesses to memtype fields: it's not enough to know that we're accessing an offset in 0 up to field_offset inclusive, we need to know the access is actually to field_offset.

The simplest change that validates this turned out to be the most general one: making ranges two-sided rather than one-sided. The transform is mostly mechanical, but a few new tests verify that ranges are updated on both sides, and some fail-tests verify that "fuzzily imprecise" pointers to struct fields fail to validate.

@cfallin cfallin requested a review from fitzgen October 17, 2023 00:41
@cfallin cfallin requested a review from a team as a code owner October 17, 2023 00:41
@github-actions github-actions Bot added cranelift Issues related to the Cranelift code generator cranelift:area:aarch64 Issues related to AArch64 backend. labels Oct 17, 2023
Comment thread cranelift/codegen/src/ir/pcc.rs Outdated
Comment thread cranelift/codegen/src/ir/pcc.rs Outdated
Comment thread cranelift/codegen/src/ir/pcc.rs Outdated
This is needed for soundness when verifying accesses to memtype fields:
it's not enough to know that we're accessing an offset in `0` up to
`field_offset` inclusive, we need to know the access is actually to
`field_offset`.

The simplest change that validates this turned out to be the most
general one: making ranges two-sided rather than one-sided. The
transform is *mostly* mechanical, but a few new tests verify that ranges
are updated on both sides, and some fail-tests verify that "fuzzily
imprecise" pointers to struct fields fail to validate.
@cfallin cfallin force-pushed the pcc-two-sided-range branch from 869a710 to f6b7ba2 Compare October 17, 2023 16:24
@cfallin cfallin enabled auto-merge October 17, 2023 16:25
@cfallin cfallin added this pull request to the merge queue Oct 17, 2023
Merged via the queue into bytecodealliance:main with commit 39a33d2 Oct 17, 2023
@cfallin cfallin deleted the pcc-two-sided-range branch October 17, 2023 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift:area:aarch64 Issues related to AArch64 backend. cranelift Issues related to the Cranelift code generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants