From patchwork Mon Oct 24 11:30:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8464 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp402929wru; Mon, 24 Oct 2022 04:50:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Rs8HgietFhrs+wWzkrw0c9G6Fht19f8e/mZ9uRL0TIFZFMRG+vBID7WkadWdmiZ8jBHQS X-Received: by 2002:a05:6a00:24c2:b0:52e:7181:a8a0 with SMTP id d2-20020a056a0024c200b0052e7181a8a0mr33332989pfv.57.1666612256359; Mon, 24 Oct 2022 04:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666612256; cv=none; d=google.com; s=arc-20160816; b=J3axKDAg7jLFmXlPROEEIjDK2tRcBX9o9oiV1uXBX70LQAGL+Z9vmSE0sZ1DFSsmIF hLCB8S0ebNOWWwr848+l9VWq1zGmBx/P0AWVYVjib2GS4Nyj0bhAhc+YILvc8pqaDsRR aAfWG3R9Lu29Illf6Hs9YD5RgFkfB4ATo331GKoEOFBhP3kBVdMOyWUO/RcZXRPl2b4L fUq8S3b9/LlHT3ktzRBO4HC7aNb2DVhYnxeXKzp79J6PmAgQkmTuh7l6H3E+mHTmSb4Y O3EmrWu6xt8fR3QP/auKl04ODuj8exGBlNXFgGiR4HgGIZPCT39G21K9TNir7Kjubl9a +boQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oXGqk/1JFVZBma2x97fNrJtyJ0Px+iCkt68LukTnPM8=; b=ybn50L00qbQIkY/PDV//nlsJ/1H+vz9/6qUpFIwprIEJfzDWKooVET+ziQoZ9y8+eR EwRSgOcHsuD+svOoLxcWctPwNWBT+3ftUM24Q4MSWTLhl+z6L9JyDCNcWafUp1n+zYAY n6kfigZ0tr0MpsrATU8YhM6HXNx7gvsUc6aQqeSWAEgAa5Qr4peECzn/b0Wn4DBU6S26 l/1PnIYQzuN4H0lS7Yyu4yxd41EexN5tNNdmBzm/l5s7eBTO7iT9AB7rPtfgJ3YrtpcB CI12MoXkfUm7QOuNodFov+p6rZ37nY34hPKpOktzod2XftB8BrmRux4zFnSogNDYnKrC Rq/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aKjs1SqS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mw11-20020a17090b4d0b00b001fdcb564d73si10706079pjb.79.2022.10.24.04.50.43; Mon, 24 Oct 2022 04:50:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aKjs1SqS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229865AbiJXLu2 (ORCPT + 99 others); Mon, 24 Oct 2022 07:50:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231819AbiJXLtB (ORCPT ); Mon, 24 Oct 2022 07:49:01 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD1B274E25; Mon, 24 Oct 2022 04:43:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 31E8CCE1345; Mon, 24 Oct 2022 11:42:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23B42C433C1; Mon, 24 Oct 2022 11:42:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611765; bh=GCMxpoS+QE4tjPCCSDgrLpdROAxxNaAx6e6vdfdz/p8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aKjs1SqSoX8WueZ2hjriRQNfLYVekhCZUmbDmKmr8mG4FvfwMa2w/TKeOtSyEdP3W LPY+9EzWmbD8D9QYEO26a+mOfcVW1cXoVM7KhJbE1Hgo/VKSXVmgXEWGAroSKQ5cZm m4Da5+5E2HNXq4vkXGIxa6HbqXBGweGnPv/z8GQo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rasmus Villemoes , Jason Baron , Daniel Vetter , Jim Cromie , Sasha Levin Subject: [PATCH 4.9 102/159] dyndbg: fix module.dyndbg handling Date: Mon, 24 Oct 2022 13:30:56 +0200 Message-Id: <20221024112953.165529838@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112949.358278806@linuxfoundation.org> References: <20221024112949.358278806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747569613720360711?= X-GMAIL-MSGID: =?utf-8?q?1747569613720360711?= From: Jim Cromie [ Upstream commit 85d6b66d31c35158364058ee98fb69ab5bb6a6b1 ] For CONFIG_DYNAMIC_DEBUG=N, the ddebug_dyndbg_module_param_cb() stub-fn is too permissive: bash-5.1# modprobe drm JUNKdyndbg bash-5.1# modprobe drm dyndbgJUNK [ 42.933220] dyndbg param is supported only in CONFIG_DYNAMIC_DEBUG builds [ 42.937484] ACPI: bus type drm_connector registered This caused no ill effects, because unknown parameters are either ignored by default with an "unknown parameter" warning, or ignored because dyndbg allows its no-effect use on non-dyndbg builds. But since the code has an explicit feedback message, it should be issued accurately. Fix with strcmp for exact param-name match. Fixes: b48420c1d301 dynamic_debug: make dynamic-debug work for module initialization Reported-by: Rasmus Villemoes Acked-by: Jason Baron Acked-by: Daniel Vetter Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-3-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- include/linux/dynamic_debug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 546d68057e3b..d8981b34d142 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -167,7 +167,7 @@ static inline int ddebug_remove_module(const char *mod) static inline int ddebug_dyndbg_module_param_cb(char *param, char *val, const char *modname) { - if (strstr(param, "dyndbg")) { + if (!strcmp(param, "dyndbg")) { /* avoid pr_warn(), which wants pr_fmt() fully defined */ printk(KERN_WARNING "dyndbg param is supported only in " "CONFIG_DYNAMIC_DEBUG builds\n");