WSL2-Linux-Kernel/include
Kees Cook a7bed27af1 bug: fix "cut here" location for __WARN_TAINT architectures
Prior to v4.11, x86 used warn_slowpath_fmt() for handling WARN()s.
After WARN() was moved to using UD0 on x86, the warning text started
appearing _before_ the "cut here" line.  This appears to have been a
long-standing bug on architectures that used __WARN_TAINT, but it didn't
get fixed.

v4.11 and earlier on x86:

  ------------[ cut here ]------------
  WARNING: CPU: 0 PID: 2956 at drivers/misc/lkdtm_bugs.c:65 lkdtm_WARNING+0x21/0x30
  This is a warning message
  Modules linked in:

v4.12 and later on x86:

  This is a warning message
  ------------[ cut here ]------------
  WARNING: CPU: 1 PID: 2982 at drivers/misc/lkdtm_bugs.c:68 lkdtm_WARNING+0x15/0x20
  Modules linked in:

With this fix:

  ------------[ cut here ]------------
  This is a warning message
  WARNING: CPU: 3 PID: 3009 at drivers/misc/lkdtm_bugs.c:67 lkdtm_WARNING+0x15/0x20

Since the __FILE__ reporting happens as part of the UD0 handler, it
isn't trivial to move the message to after the WARNING line, but at
least we can fix the position of the "cut here" line so all the various
logging tools will start including the actual runtime warning message
again, when they follow the instruction and "cut here".

Link: http://lkml.kernel.org/r/1510100869-73751-4-git-send-email-keescook@chromium.org
Fixes: 9a93848fe7 ("x86/debug: Implement __WARN() using UD0")
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-11-17 16:10:01 -08:00
..
acpi TTY/Serial patches for 4.15-rc1 2017-11-13 21:05:31 -08:00
asm-generic bug: fix "cut here" location for __WARN_TAINT architectures 2017-11-17 16:10:01 -08:00
clocksource arm64 updates for 4.15 2017-11-15 10:56:56 -08:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2017-11-14 10:52:09 -08:00
drm main drm pull request for v4.15 2017-11-15 20:42:10 -08:00
dt-bindings ARM: SoC driver updates for v4.15 2017-11-16 16:05:01 -08:00
keys License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kvm KVM: arm/arm64: Rework kvm_timer_should_fire 2017-11-06 16:23:17 +01:00
lib
linux iopoll: avoid -Wint-in-bool-context warning 2017-11-17 16:10:01 -08:00
math-emu
media media updates for v4.15-rc1 2017-11-15 20:30:12 -08:00
memory
misc
net Merge branch 'akpm' (patches from Andrew) 2017-11-15 19:42:40 -08:00
pcmcia
ras License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rdma Updates for 4.15 kernel merge window 2017-11-15 14:54:53 -08:00
scsi SCSI misc on 20171114 2017-11-14 16:23:44 -08:00
soc
sound ASoC: Updates for v4.15 2017-11-13 15:45:57 +01:00
target A couple of configfs cleanups: 2017-11-14 14:44:04 -08:00
trace libnvdimm for 4.15 2017-11-17 09:51:57 -08:00
uapi libnvdimm for 4.15 2017-11-17 09:51:57 -08:00
video License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xen xen: features and fixes for v4.15-rc1 2017-11-16 13:06:27 -08:00