linux/kernel/module
Suren Baghdasaryan 47a92dfbe0 lib: prevent module unloading if memory is not freed
Skip freeing module's data section if there are non-zero allocation tags
because otherwise, once these allocations are freed, the access to their
code tag would cause UAF.

Link: https://lkml.kernel.org/r/20240321163705.3067592-13-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Tested-by: Kees Cook <keescook@chromium.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Alex Gaynor <alex.gaynor@gmail.com>
Cc: Alice Ryhl <aliceryhl@google.com>
Cc: Andreas Hindborg <a.hindborg@samsung.com>
Cc: Benno Lossin <benno.lossin@proton.me>
Cc: "Björn Roy Baron" <bjorn3_gh@protonmail.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Dennis Zhou <dennis@kernel.org>
Cc: Gary Guo <gary@garyguo.net>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Wedson Almeida Filho <wedsonaf@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-04-25 20:55:52 -07:00
..
debug_kmemleak.c
decompress.c module/decompress: use kvmalloc() consistently 2023-11-02 07:35:39 -10:00
dups.c module: Remove redundant TASK_UNINTERRUPTIBLE 2023-12-19 13:30:28 -08:00
internal.h module: Don't ignore errors from set_memory_XX() 2024-02-16 11:30:43 -08:00
kallsyms.c modpost, kallsyms: Treat add '$'-prefixed symbols as mapping symbols 2023-07-24 12:09:47 -07:00
Kconfig This push fixes a regression that broke iwd as well as a divide by 2024-03-25 10:48:23 -07:00
kdb.c module: replace module_layout with module_memory 2023-03-09 12:55:15 -08:00
kmod.c module: add debugging auto-load duplicate module support 2023-04-19 17:26:01 -07:00
livepatch.c livepatch: fix ELF typos 2023-03-09 11:08:24 +01:00
main.c lib: prevent module unloading if memory is not freed 2024-04-25 20:55:52 -07:00
Makefile module: add debugging auto-load duplicate module support 2023-04-19 17:26:01 -07:00
procfs.c module: replace module_layout with module_memory 2023-03-09 12:55:15 -08:00
signing.c
stats.c module: Fix comment typo 2023-11-01 13:07:08 -07:00
strict_rwx.c module: Don't ignore errors from set_memory_XX() 2024-02-16 11:30:43 -08:00
sysfs.c module: Annotate struct module_notes_attrs with __counted_by 2023-11-01 13:07:32 -07:00
tracking.c module: add debug stats to help identify memory pressure 2023-04-18 11:15:24 -07:00
tree_lookup.c module: replace module_layout with module_memory 2023-03-09 12:55:15 -08:00
version.c