From: Tiezhu Yang <yangtiezhu@loongson.cn>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Steven Rostedt <rostedt@goodmis.org>,
Shuah Khan <shuah@kernel.org>, Xuefeng Li <lixuefeng@loongson.cn>,
linux-mips@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] MIPS: Use NOKPROBE_SYMBOL() instead of __kprobes annotation
Date: Fri, 6 May 2022 11:24:06 +0800 [thread overview]
Message-ID: <d4115146-966a-61a5-6bdd-0cd7092fd3b4@loongson.cn> (raw)
In-Reply-To: <20220506104504.535c6ab065993b97604178fe@kernel.org>
On 05/06/2022 09:45 AM, Masami Hiramatsu wrote:
> On Thu, 5 May 2022 20:19:08 +0800
> Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>
>> If define CONFIG_KPROBES, __kprobes annotation forces the whole function
>> into the ".kprobes.text" section, NOKPROBE_SYMBOL() just stores the given
>> function address in the "_kprobe_blacklist" section which is introduced
>> to maintain kprobes blacklist.
>>
>> Modify the related code to use NOKPROBE_SYMBOL() to protect functions from
>> kprobes instead of __kprobes annotation under arch/mips.
>
> So you added some non '__kprobes' annotated functions to NOKPROBE_SYMBOL()
> in this patch. Those caused the kernel panic, right?
Oh, no, this patch is not related with the kernel panic, what it does
is just to use NOKPROBE_SYMBOL() instead of __kprobes annotation, and
also add some non '__kprobes' annotated functions in kprobes.c to
NOKPROBE_SYMBOL() because they can not be probed too.
> If so, please add such
> comment on this description too. Or, split this into 2 patches, one fixes
> the kernel panic by adding those functions to NOKPROBE_SYMBOL() and the
> other is replacing __kprobes with NOKPROBE_SYMBOL().
>
> Also, could you also find the commit which introduces the kernel panic?
> It is worth to backport such fix to stable trees.
I did some work to find some other functions lead to kernel panic,
mark them as notrace function can avoid the problems, but I am not
quite sure the root cause, so I do not submit the changes now.
Thanks,
Tiezhu
prev parent reply other threads:[~2022-05-06 3:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-05 12:19 [PATCH 0/2] Modify some code about kprobe Tiezhu Yang
2022-05-05 12:19 ` [PATCH 1/2] selftests/ftrace: Save kprobe_events to test log Tiezhu Yang
2022-05-06 1:46 ` Masami Hiramatsu
2022-05-05 12:19 ` [PATCH 2/2] MIPS: Use NOKPROBE_SYMBOL() instead of __kprobes annotation Tiezhu Yang
2022-05-06 1:45 ` Masami Hiramatsu
2022-05-06 3:24 ` Tiezhu Yang [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=d4115146-966a-61a5-6bdd-0cd7092fd3b4@loongson.cn \
--to=yangtiezhu@loongson.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=lixuefeng@loongson.cn \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
--cc=shuah@kernel.org \
--cc=tsbogend@alpha.franken.de \
/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;
as well as URLs for NNTP newsgroup(s).