-
Notifications
You must be signed in to change notification settings - Fork 5.3k
More stack overflow avoidance in regex NonBacktracking #60786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More stack overflow avoidance in regex NonBacktracking #60786
Conversation
Remove unused Restrict methods instead of adding avoidance. Co-authored-by: Stephen Toub <[email protected]>
This follows a full audit of the NonBacktracking code.
|
Tagging subscribers to this area: @eerhardt, @dotnet/area-system-text-regularexpressions Issue DetailsThis adds more stack overflow avoidance to regex NonBacktracking's recursive algorithms. This includes all the fixes from dotnet/runtimelab#1662 plus additional ones found in a full audit we did with @veanes.
|
|
@olsaarik is it feasible to craft tests that hit some or all of these? otherwise the protection might "rot" during maintenance or feature work in future. |
....RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/MintermGenerator.cs
Outdated
Show resolved
Hide resolved
....RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/MintermGenerator.cs
Outdated
Show resolved
Hide resolved
....RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/MintermGenerator.cs
Outdated
Show resolved
Hide resolved
...gularExpressions/src/System/Text/RegularExpressions/Symbolic/RegexNodeToSymbolicConverter.cs
Outdated
Show resolved
Hide resolved
....Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexBuilder.cs
Outdated
Show resolved
Hide resolved
...tem.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexNode.cs
Outdated
Show resolved
Hide resolved
...tem.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexNode.cs
Outdated
Show resolved
Hide resolved
...tem.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexNode.cs
Outdated
Show resolved
Hide resolved
...tem.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexNode.cs
Outdated
Show resolved
Hide resolved
...tem.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexNode.cs
Outdated
Show resolved
Hide resolved
...tem.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexNode.cs
Outdated
Show resolved
Hide resolved
...tem.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexNode.cs
Outdated
Show resolved
Hide resolved
...tem.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexNode.cs
Outdated
Show resolved
Hide resolved
...ystem.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/TransitionRegex.cs
Outdated
Show resolved
Hide resolved
...ystem.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/TransitionRegex.cs
Outdated
Show resolved
Hide resolved
...ystem.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/TransitionRegex.cs
Outdated
Show resolved
Hide resolved
...ystem.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/TransitionRegex.cs
Outdated
Show resolved
Hide resolved
stephentoub
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add more depth tests for deep expressions, but that can be done separately.
This adds more stack overflow avoidance to regex NonBacktracking's recursive algorithms. This includes all the fixes from dotnet/runtimelab#1662 plus additional ones found in a full audit we did with @veanes.
Restrictin SymbolicRegexNode and SymbolicRegexSet would've required it too, but they turned out to be dead code, so were removed.