-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Brodes/seh flow phase1 throwing models #18014
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
Merged
jketema
merged 23 commits into
github:main
from
microsoft:brodes/seh_flow_phase1_throwing_models
Dec 4, 2024
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
de05aee
Adding model transition to using Throwing.qll.
bdrodes 4b83a45
Change log
bdrodes 1c7b5ae
Merge branch 'main' into brodes/seh_flow_phase1_throwing_models
bdrodes 792231c
Removing SEH default case for function calls as the logic to handle S…
bdrodes 1c874d3
Fixed usage raisesException
bdrodes 5bb765d
Merge branch 'main' into brodes/seh_flow_phase1_throwing_models
bdrodes 26d590a
Putting back deleted file, and deprecating instead. Deprecating mayTh…
bdrodes 63ddd81
Merge branch 'brodes/seh_flow_phase1_throwing_models' of https://gith…
bdrodes 0784776
bringing back mayThrowException to make it cleaner/easier for backwar…
bdrodes ae1ed38
Merge branch 'main' into brodes/seh_flow_phase1_throwing_models
bdrodes a69daa0
Missing change to 'mayThrowException' in StructuredExceptionHandling.qll
bdrodes 23485f1
Merge branch 'brodes/seh_flow_phase1_throwing_models' of https://gith…
bdrodes 4e77756
Changing terminology back to "throws" vs "rasis" for alwaysThrowsExce…
bdrodes 69df07e
Update cpp/ql/lib/change-notes/2024-11-18-throwing-functions.md
bdrodes 6aa7412
Merge branch 'main' into brodes/seh_flow_phase1_throwing_models
bdrodes 9b2590e
Updating PR per review comments. Moving more towards a simplified model.
bdrodes 4412691
Delaying deprecation of ThrowingFunction.
bdrodes 7059fc3
Adding intermediate solution towards deprecating ThrowingFunction
bdrodes 248f1c4
Updating change log
bdrodes 583651b
Missing NonCppThrowingFunction changes in Printf.qll
bdrodes 66cf736
printf formatting.
bdrodes 37365c7
Updating to NonCppThrowingFunction use in IncorrectALlocationErrorHan…
bdrodes e6641e7
Code and comment simplifications
bdrodes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| category: deprecated | ||
| --- | ||
| * The `NonThrowing` class (`semmle.code.cpp.models.interfaces.NonThrowing`) has been deprecated. Please use the `NonCppThrowingFunction` class instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
cpp/ql/lib/semmle/code/cpp/models/implementations/StructuredExceptionHandling.qll
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,7 @@ | ||
| import semmle.code.cpp.models.interfaces.Throwing | ||
|
|
||
| class WindowsDriverFunction extends ThrowingFunction { | ||
| WindowsDriverFunction() { | ||
| class WindowsDriverExceptionAnnotation extends AlwaysSehThrowingFunction { | ||
| WindowsDriverExceptionAnnotation() { | ||
| this.hasGlobalName(["RaiseException", "ExRaiseAccessViolation", "ExRaiseDatatypeMisalignment"]) | ||
| } | ||
|
|
||
| final override predicate mayThrowException(boolean unconditional) { unconditional = true } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ import semmle.code.cpp.models.Models | |
| import semmle.code.cpp.models.interfaces.FunctionInputsAndOutputs | ||
|
|
||
| /** | ||
| * A class that models the exceptional behavior of a function. | ||
| * A function that is known to raise an exception. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would leave this as it was, as we're going to deprecate this anyway.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
| */ | ||
| abstract class ThrowingFunction extends Function { | ||
| /** | ||
|
|
@@ -20,3 +20,8 @@ abstract class ThrowingFunction extends Function { | |
| */ | ||
| abstract predicate mayThrowException(boolean unconditional); | ||
| } | ||
|
|
||
| /** | ||
| * A function that unconditionally raises a structured exception handling (SEH) exception. | ||
| */ | ||
| abstract class AlwaysSehThrowingFunction extends Function { } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think we should be able to remove this predicate completely, but let's leave that as a follow up.
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.
Leaving it until the next iteration.