From: sashiko-bot@kernel.org
To: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Cc: linux-modules@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] module: pull out add_taint_module() to be public
Date: Fri, 04 Sep 2026 05:21:22 +0000 [thread overview]
Message-ID: <20260904052123.27E601F00AC4@smtp.kernel.org> (raw)
In-Reply-To: <20260904-bind_taint-v3-1-30025465f38a@linuxfoundation.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The newly added docstring for `add_taint_module` provides dangerously misleading advice regarding the `lockdep_ok` parameter, treating an enum as a boolean and effectively reversing its logical meaning.
--
commit 2864484c56cc4bda3a7f73ba92dcb0a54f6a1232
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: module: pull out add_taint_module() to be public
This commit makes add_taint_module() public so other kernel code can call
it, providing a fallback to add_taint() when modules are not enabled.
> diff --git a/kernel/module/main.c b/kernel/module/main.c
> index d0e1e0bd2ad06..444d990c99832 100644
> --- a/kernel/module/main.c
> +++ b/kernel/module/main.c
[ ... ]
> +/**
> + * add_taint_module: add a taint flag if not already set for a specific module
> + * @mod: pointer to the module that caused the problem
> + * @flag: one of the TAINT_* constants.
> + * @lockdep_ok: whether lock debugging is still OK.
> + *
> + * If something bad has gone wrong, you'll want @lockdebug_ok = false, but for
> + * some noteworthy-but-not-corrupting cases, it can be set to true.
> + */
[Severity: Medium]
Does this documentation invert the logical meaning of the lockdep_ok enum?
Since lockdep_ok is an enum where LOCKDEP_STILL_OK is 0 and
LOCKDEP_NOW_UNRELIABLE is 1, a developer following this advice and passing
false (0) when a serious error occurs will inadvertently leave lock
debugging enabled. Passing true (1) for minor issues will unintentionally
disable lock debugging.
Would it be clearer to document the explicit enum values rather than
suggesting boolean true and false?
Also, there is a small typo in the parameter name here: @lockdebug_ok
is used instead of @lockdep_ok.
> +void add_taint_module(struct module *mod, unsigned flag,
> + enum lockdep_ok lockdep_ok)
> {
> add_taint(flag, lockdep_ok);
> - set_bit(flag, &mod->taints);
> + if (mod)
> + set_bit(flag, &mod->taints);
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260904-bind_taint-v3-0-30025465f38a@linuxfoundation.org?part=1
next prev parent reply other threads:[~2026-09-04 5:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 5:10 [PATCH v3 0/2] driver core: add TAINT_FORCED_BIND for when userspace manually messes with devices and drivers Greg Kroah-Hartman
2026-09-04 5:10 ` [PATCH v3 1/2] module: pull out add_taint_module() to be public Greg Kroah-Hartman
2026-09-04 5:21 ` sashiko-bot [this message]
2026-09-04 5:51 ` Greg Kroah-Hartman
2026-09-04 9:25 ` Petr Pavlu
2026-09-04 12:19 ` Greg Kroah-Hartman
2026-09-04 15:36 ` Petr Pavlu
2026-09-04 5:10 ` [PATCH v3 2/2] driver core: add TAINT_FORCED_BIND for when userspace manually messes with devices and drivers Greg Kroah-Hartman
2026-09-04 5:22 ` sashiko-bot
2026-09-04 5:51 ` Greg Kroah-Hartman
2026-09-04 19:46 ` [PATCH v3 0/2] " Armin Wolf
2026-09-05 11:27 ` Greg Kroah-Hartman
2026-09-05 12:51 ` Armin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260904052123.27E601F00AC4@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-modules@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox