Patch "modpost: fix off by one in is_executable_section()" has been added to the 6.3-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    modpost: fix off by one in is_executable_section()

to the 6.3-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     modpost-fix-off-by-one-in-is_executable_section.patch
and it can be found in the queue-6.3 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 6fd9c066ffede8981a3ffcc10508e242e6be2826
Author: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Date:   Thu Jun 8 11:23:40 2023 +0300

    modpost: fix off by one in is_executable_section()
    
    [ Upstream commit 3a3f1e573a105328a2cca45a7cfbebabbf5e3192 ]
    
    The > comparison should be >= to prevent an out of bounds array
    access.
    
    Fixes: 52dc0595d540 ("modpost: handle relocations mismatch in __ex_table.")
    Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
    Signed-off-by: Masahiro Yamada <masahiroy@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 30d2ebc391f4a..b1163bad652aa 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1296,7 +1296,7 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf,
 
 static int is_executable_section(struct elf_info* elf, unsigned int section_index)
 {
-	if (section_index > elf->num_sections)
+	if (section_index >= elf->num_sections)
 		fatal("section_index is outside elf->num_sections!\n");
 
 	return ((elf->sechdrs[section_index].sh_flags & SHF_EXECINSTR) == SHF_EXECINSTR);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux