kexec: ensure user memory sizes do not wrap
Subsystems (3)
PATCH 4/8 kexec: ensure user memory sizes do not wrap
Ensure that user memory sizes do not wrap around when validating the user input, which can lead to the following input validation working incorrectly.
Acked-by Baoquan He <[email protected]>
Reviewed-by Pratyush Anand <[email protected]>
Signed-off-by Russell King <[email protected]>
--- kernel/kexec_core.c | 2 ++ 1 file changed, 2 insertions(+)
kernel/kexec_core.c +2 -0
@@ -169,6 +169,8 @@ int sanity_check_segment_list(struct kimage *image) mstart = image->segment[i].mem; mend = mstart + image->segment[i].memsz; +if (mstart > mend) +return result;if ((mstart & ~PAGE_MASK ) || (mend & ~PAGE_MASK ))return result;if (mend >=KEXEC_DESTINATION_MEMORY_LIMIT )
Signature · 1 line
2.1.0