alloc_page leaks tracing

Oleg Drokin <[email protected]> Tue, 8 Mar 2022 12:28:59 -0500
Newsgroups org.kernel.vger.smatch
Message-ID <[email protected]>
Hello!

   I am wondering why alloc_page and friends are not considering an allocation function?
   Found a bit of code where there was an obvious alloc_page leak that was not caught that is caught if I change alloc_page to kmalloc.

   And while trying to put the support into smatch I suddenly found the structure changed so much from the previous time I looked at it it’s very non-obvious how to add it.

   I tried adding hooks in check_free_strict.c, check_frees_argument.c, check_leaks.c, smatch_constraints_required.c, smatch_fresh_alloc.c, smatch_parse_call_math.c
  and tried to insert it alongside kmalloc in smatch_scripts/gen_allocation_list.sh and I still cannot make
   it work in the actual kernel code even though a modified testcase from validation/sm_memory.c works.


   Any hint?

   Thanks.

Bye,
   Oleg