Bug #7670
closedInstrumentation of memory allocation functions from driver code should correctly pass size of memory
100%
Description
Now function allocations with known size like kmalloc are replaced with ldv_malloc_unknown_size.
Thus size parameter is lost.
See for example aspect
around: ALLOC_KNOWN_SIZE { void *res; ldv_check_alloc_flags(flags); res = ldv_malloc_unknown_size(); ldv_after_alloc(res); return res; }
In correct case ldv_malloc(size) should be called.
Updated by Evgeny Novikov almost 8 years ago
- Assignee set to Evgeny Novikov
I also noticed this issue and I hope that I will be able to fix it together with fixes and improvements in other rule specifications.
Updated by Evgeny Novikov over 7 years ago
- Priority changed from Urgent to High
Let's fix and improve specifications after we will have good tests and a testing infrastructure (version:0.3) and likely after we will complete a considerable refactoring of Core (1.0).
Updated by Evgeny Novikov over 6 years ago
- Assignee changed from Evgeny Novikov to Anton Vasilyev
- Priority changed from High to Urgent
- Target version set to 1.0
It seems that we lose dozens of bugs and hundreds of false alarms due to this issue. Since its fix is trivial, we can include into Klever 1.0.
Updated by Evgeny Novikov over 6 years ago
- Related to Feature #7971: Rule specification generic:memory lacks test cases added
Updated by Anton Vasilyev over 6 years ago
- Status changed from New to Resolved
- Assignee changed from Anton Vasilyev to Evgeny Novikov
- % Done changed from 0 to 100
Fixed on branch fix_alloc_known_size, 68b24c59214
Updated by Anton Vasilyev over 6 years ago
Rebase on master is done in branch fix_alloc_known_size_rebase 92d9f523f ready to merge
Updated by Anton Vasilyev over 6 years ago
- Assignee changed from Evgeny Novikov to Anton Vasilyev
Tested with generic:memory
Updated by Evgeny Novikov over 6 years ago
I fixed it a bit in the same branch, updated preset marks and scheduled a comprehensive testing. If it will pass, I will merge the branch to master.
Updated by Evgeny Novikov over 6 years ago
I had to update the branch one more time and started one more iteration of testing, since tests identified differences in associated marks. Indeed, this happens first of all because of we still have very bad aspects for some rule specifications causing auxiliary functions ending with \d+ in error trace patterns (of course any slight change in instrumentation can result in changes in error trace patterns). Other cases can be expected because of there were calls to kmalloc in test drivers and in corresponding error trace patterns. Now there are calls to ldv_kmalloc.
Updated by Evgeny Novikov over 6 years ago
- Status changed from Resolved to Closed