Skip to content

module: Introduce module unload taint tracking

Aaron Tomlin linux-modules lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest3 patches 1 replyIn review
  2. v42 patches 6 repliesSuperseded
  3. v32 patches 4 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v2 RFC2 patches0 repliesSuperseded
v1 RFC1 patch13 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3module: Make module_flags_taint() accept a module's taints bitmap and usable outside core codekernel/module/internal.h kernel/module/main.c+5 -40 replies
2/3module: Move module_assert_mutex_or_preempt() to internal.hkernel/module/internal.h kernel/module/main.c+12 -110 replies
3/3module: Introduce module unload taint trackinginit/Kconfig kernel/module/Makefile kernel/module/internal.h +2 more+99 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH v5 0/3] module: Introduce module unload taint tracking

Hi Luis,

This iteration is still based on the latest mcgrof/modules-next branch.

I have decided still to use RCU even though no entry is ever removed from the unloaded tainted modules list. That being said, if I understand correctly, it is not safe in some instances to use 'module_mutex' in print_modules(). So instead we disable preemption to ensure list traversal with concurrent list manipulation e.g. list_add_rcu(), is safe too.

Changes since v4 [1]
- Moved code to kernel/module/tracking.c
(Luis Chamberlain)
- Used only strcmp() in try_add_tainted_module()
(Christophe Leroy)

Changes since v3 [2]
- Fixed kernel build error reported by kernel test robot i.e. moved '#endif' outside 'if (!list_empty(&unloaded_tainted_modules))' statement in the context of print_modules()
- Used strncmp() instead of memcmp()
(Oleksandr Natalenko)
- Removed the additional strlen()
(Christoph Lameter)

Changes since v2 [3]
- Dropped RFC from subject
- Removed the newline i.e. "\n" in printk()
- Always include the tainted module's unload count
- Unconditionally display each unloaded tainted module

Please let me know your thoughts.

[1]: https://lore.kernel.org/all/[email protected]/
[2]: https://lore.kernel.org/all/[email protected]/
[3]: https://lore.kernel.org/all/[email protected]/

Aaron Tomlin (3):
module: Make module_flags_taint() accept a module's taints bitmap and
usable outside core code
module: Move module_assert_mutex_or_preempt() to internal.h
module: Introduce module unload taint tracking

 init/Kconfig             | 11 ++++++++
 kernel/module/Makefile   |  1 +
 kernel/module/internal.h | 34 ++++++++++++++++++++++
 kernel/module/main.c     | 24 ++++++----------
 kernel/module/tracking.c | 61 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 116 insertions(+), 15 deletions(-)
 create mode 100644 kernel/module/tracking.c

base-commit: eeaec7801c421e17edda6e45a32d4a5596b633da

Signature · 1 line
2.34.1