Patch "parisc: Avoid calling faulthandler_disabled() twice" has been added to the 5.15-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

    parisc: Avoid calling faulthandler_disabled() twice

to the 5.15-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:
     parisc-avoid-calling-faulthandler_disabled-twice.patch
and it can be found in the queue-5.15 subdirectory.

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



commit fa2324b2cae276f52b2836c241ea56d03a82b0f2
Author: John David Anglin <dave.anglin@xxxxxxxx>
Date:   Wed Dec 22 16:52:26 2021 +0000

    parisc: Avoid calling faulthandler_disabled() twice
    
    [ Upstream commit 9e9d4b460f23bab61672eae397417d03917d116c ]
    
    In handle_interruption(), we call faulthandler_disabled() to check whether the
    fault handler is not disabled. If the fault handler is disabled, we immediately
    call do_page_fault(). It then calls faulthandler_disabled(). If disabled,
    do_page_fault() attempts to fixup the exception by jumping to no_context:
    
    no_context:
    
            if (!user_mode(regs) && fixup_exception(regs)) {
                    return;
            }
    
            parisc_terminate("Bad Address (null pointer deref?)", regs, code, address);
    
    Apart from the error messages, the two blocks of code perform the same
    function.
    
    We can avoid two calls to faulthandler_disabled() by a simple revision
    to the code in handle_interruption().
    
    Note: I didn't try to fix the formatting of this code block.
    
    Signed-off-by: John David Anglin <dave.anglin@xxxxxxxx>
    Signed-off-by: Helge Deller <deller@xxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index 197cb8480350c..afe8b902a8fc4 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -784,7 +784,7 @@ void notrace handle_interruption(int code, struct pt_regs *regs)
 	     * unless pagefault_disable() was called before.
 	     */
 
-	    if (fault_space == 0 && !faulthandler_disabled())
+	    if (faulthandler_disabled() || fault_space == 0)
 	    {
 		/* Clean up and return if in exception table. */
 		if (fixup_exception(regs))



[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