Repository navigation
ilverify: respect IgnoresAccessChecksToAttribute - #136033
Conversation
ilverify now allows the access IgnoresAccessChecksToAttribute grants. like the runtime, it is checked last, and the public key only has to match when the attribute names one. tested: new AccessTestsIgnoreChecks tests fail on main, pass with the fix. Fix dotnet#130959
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @JulieLeeMSFT, @dotnet/jit-contrib |
There was a problem hiding this comment.
🟡 Changes recommended
Attribute identity validation differs from CoreCLR, and the key-mismatch fixture uses an invalid identity.
2 open issues
What changed in this PR
Adds IgnoresAccessChecksToAttribute support to ILVerify, addressing #130959.
Changes:
- Adds attribute-based access after normal visibility checks.
- Reuses public-key-token comparison logic.
- Adds IL fixtures for private access and key mismatch.
Validation here was limited to source inspection and attribute-blob decoding; no builds or project tests ran.
| File | Description |
|---|---|
| src/coreclr/tools/ILVerification/AccessVerificationHelpers.cs | Implements attribute-based access checks. |
| src/coreclr/tools/ILVerification.Tests/ILTests/AccessTestsIgnoreChecks.ilproj | Builds the new test fixture. |
| src/coreclr/tools/ILVerification.Tests/ILTests/AccessTestsIgnoreChecks.il | Exercises private access and key mismatch. |
Review effort: Balanced
|
IgnoresAccessChecksToAttribute is not really verifiable code. I am wondering whether it should be respected only under a switch - either a switch that is specific to IgnoresAccessChecksToAttribute or a more general switch that turns of IL verification, and just keeps IL validation (#37391) |
that makes sense, i will put it behind an option now |
off by default, since code relying on it is not verifiable. also rejects names with a version, culture, architecture or public key token, like the runtime does. Fix dotnet#130959
IgnoresAccessChecksTo now matches the assembly name the same way as InternalsVisibleTo, through one shared helper.
|
Thanks |
You re welcome |


fixes #130959
ilverify now allows the access IgnoresAccessChecksToAttribute grants. like the runtime, it is checked last, and the public key only has to match when the attribute names one.
tested: new AccessTestsIgnoreChecks tests fail on main, pass with the fix.