• Suren Baghdasaryan's avatar
    lib: prevent module unloading if memory is not freed · 47a92dfb
    Suren Baghdasaryan authored
    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: default avatarSuren Baghdasaryan <surenb@google.com>
    Tested-by: default avatarKees 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: default avatarAndrew Morton <akpm@linux-foundation.org>
    47a92dfb
codetag.h 1.94 KB