From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: sashiko-reviews@lists.linux.dev
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, 4 Sep 2026 07:51:08 +0200 [thread overview]
Message-ID: <2026090457-aide-backrest-d2eb@gregkh> (raw)
In-Reply-To: <20260904052123.27E601F00AC4@smtp.kernel.org>
On Fri, Sep 04, 2026 at 05:21:22AM +0000, sashiko-bot@kernel.org wrote:
> 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?
This preserves the existing api, nothing is changed, if we wish to
change this later we can.
> Also, there is a small typo in the parameter name here: @lockdebug_ok
> is used instead of @lockdep_ok.
That comes straight from the add_taint() documentation, so we are
typo-compatible :)
next prev parent reply other threads:[~2026-09-04 5:52 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
2026-09-04 5:51 ` Greg Kroah-Hartman [this message]
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=2026090457-aide-backrest-d2eb@gregkh \
--to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.