[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220516225640.3102269-4-jim.cromie@gmail.com>
Date: Mon, 16 May 2022 16:56:16 -0600
From: Jim Cromie <jim.cromie@...il.com>
To: jbaron@...mai.com, linux-kernel@...r.kernel.org,
dri-devel@...ts.freedesktop.org, amd-gfx@...ts.freedesktop.org,
intel-gvt-dev@...ts.freedesktop.org,
intel-gfx@...ts.freedesktop.org
Cc: gregkh@...uxfoundation.org, daniel.vetter@...ll.ch,
seanpaul@...omium.org, robdclark@...il.com, rostedt@...dmis.org,
mathieu.desnoyers@...icios.com, quic_saipraka@...cinc.com,
will@...nel.org, catalin.marinas@....com,
quic_psodagud@...cinc.com, maz@...nel.org, arnd@...db.de,
linux-arm-kernel@...ts.infradead.org,
linux-arm-msm@...r.kernel.org, mingo@...hat.com,
jim.cromie@...il.com, Rasmus Villemoes <linux@...musvillemoes.dk>
Subject: [PATCH v2 03/27] dyndbg: fix module.dyndbg handling
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, see below),
or ignored because dyndbg allows its no-effect use on non-dyndbg builds.
That said, the code has an explicit feedback message, which should be
issued accurately. Fix with strcmp, for exact param-name match.
Here is fixed behavior:
bash-5.1# modprobe drm dyndbgJUNK
[ 20.127473] drm: unknown parameter 'dyndbgJUNK' ignored
[ 20.128835] ACPI: bus type drm_connector registered
bash-5.1# rmmod drm
[ 37.961656] ACPI: bus type drm_connector unregistered
bash-5.1# modprobe drm dyndbg
[ 42.933220] dyndbg param is supported only in CONFIG_DYNAMIC_DEBUG builds
[ 42.937484] ACPI: bus type drm_connector registered
Reported-by: Rasmus Villemoes <linux@...musvillemoes.dk>
Signed-off-by: Jim Cromie <jim.cromie@...il.com>
---
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 dce631e678dd..f30b01aa9fa4 100644
--- a/include/linux/dynamic_debug.h
+++ b/include/linux/dynamic_debug.h
@@ -201,7 +201,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");
--
2.35.3
Powered by blists - more mailing lists