diff options
author | Richard Yao <[email protected]> | 2022-10-18 14:06:35 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2022-10-18 11:06:35 -0700 |
commit | d10bd7d288eb44bbdef686a0255271a174200701 (patch) | |
tree | 073fb6a625701b908f0d259c6282ca500959edd3 /module/os | |
parent | 27218a32fc5eb6661996204af3d43fd97c9bda4d (diff) |
Coverity model file update
Upon review, it was found that the model for malloc() was incorrect.
In addition, several general purpose memory allocation functions were
missing models:
* kmem_vasprintf()
* kmem_asprintf()
* kmem_strdup()
* kmem_strfree()
* spl_vmem_alloc()
* spl_vmem_zalloc()
* spl_vmem_free()
* calloc()
As an experiment to try to find more bugs, some less than general
purpose memory allocation functions were also given models:
* zfsvfs_create()
* zfsvfs_free()
* nvlist_alloc()
* nvlist_dup()
* nvlist_free()
* nvlist_pack()
* nvlist_unpack()
Finally, the models were improved using additional coverity primitives:
* __coverity_negative_sink__()
* __coverity_writeall0__()
* __coverity_mark_as_uninitialized_buffer__()
* __coverity_mark_as_afm_allocated__()
In addition, an attempt to inform coverity that certain modelled
functions read entire buffers was used by adding the following to
certain models:
int first = buf[0];
int last = buf[buflen-1];
It was inspired by the QEMU model file.
No additional false positives were found by this, but it is believed
that the more accurate model file will help to catch false positives in
the future.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Richard Yao <[email protected]>
Closes #14048
Diffstat (limited to 'module/os')
0 files changed, 0 insertions, 0 deletions