325cdacd03
Mike Galbraith reported a situation where a WARN_ON_ONCE() call in DRM code turned into an oops. As it turns out, WARN_ON_ONCE() seems to be completely broken when called from a module. The bug was introduced with the following commit:19d436268d
("debug: Add _ONCE() logic to report_bug()") That commit changed WARN_ON_ONCE() to move its 'once' logic into the bug trap handler. It requires a writable bug table so that the BUGFLAG_DONE bit can be written to the flags to indicate the first warning has occurred. The bug table was made writable for vmlinux, which relies on vmlinux.lds.S and vmlinux.lds.h for laying out the sections. However, it wasn't made writable for modules, which rely on the ELF section header flags. Reported-by: Mike Galbraith <efault@gmx.de> Tested-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Fixes:19d436268d
("debug: Add _ONCE() logic to report_bug()") Link: http://lkml.kernel.org/r/a53b04235a65478dd9afc51f5b329fdc65c84364.1500095401.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
38 lines
864 B
C
38 lines
864 B
C
/* MN10300 Kernel bug reporting
|
|
*
|
|
* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
|
|
* Written by David Howells (dhowells@redhat.com)
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public Licence
|
|
* as published by the Free Software Foundation; either version
|
|
* 2 of the Licence, or (at your option) any later version.
|
|
*/
|
|
#ifndef _ASM_BUG_H
|
|
#define _ASM_BUG_H
|
|
|
|
#ifdef CONFIG_BUG
|
|
|
|
/*
|
|
* Tell the user there is some problem.
|
|
*/
|
|
#define BUG() \
|
|
do { \
|
|
asm volatile( \
|
|
" syscall 15 \n" \
|
|
"0: \n" \
|
|
" .section __bug_table,\"aw\" \n" \
|
|
" .long 0b,%0,%1 \n" \
|
|
" .previous \n" \
|
|
: \
|
|
: "i"(__FILE__), "i"(__LINE__) \
|
|
); \
|
|
} while (1)
|
|
|
|
#define HAVE_ARCH_BUG
|
|
#endif /* CONFIG_BUG */
|
|
|
|
#include <asm-generic/bug.h>
|
|
|
|
#endif /* _ASM_BUG_H */
|