All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] bug: Fix "cut here" location for __WARN_TAINT
@ 2017-11-08  0:27 Kees Cook
  2017-11-08  0:27 ` [PATCH 1/3] lkdtm: Include WARN format string Kees Cook
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kees Cook @ 2017-11-08  0:27 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Kees Cook, Peter Zijlstra, Josh Poimboeuf, Joe Perches,
	Fengguang Wu, Arnd Bergmann, linux-am33-list, linux-kernel,
	linux-arch

Quoting the last patch in the series:

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:

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

v4.12 and later on x86:

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

With this fix:

[    9.157133] ------------[ cut here ]------------
[    9.158143] This is a warning message
[    9.159099] 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".

Fixes: 9a93848fe787 ("x86/debug: Implement __WARN() using UD0")

Thanks!

-Kees

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-08  0:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-08  0:27 [PATCH 0/3] bug: Fix "cut here" location for __WARN_TAINT Kees Cook
2017-11-08  0:27 ` [PATCH 1/3] lkdtm: Include WARN format string Kees Cook
2017-11-08  0:27 ` [PATCH 2/3] bug: Define the "cut here" string in a single place Kees Cook
2017-11-08  0:27 ` [PATCH 3/3] bug: Fix "cut here" location for __WARN_TAINT architectures Kees Cook

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.