Commit 3fc1b11e authored by Jason A. Donenfeld's avatar Jason A. Donenfeld Committed by Jakub Kicinski

wireguard: selftests: set panic_on_warn=1 from cmdline

Rather than setting this once init is running, set panic_on_warn from
the kernel command line, so that it catches splats from WireGuard
initialization code and the various crypto selftests.
Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent a6b8ea91
...@@ -4,5 +4,5 @@ CONFIG_VIRTIO_MENU=y ...@@ -4,5 +4,5 @@ CONFIG_VIRTIO_MENU=y
CONFIG_VIRTIO_MMIO=y CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_CONSOLE=y CONFIG_VIRTIO_CONSOLE=y
CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="console=ttyAMA0 wg.success=vport0p1" CONFIG_CMDLINE="console=ttyAMA0 wg.success=vport0p1 panic_on_warn=1"
CONFIG_FRAME_WARN=1280 CONFIG_FRAME_WARN=1280
...@@ -5,5 +5,5 @@ CONFIG_VIRTIO_MENU=y ...@@ -5,5 +5,5 @@ CONFIG_VIRTIO_MENU=y
CONFIG_VIRTIO_MMIO=y CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_CONSOLE=y CONFIG_VIRTIO_CONSOLE=y
CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="console=ttyAMA0 wg.success=vport0p1" CONFIG_CMDLINE="console=ttyAMA0 wg.success=vport0p1 panic_on_warn=1"
CONFIG_FRAME_WARN=1280 CONFIG_FRAME_WARN=1280
...@@ -8,5 +8,5 @@ CONFIG_VIRTIO_MENU=y ...@@ -8,5 +8,5 @@ CONFIG_VIRTIO_MENU=y
CONFIG_VIRTIO_MMIO=y CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_CONSOLE=y CONFIG_VIRTIO_CONSOLE=y
CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="console=ttyAMA0 wg.success=vport0p1" CONFIG_CMDLINE="console=ttyAMA0 wg.success=vport0p1 panic_on_warn=1"
CONFIG_FRAME_WARN=1024 CONFIG_FRAME_WARN=1024
...@@ -8,6 +8,6 @@ CONFIG_VIRTIO_MENU=y ...@@ -8,6 +8,6 @@ CONFIG_VIRTIO_MENU=y
CONFIG_VIRTIO_MMIO=y CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_CONSOLE=y CONFIG_VIRTIO_CONSOLE=y
CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="console=ttyAMA0 wg.success=vport0p1" CONFIG_CMDLINE="console=ttyAMA0 wg.success=vport0p1 panic_on_warn=1"
CONFIG_CPU_BIG_ENDIAN=y CONFIG_CPU_BIG_ENDIAN=y
CONFIG_FRAME_WARN=1024 CONFIG_FRAME_WARN=1024
...@@ -2,5 +2,5 @@ CONFIG_ACPI=y ...@@ -2,5 +2,5 @@ CONFIG_ACPI=y
CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1" CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1 panic_on_warn=1"
CONFIG_FRAME_WARN=1024 CONFIG_FRAME_WARN=1024
...@@ -5,5 +5,5 @@ CONFIG_MAC=y ...@@ -5,5 +5,5 @@ CONFIG_MAC=y
CONFIG_SERIAL_PMACZILOG=y CONFIG_SERIAL_PMACZILOG=y
CONFIG_SERIAL_PMACZILOG_TTYS=y CONFIG_SERIAL_PMACZILOG_TTYS=y
CONFIG_SERIAL_PMACZILOG_CONSOLE=y CONFIG_SERIAL_PMACZILOG_CONSOLE=y
CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1" CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1 panic_on_warn=1"
CONFIG_FRAME_WARN=1024 CONFIG_FRAME_WARN=1024
...@@ -7,5 +7,5 @@ CONFIG_POWER_RESET_SYSCON=y ...@@ -7,5 +7,5 @@ CONFIG_POWER_RESET_SYSCON=y
CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1" CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1 panic_on_warn=1"
CONFIG_FRAME_WARN=1024 CONFIG_FRAME_WARN=1024
...@@ -10,5 +10,5 @@ CONFIG_POWER_RESET_SYSCON=y ...@@ -10,5 +10,5 @@ CONFIG_POWER_RESET_SYSCON=y
CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1" CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1 panic_on_warn=1"
CONFIG_FRAME_WARN=1280 CONFIG_FRAME_WARN=1280
...@@ -11,5 +11,5 @@ CONFIG_POWER_RESET_SYSCON=y ...@@ -11,5 +11,5 @@ CONFIG_POWER_RESET_SYSCON=y
CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1" CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1 panic_on_warn=1"
CONFIG_FRAME_WARN=1280 CONFIG_FRAME_WARN=1280
...@@ -8,5 +8,5 @@ CONFIG_POWER_RESET_SYSCON=y ...@@ -8,5 +8,5 @@ CONFIG_POWER_RESET_SYSCON=y
CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1" CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1 panic_on_warn=1"
CONFIG_FRAME_WARN=1024 CONFIG_FRAME_WARN=1024
...@@ -6,5 +6,5 @@ CONFIG_SERIAL_8250=y ...@@ -6,5 +6,5 @@ CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_MATH_EMULATION=y CONFIG_MATH_EMULATION=y
CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1" CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1 panic_on_warn=1"
CONFIG_FRAME_WARN=1024 CONFIG_FRAME_WARN=1024
...@@ -7,7 +7,7 @@ CONFIG_PPC_RADIX_MMU=y ...@@ -7,7 +7,7 @@ CONFIG_PPC_RADIX_MMU=y
CONFIG_HVC_CONSOLE=y CONFIG_HVC_CONSOLE=y
CONFIG_CPU_BIG_ENDIAN=y CONFIG_CPU_BIG_ENDIAN=y
CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="console=hvc0 wg.success=hvc1" CONFIG_CMDLINE="console=hvc0 wg.success=hvc1 panic_on_warn=1"
CONFIG_SECTION_MISMATCH_WARN_ONLY=y CONFIG_SECTION_MISMATCH_WARN_ONLY=y
CONFIG_FRAME_WARN=1280 CONFIG_FRAME_WARN=1280
CONFIG_THREAD_SHIFT=14 CONFIG_THREAD_SHIFT=14
...@@ -7,7 +7,7 @@ CONFIG_PPC_RADIX_MMU=y ...@@ -7,7 +7,7 @@ CONFIG_PPC_RADIX_MMU=y
CONFIG_HVC_CONSOLE=y CONFIG_HVC_CONSOLE=y
CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_CPU_LITTLE_ENDIAN=y
CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="console=hvc0 wg.success=hvc1" CONFIG_CMDLINE="console=hvc0 wg.success=hvc1 panic_on_warn=1"
CONFIG_SECTION_MISMATCH_WARN_ONLY=y CONFIG_SECTION_MISMATCH_WARN_ONLY=y
CONFIG_FRAME_WARN=1280 CONFIG_FRAME_WARN=1280
CONFIG_THREAD_SHIFT=14 CONFIG_THREAD_SHIFT=14
...@@ -8,5 +8,5 @@ CONFIG_SERIAL_OF_PLATFORM=y ...@@ -8,5 +8,5 @@ CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_VIRTIO_MENU=y CONFIG_VIRTIO_MENU=y
CONFIG_VIRTIO_MMIO=y CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_CONSOLE=y CONFIG_VIRTIO_CONSOLE=y
CONFIG_CMDLINE="console=ttyS0 wg.success=vport0p1" CONFIG_CMDLINE="console=ttyS0 wg.success=vport0p1 panic_on_warn=1"
CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE_FORCE=y
...@@ -8,5 +8,5 @@ CONFIG_SERIAL_OF_PLATFORM=y ...@@ -8,5 +8,5 @@ CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_VIRTIO_MENU=y CONFIG_VIRTIO_MENU=y
CONFIG_VIRTIO_MMIO=y CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_CONSOLE=y CONFIG_VIRTIO_CONSOLE=y
CONFIG_CMDLINE="console=ttyS0 wg.success=vport0p1" CONFIG_CMDLINE="console=ttyS0 wg.success=vport0p1 panic_on_warn=1"
CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE_FORCE=y
...@@ -3,4 +3,4 @@ CONFIG_SCLP_VT220_CONSOLE=y ...@@ -3,4 +3,4 @@ CONFIG_SCLP_VT220_CONSOLE=y
CONFIG_VIRTIO_MENU=y CONFIG_VIRTIO_MENU=y
CONFIG_VIRTIO_CONSOLE=y CONFIG_VIRTIO_CONSOLE=y
CONFIG_S390_GUEST=y CONFIG_S390_GUEST=y
CONFIG_CMDLINE="console=ttysclp0 wg.success=vport0p1" CONFIG_CMDLINE="console=ttysclp0 wg.success=vport0p1 panic_on_warn=1"
...@@ -2,5 +2,5 @@ CONFIG_ACPI=y ...@@ -2,5 +2,5 @@ CONFIG_ACPI=y
CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1" CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1 panic_on_warn=1"
CONFIG_FRAME_WARN=1280 CONFIG_FRAME_WARN=1280
...@@ -110,12 +110,6 @@ static void enable_logging(void) ...@@ -110,12 +110,6 @@ static void enable_logging(void)
panic("write(exception-trace)"); panic("write(exception-trace)");
close(fd); close(fd);
} }
fd = open("/proc/sys/kernel/panic_on_warn", O_WRONLY);
if (fd >= 0) {
if (write(fd, "1\n", 2) != 2)
panic("write(panic_on_warn)");
close(fd);
}
} }
static void kmod_selftests(void) static void kmod_selftests(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment