Patch "s390/unwind: filter out unreliable bogus %r14" has been added to the 5.4-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

    s390/unwind: filter out unreliable bogus %r14

to the 5.4-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:
     s390-unwind-filter-out-unreliable-bogus-r14.patch
and it can be found in the queue-5.4 subdirectory.

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



commit b70b34a4384918bc10a60a12d4986c446ee96a80
Author: Vasily Gorbik <gor@xxxxxxxxxxxxx>
Date:   Wed Nov 27 18:12:04 2019 +0100

    s390/unwind: filter out unreliable bogus %r14
    
    [ Upstream commit bf018ee644897d7982e1b8dd8b15e97db6e1a4da ]
    
    Currently unwinder unconditionally returns %r14 from the first frame
    pointed by %r15 from pt_regs. A task could be interrupted when a function
    already allocated this frame (if it needs it) for its callees or to
    store local variables. In that case this frame would contain random
    values from stack or values stored there by a callee. As we are only
    interested in %r14 to get potential return address, skip bogus return
    addresses which doesn't belong to kernel text.
    
    This helps to avoid duplicating filtering logic in unwider users, most
    of which use unwind_get_return_address() and would choke on bogus 0
    address returned by it otherwise.
    
    Reviewed-by: Heiko Carstens <heiko.carstens@xxxxxxxxxx>
    Signed-off-by: Vasily Gorbik <gor@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/s390/kernel/unwind_bc.c b/arch/s390/kernel/unwind_bc.c
index a8204f952315..6e609b13c0ce 100644
--- a/arch/s390/kernel/unwind_bc.c
+++ b/arch/s390/kernel/unwind_bc.c
@@ -60,6 +60,11 @@ bool unwind_next_frame(struct unwind_state *state)
 		ip = READ_ONCE_NOCHECK(sf->gprs[8]);
 		reliable = false;
 		regs = NULL;
+		if (!__kernel_text_address(ip)) {
+			/* skip bogus %r14 */
+			state->regs = NULL;
+			return unwind_next_frame(state);
+		}
 	} else {
 		sf = (struct stack_frame *) state->sp;
 		sp = READ_ONCE_NOCHECK(sf->back_chain);



[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