140 likes | 141 Views
Airac Static Analyzer for Automatic Verification of Array Index Ranges in C Programs. Airac. C 프로그램의 메모리접근 오류 자동 검출 int *c = (int *)malloc(sizeof(int)*10); c[ i ] = 1; c[ i + f() ] = 1; c[ *k + (*g)() ] = 1; x = c; x[1] = 1; y = c + f(); y[*(y+1)] = 1;
E N D
AiracStatic Analyzer for Automatic Verification of Array Index Ranges in C Programs
Airac • C 프로그램의 메모리접근 오류 자동 검출 int *c = (int *)malloc(sizeof(int)*10); c[i] = 1; c[i+ f()] = 1; c[*k + (*g)()] = 1; x = c; x[1] = 1; y = c + f(); y[*(y+1)] = 1; z->a = c; (z->a)[i] = 1; foo(c+2); int foo(int *d) {…d[i] = 1; …}
Airac keywords • C: analyzes ANSI C + (GNU) program • pointers(array, procedure) • controls(procedure, return, break, goto) • intra- and inter-procedural • statically: no test runs • all: complete, no un-noticed bug • automatic: a software • always stops: for infinite-loop programs • modular: for large programs • correct: solid theoretical foundation
Airac vs Swat(2/3) Airac Bugs Coverity
cdc_acm.c (Linux device driver)
허위경보 다스리기 • Bayesian statistical analysis • after training: c • probability for being true alarm ~ beta distribution(c,x) • Monte Carlo method • estimate the probability from the distribution • Decision theory • parameterize the decision threshold by the risk ratio of siliencing true alarms to false alarming • 결과: • risk ratio = 3 then 74.83% false alarms removed • ranking alarms: order of presenting errors to the user
Sifting Out False Alarms by Bayesian Statistical Post Analysis Alarms a1, a2, a3, .... Bayesian analysis a1 0.97 a2 0.12 a3 0.82 ...
Ranking False Alarms • Ranking alarms by their trueness: “truer” alarms first • Only 15.17% of false alarms were mixed up until the user observes 50% of the true alarms