From: Dan Carpenter <dan.carpenter@oracle.com>
To: Oleg Drokin <green@linuxhacker.ru>
Cc: smatch@vger.kernel.org
Subject: Re: alloc_page leaks tracing
Date: Tue, 22 Mar 2022 11:05:13 +0300 [thread overview]
Message-ID: <20220322080513.GS336@kadam> (raw)
In-Reply-To: <20220311211215.GN3315@kadam>
I've pushed some changes to the check_unwind.c script so now the results
say which function allocated it.
I still haven't added the alloc_pages() and related functions to the
function table. I need to do that. I'm also still thinking about the
correct solution to the return_implies_param_key_exact() problem. I
guess on my system, I just hardcoded the return values. There is no
harm in pushing that so let me do that.
There are bunch of common false positives like:
1) put_device() frees the page. I've been sort of working towards
making put_device() handled in the correct way where we figure out
what function it calls and parse the container_of() correctly and
then it's all handled transparently by the check_kernel.c. But for
now probably the right thing is to add a special case to
check_unwind.c.
2) Arrays. Again, probably add a special case in check_unwind.c
3) Direct calls to a function which frees pointers from container_of().
Eventually this will work correctly. Another option for this would
be to do what check_locking does and just record whenever a function
frees something and then in the caller try to guess which resource
it was based on the name.
So there is quite a bit of work which can be done still.
regards,
dan carpenter
next prev parent reply other threads:[~2022-03-22 8:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-08 17:28 alloc_page leaks tracing Oleg Drokin
2022-03-10 9:42 ` Dan Carpenter
[not found] ` <82B7079C-AD17-4E5E-A245-71E9ED53E5A3@linuxhacker.ru>
2022-03-11 21:12 ` Dan Carpenter
2022-03-22 8:05 ` Dan Carpenter [this message]
2022-03-25 6:48 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220322080513.GS336@kadam \
--to=dan.carpenter@oracle.com \
--cc=green@linuxhacker.ru \
--cc=smatch@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox