[M] Change in dart/sdk[main]: [dyn_modules]: support redirecting factories in validator

0 views
Skip to first unread message

Sigmund Cherem (Gerrit)

unread,
Oct 10, 2025, 6:40:19 PMOct 10
to Sigmund Cherem, Alexander Markov, dart-fe-te...@google.com, rev...@dartlang.org
Attention needed from Alexander Markov

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Markov
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I448edd8a66b4f3818ff365fbdac24af98770747b
Gerrit-Change-Number: 454460
Gerrit-PatchSet: 3
Gerrit-Owner: Sigmund Cherem <sig...@google.com>
Gerrit-Reviewer: Alexander Markov <alexm...@google.com>
Gerrit-Attention: Alexander Markov <alexm...@google.com>
Gerrit-Comment-Date: Fri, 10 Oct 2025 22:40:16 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Alexander Markov (Gerrit)

unread,
Oct 13, 2025, 9:50:45 AMOct 13
to Sigmund Cherem, Alexander Markov, dart-fe-te...@google.com, rev...@dartlang.org
Attention needed from Sigmund Cherem

Alexander Markov added 2 comments

Commit Message
Line 26, Patchset 3 (Latest): * If there is another redirecting factory method that targets the
Alexander Markov . unresolved

This is still a bug which opens up a possibility to breach API surface described by a dynamic interface. Previously we had some discussions about using dynamic interface to enforce security sandbox, so this kind of breach would be undesirable.

Is it urgent enough to land this workaround / incomplete fix now instead of implementing a proper fix? If it is, then consider filing a bug about the incorrect enforcement of dynamic interface which this CL introduces.

File pkg/front_end/lib/src/kernel/dynamic_module_validator.dart
Line 390, Patchset 3 (Latest): case Procedure():
Alexander Markov . unresolved

This is likely insufficient if the whole library / class is exported via dynamic interface, as we're not going down to members when reading dynamic interface (in order to avoid spending too much time on reading dynamic interface if we only have a few references to validate).

If you implement this traversal down from libraries and classes, consider assessing how it affects bytecode compilation time in case of small dynamic module and huge dynamic interface (such as whole flutter framework).

Open in Gerrit

Related details

Attention is currently required from:
  • Sigmund Cherem
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I448edd8a66b4f3818ff365fbdac24af98770747b
Gerrit-Change-Number: 454460
Gerrit-PatchSet: 3
Gerrit-Owner: Sigmund Cherem <sig...@google.com>
Gerrit-Reviewer: Alexander Markov <alexm...@google.com>
Gerrit-Attention: Sigmund Cherem <sig...@google.com>
Gerrit-Comment-Date: Mon, 13 Oct 2025 13:50:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Sigmund Cherem (Gerrit)

unread,
Oct 13, 2025, 11:37:27 AMOct 13
to Sigmund Cherem, Alexander Markov, dart-fe-te...@google.com, rev...@dartlang.org
Attention needed from Alexander Markov

Sigmund Cherem added 2 comments

Commit Message
Line 26, Patchset 3 (Latest): * If there is another redirecting factory method that targets the
Alexander Markov . unresolved

This is still a bug which opens up a possibility to breach API surface described by a dynamic interface. Previously we had some discussions about using dynamic interface to enforce security sandbox, so this kind of breach would be undesirable.

Is it urgent enough to land this workaround / incomplete fix now instead of implementing a proper fix? If it is, then consider filing a bug about the incorrect enforcement of dynamic interface which this CL introduces.

Sigmund Cherem

This is not urgent and we don't have to land this. I had this initial idea and wanted to share it to get feedback and better understand the constraints 😊

File pkg/front_end/lib/src/kernel/dynamic_module_validator.dart
Alexander Markov . unresolved

This is likely insufficient if the whole library / class is exported via dynamic interface, as we're not going down to members when reading dynamic interface (in order to avoid spending too much time on reading dynamic interface if we only have a few references to validate).

If you implement this traversal down from libraries and classes, consider assessing how it affects bytecode compilation time in case of small dynamic module and huge dynamic interface (such as whole flutter framework).

Sigmund Cherem

Great points, makes sense. I appreciate hearing your concern around traversal costs during compilation.

Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Markov
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I448edd8a66b4f3818ff365fbdac24af98770747b
Gerrit-Change-Number: 454460
Gerrit-PatchSet: 3
Gerrit-Owner: Sigmund Cherem <sig...@google.com>
Gerrit-Reviewer: Alexander Markov <alexm...@google.com>
Gerrit-Attention: Alexander Markov <alexm...@google.com>
Gerrit-Comment-Date: Mon, 13 Oct 2025 15:37:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Alexander Markov <alexm...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Sigmund Cherem (Gerrit)

unread,
Nov 4, 2025, 1:56:55 PM (15 hours ago) Nov 4
to Sigmund Cherem, Alexander Markov, dart-fe-te...@google.com, rev...@dartlang.org

Sigmund Cherem abandoned this change

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: abandon
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages