Skip to content

Symex taint analysis #247

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

Conversation

DanielNeville
Copy link
Contributor

Feedback and corrections welcomed.

Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would also be great if the branch were rebased first, so that there are no merge commits.

#include <limits>
#include <cassert>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the rationale for this change?

#include <goto-programs/goto_model.h>

class remove_ternaryt
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class definition should probably be moved to the .cpp file as is done in other transformations.

if(expr.id() == ID_code)
{
codet &code=to_code(expr);
if(to_code(expr).get_statement() == ID_assign)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use code instead of re-doing to_code(...)

void remove_ternaryt::operator()(goto_functionst &goto_functions)
{
Forall_goto_functions(f_it, goto_functions){
goto_programt &goto_program=f_it->second.body;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation?


void contains_ternary(exprt &expr, bool &contains);

bool contains_ternary(exprt &expr);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neither the "contains_ternary" nor "replaced" are used anywhere; the former is really dangerous as it will kill all sharing (well, actually contains_ternary would have to take a const exprt and be const).

@@ -13,15 +13,18 @@ Author: Daniel Kroening, [email protected]
#include "var_map.h"
#include "path_symex_history.h"

#include <path-symex/path_symex_taint_data.h>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "path_symex_taint_data.h" for consistency

assert(src.op0().op0().id() == ID_index);
assert(src.op0().op0().op0().id() == ID_string_constant);

dstring symbol_name=src.op0().op0().op0().get_string(ID_value);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dstring...


#include "path_symex_taint_data.h"

taint_datat::taint_rulet::taint_rulet()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use :loc(0), taint(0), ...

@@ -36,10 +36,16 @@ path_searcht::resultt path_searcht::operator()(

locs.build(goto_functions);

// this is the container for the history-forest
// Perform a non-comprehensive check on JSON file.
if(taint_engine->enabled &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this lacking a test for taint_engine being non-null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. Is there a preferred syntax within CProver for checking for null-ness?

(C++ supports a few methods)

@@ -41,6 +41,8 @@ class optionst;
"(round-to-nearest)(round-to-plus-inf)(round-to-minus-inf)(round-to-zero)" \
"(show-locs)(show-vcc)(show-properties)(show-goto-functions)" \
"(property):(trace)(show-trace)(stop-on-fail)(eager-infeasibility)" \
"(taint):(show-taint-data)(taint-file):" \
"(remove-ternary)" \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--help output for all of these, please

@DanielNeville
Copy link
Contributor Author

Thanks Michael. Appreciated. Will sort.

@kroening kroening self-assigned this Oct 6, 2016
@tautschnig tautschnig assigned DanielNeville and unassigned kroening Dec 11, 2016
@forejtv
Copy link
Contributor

forejtv commented Apr 4, 2017

@DanielNeville can you rebase, please, and comment whether you think this is ready to be reviewed?

@tautschnig tautschnig changed the base branch from master to develop August 22, 2017 12:35
smowton added a commit to smowton/cbmc that referenced this pull request May 9, 2018
catch by const ref instead of by value or non-const ref
chrisr-diffblue added a commit to chrisr-diffblue/cbmc that referenced this pull request Aug 24, 2018
…ies-of-function-entry-points

Control dependencies of function entry points
@hannes-steffenhagen-diffblue
Copy link
Contributor

This is obsolete. Part of this apparently made it into the dependency analysis in VSD according to @chrisr-diffblue

@martin-cs
Copy link
Collaborator

At the moment VSD doesn't do taint analysis. I think the larger issue is that the single-path symex was merged into the main CBMC.

@peterschrammel
Copy link
Member

This seems to be for https://github.com/diffblue/symex, which was moved out of CBMC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants