]> git.baikalelectronics.ru Git - kernel.git/commit
x86/hyper-v: Fix overflow bug in fill_gva_list()
authorTianyu Lan <Tianyu.Lan@microsoft.com>
Mon, 2 Sep 2019 12:41:43 +0000 (20:41 +0800)
committerIngo Molnar <mingo@kernel.org>
Mon, 2 Sep 2019 17:57:19 +0000 (19:57 +0200)
commit69cbb1fdb88b811e1b1aabf355356c204b79fb2c
tree7690ee68cc3ce82fba4c4410d601cf999b68cc72
parentafdbf0091cfff920e70d5a2997ca1545960ce70b
x86/hyper-v: Fix overflow bug in fill_gva_list()

When the 'start' parameter is >=  0xFF000000 on 32-bit
systems, or >= 0xFFFFFFFF'FF000000 on 64-bit systems,
fill_gva_list() gets into an infinite loop.

With such inputs, 'cur' overflows after adding HV_TLB_FLUSH_UNIT
and always compares as less than end.  Memory is filled with
guest virtual addresses until the system crashes.

Fix this by never incrementing 'cur' to be larger than 'end'.

Reported-by: Jong Hyun Park <park.jonghyun@yonsei.ac.kr>
Signed-off-by: Tianyu Lan <Tianyu.Lan@microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 2989934b33b2 ("x86/hyper-v: Use hypercall for remote TLB flush")
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/hyperv/mmu.c