Patch "objtool: Fix noreturn detection for ignored functions" has been added to the 4.14-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

    objtool: Fix noreturn detection for ignored functions

to the 4.14-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:
     objtool-fix-noreturn-detection-for-ignored-functions.patch
and it can be found in the queue-4.14 subdirectory.

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



commit 7dd971d22ed262952967151a08ef9295718d4e05
Author: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
Date:   Thu Sep 10 10:24:57 2020 -0500

    objtool: Fix noreturn detection for ignored functions
    
    [ Upstream commit db6c6a0df840e3f52c84cc302cc1a08ba11a4416 ]
    
    When a function is annotated with STACK_FRAME_NON_STANDARD, objtool
    doesn't validate its code paths.  It also skips sibling call detection
    within the function.
    
    But sibling call detection is actually needed for the case where the
    ignored function doesn't have any return instructions.  Otherwise
    objtool naively marks the function as implicit static noreturn, which
    affects the reachability of its callers, resulting in "unreachable
    instruction" warnings.
    
    Fix it by just enabling sibling call detection for ignored functions.
    The 'insn->ignore' check in add_jump_destinations() is no longer needed
    after
    
      e6da9567959e ("objtool: Don't use ignore flag for fake jumps").
    
    Fixes the following warning:
    
      arch/x86/kvm/vmx/vmx.o: warning: objtool: vmx_handle_exit_irqoff()+0x142: unreachable instruction
    
    which triggers on an allmodconfig with CONFIG_GCOV_KERNEL unset.
    
    Reported-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
    Signed-off-by: Borislav Petkov <bp@xxxxxxx>
    Acked-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
    Link: https://lkml.kernel.org/r/5b1e2536cdbaa5246b60d7791b76130a74082c62.1599751464.git.jpoimboe@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 247fbb5f6a389..2c8e2dae17016 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -502,7 +502,7 @@ static int add_jump_destinations(struct objtool_file *file)
 		    insn->type != INSN_JUMP_UNCONDITIONAL)
 			continue;
 
-		if (insn->ignore || insn->offset == FAKE_JUMP_OFFSET)
+		if (insn->offset == FAKE_JUMP_OFFSET)
 			continue;
 
 		rela = find_rela_by_dest_range(insn->sec, insn->offset,



[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