Repository navigation
fix(juliet): print sinks read their data; score a leak only for CWE-401 - #97
Open
GuilhermeBn198 wants to merge 1 commit into
Open
GuilhermeBn198 wants to merge 1 commit into
GuilhermeBn198 wants to merge 1 commit into
Conversation
Two harness defects in the native Juliet runs, found on the CWE-416 results
of the JBCS 9.0 campaign (precision 32.7%, recall 48.6%).
The print sinks of juliet_stubs.c were no-ops, so a flaw whose only use is the
print never happened: 36 of 70 CWE-416 bad programs (use after free through
printLine or printStructLine) came out TRUE. printLine, printWLine,
printStructLine and printBytesLine now read what they would print, as io.c
does, without the external call.
The runner collapsed every FALSE-* into FALSE and counted it as the CWE's
flaw. Juliet's programs for the memory CWEs leak on purpose ("POTENTIAL
INCIDENTAL - Possible memory leak"), the fixed ones too, so all 70 fixed
CWE-416 programs scored FP on a FALSE-MEMTRACK, as did 30 of CWE-122 and 10
of CWE-476; 37 TPs were a leak, not the flaw. The CSV now keeps the
fine-grained verdict, and classify_for_cwe counts a leak only for CWE-401.
rescore_juliet.sh rescores a finished run from its raw logs, without running
it again. On the campaign data it gives 0 FP on every memory CWE; CWE-416
rerun with the new stubs: 68/70 bad FALSE-DEREF, precision 100%, recall 97.1%.
Tests: test_verdict_classifier (14 scoring cases), new test_juliet_stubs
(4 of 5 cases fail on the old stubs).
Collaborator
Author
|
Full rerun of the memory CWEs with this branch (
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
On the native Juliet runs of the JBCS 9.0 campaign, CWE-416 came out at precision 32.7% and recall 48.6%. The cause is two defects in the harness, not in Map2Check.
printLine,printWLine,printStructLineandprintBytesLineintests/juliet/juliet_stubs.cdid nothing, so a flaw whose only use is the print never happened. 36 of 70 CWE-416 bad programs (malloc_free_char,_wchar_t,_struct,return_freed_ptr) came outTRUE. The families that readdata[0]before the call (int,long,int64_t) were 30/30. The stub itself recorded this bias as pending.FALSE-*intoFALSE. Juliet's programs for the memory CWEs leak on purpose ("POTENTIAL INCIDENTAL - Possible memory leak"), the fixed ones too. All 70 FPs of CWE-416, 30 of CWE-122 and 10 of CWE-476 areFALSE-MEMTRACK, and 37 TPs were a leak rather than the flaw.Change
io.cdoes, without the external call.classify_for_cwe(tests/lib/verdict_classifier.sh) scores it against the CWE, and a leak counts only for CWE-401.tests/juliet/rescore_juliet.shrescores a finished run from its raw logs, without running it again.FALSE-MEMTRACKverdict.Evidence
FALSE-DEREF, the 70 good runsFALSE-MEMTRACK(TN). Precision 100%, recall 97.1% (was 32.7% / 48.6%). Longest run 5.5 s.Tests
test_verdict_classifier.sh: 38/38, 14 of them new scoring cases.test_juliet_stubs.sh(new, in CI): 5/5. On the old stubs 4 of the 5 fail.test_juliet_sampling.sh: 18/18.