Skip to content
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

the warn-unused-plugin is broken in 1.3 #740

Closed
ivg opened this issue Dec 21, 2017 · 1 comment · Fixed by #939
Closed

the warn-unused-plugin is broken in 1.3 #740

ivg opened this issue Dec 21, 2017 · 1 comment · Fixed by #939
Milestone

Comments

@ivg
Copy link
Member

ivg commented Dec 21, 2017

Apparently the 817eac8 commit changed the semantics of taint introduction, so now, a place where taint is introduced also became a place where a taint is consumed. And although it makes some sense, it breaks WUR as the latter would consider all results as used at the callsite points.

echo > main.c << EOF
#include <stdlib.h>
int main(int argc, char** argv) {
  char* buf = malloc(10);
  realloc(buf, 12);
  return 0;
}
EOF
gcc -O0 main.c -o main
$ bap ./main --warn-unused --print-bir-attr={visited,tainted-reg,tainted-regs} -d | grep 'call @realloc' -A8
00000128: call @realloc with return %00000129

.visited ()
00000129: 
.tainted-regs {RAX => [00000120, 00000128]}
.visited ()
.tainted-reg 00000128
0000023f: realloc_result := RAX
.tainted-regs {RDI => [00000128]}

Notice, that the synthetic 23f term is now self proving, it both introduces and sanitizes the taint.

@gitoleg
Copy link
Contributor

gitoleg commented Apr 2, 2019

fixed in #939

@gitoleg gitoleg closed this as completed Apr 2, 2019
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 a pull request may close this issue.

2 participants