1
0
Fork 0
alistair23-linux/include
Kees Cook a44f71a9ab bug: move WARN_ON() "cut here" into exception handler
The original clean up of "cut here" missed the WARN_ON() case (that does
not have a printk message), which was fixed recently by adding an explicit
printk of "cut here".  This had the downside of adding a printk() to every
WARN_ON() caller, which reduces the utility of using an instruction
exception to streamline the resulting code.  By making this a new BUGFLAG,
all of these can be removed and "cut here" can be handled by the exception
handler.

This was very pronounced on PowerPC, but the effect can be seen on x86 as
well.  The resulting text size of a defconfig build shows some small
savings from this patch:

   text    data     bss     dec     hex filename
19691167        5134320 1646664 26472151        193eed7 vmlinux.before
19676362        5134260 1663048 26473670        193f4c6 vmlinux.after

This change also opens the door for creating something like BUG_MSG(),
where a custom printk() before issuing BUG(), without confusing the "cut
here" line.

Link: http://lkml.kernel.org/r/201908200943.601DD59DCE@keescook
Fixes: 6b15f678fb ("include/asm-generic/bug.h: fix "cut here" for WARN_ON for __WARN_TAINT architectures")
Signed-off-by: Kees Cook <keescook@chromium.org>
Reported-by: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Drew Davenport <ddavenport@chromium.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Cc: Feng Tang <feng.tang@intel.com>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-09-25 17:51:41 -07:00
..
acpi ACPI updates for 5.4-rc1 2019-09-17 19:31:36 -07:00
asm-generic bug: move WARN_ON() "cut here" into exception handler 2019-09-25 17:51:41 -07:00
clocksource clocksource/drivers/hyperv: Enable TSC page clocksource on 32bit 2019-08-23 16:59:54 +02:00
crypto crypto: skcipher - add the ability to abort a skcipher walk 2019-09-09 17:35:38 +10:00
drm drm/shmem: Use mutex_trylock in drm_gem_shmem_purge 2019-08-28 10:02:39 -05:00
dt-bindings Main MIPS changes for v5.4: 2019-09-22 09:30:30 -07:00
keys
kvm KVM: arm/arm64: vgic: Use a single IO device per redistributor 2019-08-25 11:02:52 +01:00
linux kgdb: don't use a notifier to enter kgdb at panic; call directly 2019-09-25 17:51:40 -07:00
math-emu nds32: Mark expected switch fall-throughs 2019-08-29 11:06:56 -05:00
media media: v4l2-core: introduce a helper to unregister a i2c subdev 2019-08-26 10:52:06 -03:00
misc auxdisplay: charlcd: move charlcd.h to drivers/auxdisplay 2019-08-08 19:59:17 +02:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2019-09-18 12:34:53 -07:00
pcmcia
ras
rdma RDMA subsystem updates for 5.4 2019-09-21 10:26:24 -07:00
scsi SCSI misc on 20190919 2019-09-21 10:50:15 -07:00
soc Char/Misc driver patches for 5.4-rc1 2019-09-18 11:14:31 -07:00
sound ASoC: Updates for v5.4 2019-09-10 13:03:08 +02:00
target
trace include/trace/events/writeback.h: fix -Wstringop-truncation warnings 2019-09-25 17:51:39 -07:00
uapi linux/coff.h: add include guard 2019-09-25 17:51:39 -07:00
vdso
video fbdev: da8xx: remove panel_power_ctrl() callback from platform data 2019-08-26 17:53:58 +05:30
xen swiotlb-xen: simplify cache maintainance 2019-09-11 12:43:27 +02:00
Kbuild - New Drivers 2019-09-23 19:37:49 -07:00