]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
x86/syscall: Sanitize syscall table de-references under speculation
authorDan Williams <dan.j.williams@intel.com>
Tue, 30 Jan 2018 01:02:59 +0000 (17:02 -0800)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 8 Feb 2018 03:08:35 +0000 (21:08 -0600)
commit1d4e863b69ae63992f1971e835add427ccc4499a
tree9f216a49f9a4c9c17ecc885685819833caf875d1
parent92456c2531e341ed3aa78333916665f694590386
x86/syscall: Sanitize syscall table de-references under speculation

BugLink: http://bugs.launchpad.net/bugs/1748072
commit 2fbd7af5af8665d18bcefae3e9700be07e22b681

The syscall table base is a user controlled function pointer in kernel
space. Use array_index_nospec() to prevent any out of bounds speculation.

While retpoline prevents speculating into a userspace directed target it
does not stop the pointer de-reference, the concern is leaking memory
relative to the syscall table base, by observing instruction cache
behavior.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-arch@vger.kernel.org
Cc: kernel-hardening@lists.openwall.com
Cc: gregkh@linuxfoundation.org
Cc: Andy Lutomirski <luto@kernel.org>
Cc: alan@linux.intel.com
Link: https://lkml.kernel.org/r/151727417984.33451.1216731042505722161.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
arch/x86/entry/common.c