lkml.org 
[lkml]   [2022]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: "Unloaded tainted modules:" prints repeated wrong value
On Tue 2022-10-04 15:47 +0300, Alexey Dobriyan wrote:
> I got obiously incorrect values of "pcc_cpufreq():1" on a clean kernel
> and clean oops (see below). Original oops is different bug.

Hi Alexey,

[Added Luis Chamberlain and linux-modules@vger.kernel.org on Cc]

Sorry about that!

Indeed, in the context of the module deletion code path, no module
record/or entry should be added to 'unloaded_tainted_modules' if
the module does not carry a taint. I will send a patch shortly.
The following solution should be sufficient:

diff --git a/kernel/module/tracking.c b/kernel/module/tracking.c
index 7f8133044d09..af52cabfe632 100644
--- a/kernel/module/tracking.c
+++ b/kernel/module/tracking.c
@@ -21,6 +21,9 @@ int try_add_tainted_module(struct module *mod)

module_assert_mutex_or_preempt();

+ if (!mod->taints)
+ goto out;
+
list_for_each_entry_rcu(mod_taint, &unloaded_tainted_modules, list,
lockdep_is_held(&module_mutex)) {
if (!strcmp(mod_taint->name, mod->name) &&


Kind regards,

--
Aaron Tomlin

\
 
 \ /
  Last update: 2022-10-06 18:38    [W:0.038 / U:3.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site