Patch "alpha/boot/tools/objstrip: fix the check for ELF header" has been added to the 5.10-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

    alpha/boot/tools/objstrip: fix the check for ELF header

to the 5.10-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:
     alpha-boot-tools-objstrip-fix-the-check-for-elf-head.patch
and it can be found in the queue-5.10 subdirectory.

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



commit a213fa18fefca5556d54f871a056affdf4bc5ec1
Author: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Date:   Mon Jan 9 00:14:02 2023 -0500

    alpha/boot/tools/objstrip: fix the check for ELF header
    
    [ Upstream commit 1878787797cbb019eeefe6f905514dcd557302b6 ]
    
    Just memcmp() with ELFMAG - that's the normal way to do it in userland
    code, which that thing is.  Besides, that has the benefit of actually
    building - str_has_prefix() is *NOT* present in <string.h>.
    
    Fixes: 5f14596e55de "alpha: Replace strncmp with str_has_prefix"
    Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/alpha/boot/tools/objstrip.c b/arch/alpha/boot/tools/objstrip.c
index 08b430d25a315..7cf92d172dce9 100644
--- a/arch/alpha/boot/tools/objstrip.c
+++ b/arch/alpha/boot/tools/objstrip.c
@@ -148,7 +148,7 @@ main (int argc, char *argv[])
 #ifdef __ELF__
     elf = (struct elfhdr *) buf;
 
-    if (elf->e_ident[0] == 0x7f && str_has_prefix((char *)elf->e_ident + 1, "ELF")) {
+    if (memcmp(&elf->e_ident[EI_MAG0], ELFMAG, SELFMAG) == 0) {
 	if (elf->e_type != ET_EXEC) {
 	    fprintf(stderr, "%s: %s is not an ELF executable\n",
 		    prog_name, inname);



[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