]> git.baikalelectronics.ru Git - kernel.git/commit
x86/mtrr: Don't copy out-of-bounds data in mtrr_write
authorJann Horn <jannh@google.com>
Fri, 6 Jul 2018 21:50:03 +0000 (23:50 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 7 Jul 2018 16:58:41 +0000 (18:58 +0200)
commit6ae65508730e422b3e580ab08e8d862fdbdb3b35
treeab9a3489acdac58d266366cb4539db6a8ca269e7
parent2979e5f2b33b4b032ec7935890474acb75a26ee7
x86/mtrr: Don't copy out-of-bounds data in mtrr_write

Don't access the provided buffer out of bounds - this can cause a kernel
out-of-bounds read when invoked through sys_splice() or other things that
use kernel_write()/__kernel_write().

Fixes: a2689a226837 ("x86/mtrr: Convert to use strncpy_from_user() helper")
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20180706215003.156702-1-jannh@google.com
arch/x86/kernel/cpu/mtrr/if.c