lkml.org 
[lkml]   [2023]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/5] modules: Refactor + kdoc elf_validity_cached_copy
On Sat, Nov 18, 2023 at 02:54:43AM +0000, Matthew Maurer wrote:
> Functionality is almost identical, just structured for better
> documentation and readability. Changes:
>
> * Section names are checked for *all* non-SHT_NULL sections, not just
> SHF_ALLOC sections. We have code that accesses section names of
> non-SHF_ALLOC sections (see find_any_sec for example)
> * The section name check occurs *before* strcmping on section names.
> Previously, it was possible to use an out-of-bounds offset to strcmp
> against ".modinfo" or ".gnu.linkonce.this_module"
> * strtab is checked for NUL lead+termination and nonzero size
> * The symbol table is swept to ensure offsets are inbounds of strtab
>
> While some of these oversights would normally be worrying, all of the
> potentially unverified accesses occur after signature check, and only in
> response to a user who can load a kernel module.
>
> Signed-off-by: Matthew Maurer <mmaurer@google.com>
> ---
> kernel/module/internal.h | 7 +-
> kernel/module/main.c | 585 +++++++++++++++++++++++++++++----------
> 2 files changed, 444 insertions(+), 148 deletions(-)

Again, this needs to be broken into much smaller pieces before we can
even review it. Would you want to review this?

thanks,

greg "think of the reviewers" k-h

\
 
 \ /
  Last update: 2023-11-20 14:04    [W:0.153 / U:1.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site