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 DE983C433FE for ; Tue, 25 Jan 2022 12:39:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383711AbiAYMjC (ORCPT ); Tue, 25 Jan 2022 07:39:02 -0500 Received: from fanzine2.igalia.com ([213.97.179.56]:40434 "EHLO fanzine2.igalia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383383AbiAYMet (ORCPT ); Tue, 25 Jan 2022 07:34:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=M+vFOpEIP37an1qVa4Tcx18DBd85JSmMXYYJr1B8Juo=; b=C7E5MvFAQyqvD+w935ILNjP9el jz6JeKwWmB7nslSM4eIWlO2IEQZqrAmI4qGTh3MAKAHOMIaF4CgSx8ZYokwBZuneOyYPrTNqya3vr cdFBj2v+WEL7hlQv61X3qSTQ9hAmBvbha8oqY+OPJcTVVF36GDZfrIaGpLShqImcW7WIWbU5fNsbV HgFKIimlz0G6sisUbTaoDfzjwFQbetdTH33Q0Cbhdg5odiX1B/aHptvzMBN1MM8NgahFlt4A7rKrc 7rnjhGYUjvmCFwZE8bEYwSaeikOIzNZ/+w0+sQrJwHEIdPskuQvGuPw9fCqRF+dvnxbvop2w8cUT+ Ke4lD5GA==; Received: from 200-207-58-141.dsl.telesp.net.br ([200.207.58.141] helo=[192.168.1.60]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1nCL20-0007YA-BU; Tue, 25 Jan 2022 13:34:40 +0100 Message-ID: Date: Tue, 25 Jan 2022 09:34:23 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH V4] notifier/panic: Introduce panic_notifier_filter Content-Language: en-US To: "d.hatayama@fujitsu.com" , "kexec@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "dyoung@redhat.com" Cc: "linux-doc@vger.kernel.org" , "bhe@redhat.com" , "vgoyal@redhat.com" , "stern@rowland.harvard.edu" , "akpm@linux-foundation.org" , "andriy.shevchenko@linux.intel.com" , "corbet@lwn.net" , "halves@canonical.com" , "kernel@gpiccoli.net" References: <20220108153451.195121-1-gpiccoli@igalia.com> From: "Guilherme G. Piccoli" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On 25/01/2022 08:50, d.hatayama@fujitsu.com wrote: >> + while ((func = strsep(&buf, ","))) { >> + addr = kallsyms_lookup_name(func); >> + if (!addr) { >> + pr_warn("panic_notifier_filter: invalid symbol %s\n", func); >> + continue; >> + } > > Could you remove this check? > > panic_notifier_list is exported to kernel modules and this check > prevents such users from using this feature. > > Thanks. > HATAYAMA, Daisuke Hi, thanks for the review. First of all, notice that it's very likely this patch isn't gonna get merged this way, we are considering a refactor that included 2 panic notifiers: one a bit earlier (pre_dump), that includes functions less risky, as watchdog unloaders, kernel offset dump, etc, and the second panic notifier (post_dump) will keep the majority of callbacks, and can be conditionally executed on kdump through the usage of "crash_kexec_post_notifiers". Anyway, I'm curious with your code review - how can we use this filter with modules, if the filter setup is invoked as early_param(), before modules load? In that case, module functions won't have a valid address, correct? So, in that moment, this lookup fails, we cannot record an unloaded module address in such list. Please, correct me if I'm wrong. Cheers, Guilherme