summaryrefslogtreecommitdiffstats
path: root/kernel/kexec_file.c
diff options
context:
space:
mode:
authorYuntao Wang <ytcoode@gmail.com>2023-12-17 11:35:26 +0800
committerAndrew Morton <akpm@linux-foundation.org>2023-12-29 12:22:25 -0800
commit816d334afa85c836080b41bb6238aea845615ad9 (patch)
treecb7d14fad85392bf6a2f319498ad9594d04edbe3 /kernel/kexec_file.c
parent5c28913ed04b29efb75c4ddd6a13469952351858 (diff)
downloadlinux-stable-816d334afa85c836080b41bb6238aea845615ad9.tar.gz
linux-stable-816d334afa85c836080b41bb6238aea845615ad9.tar.bz2
linux-stable-816d334afa85c836080b41bb6238aea845615ad9.zip
kexec: modify the meaning of the end parameter in kimage_is_destination_range()
The end parameter received by kimage_is_destination_range() should be the last valid byte address of the target memory segment plus 1. However, in the locate_mem_hole_bottom_up() and locate_mem_hole_top_down() functions, the corresponding value passed to kimage_is_destination_range() is the last valid byte address of the target memory segment, which is 1 less. There are two ways to fix this bug. We can either correct the logic of the locate_mem_hole_bottom_up() and locate_mem_hole_top_down() functions, or we can fix kimage_is_destination_range() by making the end parameter represent the last valid byte address of the target memory segment. Here, we choose the second approach. Due to the modification to kimage_is_destination_range(), we also need to adjust its callers, such as kimage_alloc_normal_control_pages() and kimage_alloc_page(). Link: https://lkml.kernel.org/r/20231217033528.303333-2-ytcoode@gmail.com Signed-off-by: Yuntao Wang <ytcoode@gmail.com> Acked-by: Baoquan He <bhe@redhat.com> Cc: Borislav Petkov (AMD) <bp@alien8.de> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'kernel/kexec_file.c')
0 files changed, 0 insertions, 0 deletions