From: "chengjian (D)" <cj.chengjian@huawei.com>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>, <linux-kernel@vger.kernel.org>,
<huawei.libin@huawei.com>, <xiexiuqi@huawei.com>,
<bobo.shaobowang@huawei.com>, <naveen.n.rao@linux.ibm.com>,
<anil.s.keshavamurthy@intel.com>, <davem@davemloft.net>
Subject: Re: [PATCH] kretprobe: check re-registration of the same kretprobe earlier
Date: Mon, 9 Mar 2020 15:38:29 +0800 [thread overview]
Message-ID: <d5343941-b483-679e-d0f9-09793fa51200@huawei.com> (raw)
In-Reply-To: <20200307185439.9e88f3c8b55a3f11923ea694@kernel.org>
On 2020/3/7 17:54, Masami Hiramatsu wrote:
> Ah, I see. I thought that you said ri is use-after-free, but in reality,
> rp is use-after-free (use-after-init). OK.
>
>> And the problem here is destructive, it destroyed all the data of the
>> previously registered kretprobe,
>> it can lead to a system crash, memory leak, use-after-free and even some
>> other unexpected behavior.
> Yes, so I think we should do
>
> + /* Return error if it's being re-registered */
> + ret = check_kprobe_rereg(&rp->kp);
> + if (WARN_ON(ret))
> + return ret;
>
> This will give a warning message to the developer.
>
> Thank you,
OK, I will add the WARN_ON in V2.
Thank you.
----Cheng Jian
prev parent reply other threads:[~2020-03-09 7:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-06 9:35 Cheng Jian
2020-03-06 15:21 ` Masami Hiramatsu
2020-03-07 2:16 ` chengjian (D)
2020-03-07 9:54 ` Masami Hiramatsu
2020-03-09 7:38 ` chengjian (D) [this message]
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=d5343941-b483-679e-d0f9-09793fa51200@huawei.com \
--to=cj.chengjian@huawei.com \
--cc=anil.s.keshavamurthy@intel.com \
--cc=bobo.shaobowang@huawei.com \
--cc=davem@davemloft.net \
--cc=huawei.libin@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@kernel.org \
--cc=naveen.n.rao@linux.ibm.com \
--cc=xiexiuqi@huawei.com \
/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
all inboxes | Powered by JetHome®