Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4368963pxb; Tue, 25 Jan 2022 08:57:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJw73H+WU+7WBkBjDaSXq9GsYeVvZW+Au8T+v56nCnkNb02aGXZ9+cqwVGtKKqSHS7a8LF8r X-Received: by 2002:a17:906:dc93:: with SMTP id cs19mr6845760ejc.220.1643129854630; Tue, 25 Jan 2022 08:57:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643129854; cv=none; d=google.com; s=arc-20160816; b=n2/8OBbmqLUtJ1RDIkYVBEuzFaZ/bAb2a172cTBkiwxrvULUUgpxfKMWjVUZUkHa0j 5NWnpo4gL3hDo/Z2nLm3yVI9ZtL28hC0a6TaOcw1lq7Muo3Z0NMy0f6NCVfFB37qM4HH Avt4H2yOnWHxgAyxjhnh33fekpjHGO1M4a6r0kVZ9pY5U8yVhaKhKnTTMh5aa65c7RV2 ULcCXyYrSfL/ANCMdiFfAe/9dBnt76GaEiZjgBrdfpsmIrLzetn6PZUyByLrekim8b8R zv5549e11SDvaW2SxX7okUV3cR+L/PNf4xHZ2grfDc9P0b1pT7TZvkNTiP7KykbFtjBA nIMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=M+vFOpEIP37an1qVa4Tcx18DBd85JSmMXYYJr1B8Juo=; b=Foq9hv336trf6UCnOGMLCfitOM+ukfIfmze7ZrIs0tNyciyC9g1acU0OYOxx1YBzPt DSPj/j80nAmjpatU165LTHPoa8Bd00cDpvr2CaPDn8Do5NNnbMVGYjdmRD0sHQUVUBzg rgC/IRkQHxQvc3PRQewA2snQJCLVpyQrxAR3A7rNirW3XlJi+GCfWN+n7F2CdaJXvNFW o70UlnHe8SllvIwJ4s+QMukGnkx1RfuFA9ayu9P+R29SejL1Oc3KS0pBfLf3RJsjigsi MHdZdNNBO+B9EhD9x5SGLHX5YwD5uXKt+irSE/rq5dCtdQCAN9+GZAYW3NP9GRoJ26n6 tecg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=C7E5MvFA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g4si9633991edt.113.2022.01.25.08.57.08; Tue, 25 Jan 2022 08:57:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=C7E5MvFA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232012AbiAYMjR (ORCPT + 99 others); Tue, 25 Jan 2022 07:39:17 -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-kernel@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