-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C++/Docs: add example based on NtohlArrayNoBound #2318
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
C++/Docs: add example based on NtohlArrayNoBound #2318
Conversation
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.
Query LGTM. I'm not entirely familiar with the context.
Docs team, feel free to merge when you're happy. |
@@ -244,6 +244,49 @@ The following data flow configuration tracks data flow from environment variable | |||
select fopen, "This 'fopen' uses data from $@.", | |||
getenv, "call to 'getenv'" | |||
|
|||
The following taint tracking configuration tracks data from a call to ``ntohl`` to an array index operation. It uses the ``Guards`` library to recognize expressions that have been bounds checked and avoid propagating taint through them. It also uses ``isAdditionalTaintStep`` to add flow from loop bounds to loop indexes. |
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.
The following taint tracking configuration tracks data from a call to ``ntohl`` to an array index operation. It uses the ``Guards`` library to recognize expressions that have been bounds checked and avoid propagating taint through them. It also uses ``isAdditionalTaintStep`` to add flow from loop bounds to loop indexes. | |
The following taint-tracking configuration tracks data from a call to ``ntohl`` to an array index operation. It uses the ``Guards`` library to recognize expressions that have been bounds checked and avoid propagating taint through them. It also uses ``isAdditionalTaintStep`` to add flow from loop bounds to loop indexes. |
Hyphenate 'taint-tracking' when it's an adjective.
@@ -244,6 +244,49 @@ The following data flow configuration tracks data flow from environment variable | |||
select fopen, "This 'fopen' uses data from $@.", | |||
getenv, "call to 'getenv'" | |||
|
|||
The following taint tracking configuration tracks data from a call to ``ntohl`` to an array index operation. It uses the ``Guards`` library to recognize expressions that have been bounds checked and avoid propagating taint through them. It also uses ``isAdditionalTaintStep`` to add flow from loop bounds to loop indexes. |
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.
Second sentence doesn't quite flow for me. Does this make sense?
It uses the Guards
library to recognize expressions that have been bounds checked, and therefore don't propagate taint.
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.
That reads differently to me, since it implies that taint not propagating through bounds-checked expressions when using this confiugration is a property of the expression rather than a property of the taint-tracking configuration. Would this be better:
It uses the Guards
library to recognize expressions that have been bounds-checked and defines isSanitizer
to prevent taint from propagating through them.
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.
Yeah that's better. I misunderstood it before, but it makes more sense now. Thanks.
Co-Authored-By: James Fletcher <[email protected]>
@jf205 Please merge if you're happy with the changes. |
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.
James is on holiday today. You've addressed all his comments, so I'll merge.
Thanks for the merge @shati-patel. |
This adds a simple example of using the taint tracking library, including overriding the
isSanitizer
predicate, to the data flow library documentation.