From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF635C433EF for ; Fri, 6 May 2022 03:24:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388536AbiEFD2A (ORCPT ); Thu, 5 May 2022 23:28:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352476AbiEFD15 (ORCPT ); Thu, 5 May 2022 23:27:57 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0A2AD63BE4; Thu, 5 May 2022 20:24:14 -0700 (PDT) Received: from [10.130.0.135] (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9BxENvWlHRiua8LAA--.47364S3; Fri, 06 May 2022 11:24:07 +0800 (CST) Subject: Re: [PATCH 2/2] MIPS: Use NOKPROBE_SYMBOL() instead of __kprobes annotation To: Masami Hiramatsu References: <1651753148-1464-1-git-send-email-yangtiezhu@loongson.cn> <1651753148-1464-3-git-send-email-yangtiezhu@loongson.cn> <20220506104504.535c6ab065993b97604178fe@kernel.org> Cc: Thomas Bogendoerfer , Steven Rostedt , Shuah Khan , Xuefeng Li , linux-mips@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org From: Tiezhu Yang Message-ID: Date: Fri, 6 May 2022 11:24:06 +0800 User-Agent: Mozilla/5.0 (X11; Linux mips64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20220506104504.535c6ab065993b97604178fe@kernel.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X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jfUYnYwUUUUU X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/06/2022 09:45 AM, Masami Hiramatsu wrote: > On Thu, 5 May 2022 20:19:08 +0800 > Tiezhu Yang 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