Patch "efi/unaccepted: Fix off-by-one when checking for overlapping ranges" has been added to the 6.6-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

    efi/unaccepted: Fix off-by-one when checking for overlapping ranges

to the 6.6-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:
     efi-unaccepted-fix-off-by-one-when-checking-for-over.patch
and it can be found in the queue-6.6 subdirectory.

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



commit 3109302956a3531f571abfba69eebe93f5f6f8c7
Author: Michael Roth <michael.roth@xxxxxxx>
Date:   Fri Nov 3 10:13:54 2023 -0500

    efi/unaccepted: Fix off-by-one when checking for overlapping ranges
    
    [ Upstream commit 01b1e3ca0e5ce47bbae8217d47376ad01b331b07 ]
    
    When a task needs to accept memory it will scan the accepting_list
    to see if any ranges already being processed by other tasks overlap
    with its range. Due to an off-by-one in the range comparisons, a task
    might falsely determine that an overlapping range is being accepted,
    leading to an unnecessary delay before it begins processing the range.
    
    Fix the off-by-one in the range comparison to prevent this and slightly
    improve performance.
    
    Fixes: 50e782a86c98 ("efi/unaccepted: Fix soft lockups caused by parallel memory acceptance")
    Link: https://lore.kernel.org/linux-mm/20231101004523.vseyi5bezgfaht5i@xxxxxxx/T/#me2eceb9906fcae5fe958b3fe88e41f920f8335b6
    Reviewed-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
    Signed-off-by: Michael Roth <michael.roth@xxxxxxx>
    Acked-by: Vlastimil Babka <vbabka@xxxxxxx>
    Signed-off-by: Ard Biesheuvel <ardb@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/firmware/efi/unaccepted_memory.c b/drivers/firmware/efi/unaccepted_memory.c
index 135278ddaf627..79fb687bb90f9 100644
--- a/drivers/firmware/efi/unaccepted_memory.c
+++ b/drivers/firmware/efi/unaccepted_memory.c
@@ -100,7 +100,7 @@ void accept_memory(phys_addr_t start, phys_addr_t end)
 	 * overlap on physical address level.
 	 */
 	list_for_each_entry(entry, &accepting_list, list) {
-		if (entry->end < range.start)
+		if (entry->end <= range.start)
 			continue;
 		if (entry->start >= range.end)
 			continue;



[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