mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-20 18:27:59 +07:00
9e3961a097
There have been several times where I have had to rebuild a kernel to cause a panic when hitting a WARN() in the code in order to get a crash dump from a system. Sometimes this is easy to do, other times (such as in the case of a remote admin) it is not trivial to send new images to the user. A much easier method would be a switch to change the WARN() over to a panic. This makes debugging easier in that I can now test the actual image the WARN() was seen on and I do not have to engage in remote debugging. This patch adds a panic_on_warn kernel parameter and /proc/sys/kernel/panic_on_warn calls panic() in the warn_slowpath_common() path. The function will still print out the location of the warning. An example of the panic_on_warn output: The first line below is from the WARN_ON() to output the WARN_ON()'s location. After that the panic() output is displayed. WARNING: CPU: 30 PID: 11698 at /home/prarit/dummy_module/dummy-module.c:25 init_dummy+0x1f/0x30 [dummy_module]() Kernel panic - not syncing: panic_on_warn set ... CPU: 30 PID: 11698 Comm: insmod Tainted: G W OE 3.17.0+ #57 Hardware name: Intel Corporation S2600CP/S2600CP, BIOS RMLSDP.86I.00.29.D696.1311111329 11/11/2013 0000000000000000 000000008e3f87df ffff88080f093c38 ffffffff81665190 0000000000000000 ffffffff818aea3d ffff88080f093cb8 ffffffff8165e2ec ffffffff00000008 ffff88080f093cc8 ffff88080f093c68 000000008e3f87df Call Trace: [<ffffffff81665190>] dump_stack+0x46/0x58 [<ffffffff8165e2ec>] panic+0xd0/0x204 [<ffffffffa038e05f>] ? init_dummy+0x1f/0x30 [dummy_module] [<ffffffff81076b90>] warn_slowpath_common+0xd0/0xd0 [<ffffffffa038e040>] ? dummy_greetings+0x40/0x40 [dummy_module] [<ffffffff81076c8a>] warn_slowpath_null+0x1a/0x20 [<ffffffffa038e05f>] init_dummy+0x1f/0x30 [dummy_module] [<ffffffff81002144>] do_one_initcall+0xd4/0x210 [<ffffffff811b52c2>] ? __vunmap+0xc2/0x110 [<ffffffff810f8889>] load_module+0x16a9/0x1b30 [<ffffffff810f3d30>] ? store_uevent+0x70/0x70 [<ffffffff810f49b9>] ? copy_module_from_fd.isra.44+0x129/0x180 [<ffffffff810f8ec6>] SyS_finit_module+0xa6/0xd0 [<ffffffff8166cf29>] system_call_fastpath+0x12/0x17 Successfully tested by me. hpa said: There is another very valid use for this: many operators would rather a machine shuts down than being potentially compromised either functionally or security-wise. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Acked-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Cc: Fabian Frederick <fabf@skynet.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> |
||
---|---|---|
.. | ||
byteorder | ||
caif | ||
can | ||
cifs | ||
dvb | ||
genwqe | ||
hdlc | ||
hsi | ||
isdn | ||
mmc | ||
netfilter | ||
netfilter_arp | ||
netfilter_bridge | ||
netfilter_ipv4 | ||
netfilter_ipv6 | ||
nfsd | ||
raid | ||
spi | ||
sunrpc | ||
tc_act | ||
tc_ematch | ||
usb | ||
wimax | ||
a.out.h | ||
acct.h | ||
adb.h | ||
adfs_fs.h | ||
affs_hardblocks.h | ||
agpgart.h | ||
aio_abi.h | ||
apm_bios.h | ||
arcfb.h | ||
atalk.h | ||
atm_eni.h | ||
atm_he.h | ||
atm_idt77105.h | ||
atm_nicstar.h | ||
atm_tcp.h | ||
atm_zatm.h | ||
atm.h | ||
atmapi.h | ||
atmarp.h | ||
atmbr2684.h | ||
atmclip.h | ||
atmdev.h | ||
atmioc.h | ||
atmlec.h | ||
atmmpc.h | ||
atmppp.h | ||
atmsap.h | ||
atmsvc.h | ||
audit.h | ||
auto_fs4.h | ||
auto_fs.h | ||
auxvec.h | ||
ax25.h | ||
b1lli.h | ||
baycom.h | ||
bcache.h | ||
bcm933xx_hcs.h | ||
bfs_fs.h | ||
binfmts.h | ||
blkpg.h | ||
blktrace_api.h | ||
bpf_common.h | ||
bpf.h | ||
bpqether.h | ||
bsg.h | ||
btrfs.h | ||
can.h | ||
capability.h | ||
capi.h | ||
cciss_defs.h | ||
cciss_ioctl.h | ||
cdrom.h | ||
cgroupstats.h | ||
chio.h | ||
cm4000_cs.h | ||
cn_proc.h | ||
coda_psdev.h | ||
coda.h | ||
coff.h | ||
connector.h | ||
const.h | ||
cramfs_fs.h | ||
cuda.h | ||
cyclades.h | ||
cycx_cfm.h | ||
dcbnl.h | ||
dccp.h | ||
dlm_device.h | ||
dlm_netlink.h | ||
dlm_plock.h | ||
dlm.h | ||
dlmconstants.h | ||
dm-ioctl.h | ||
dm-log-userspace.h | ||
dn.h | ||
dqblk_xfs.h | ||
edd.h | ||
efs_fs_sb.h | ||
elf-em.h | ||
elf-fdpic.h | ||
elf.h | ||
elfcore.h | ||
errno.h | ||
errqueue.h | ||
ethtool.h | ||
eventpoll.h | ||
fadvise.h | ||
falloc.h | ||
fanotify.h | ||
fb.h | ||
fcntl.h | ||
fd.h | ||
fdreg.h | ||
fib_rules.h | ||
fiemap.h | ||
filter.h | ||
firewire-cdev.h | ||
firewire-constants.h | ||
flat.h | ||
fou.h | ||
fs.h | ||
fsl_hypervisor.h | ||
fuse.h | ||
futex.h | ||
gameport.h | ||
gen_stats.h | ||
genetlink.h | ||
gfs2_ondisk.h | ||
gigaset_dev.h | ||
hash_info.h | ||
hdlc.h | ||
hdlcdrv.h | ||
hdreg.h | ||
hid.h | ||
hiddev.h | ||
hidraw.h | ||
hpet.h | ||
hsr_netlink.h | ||
hw_breakpoint.h | ||
hyperv.h | ||
hysdn_if.h | ||
i2c-dev.h | ||
i2c.h | ||
i2o-dev.h | ||
i8k.h | ||
icmp.h | ||
icmpv6.h | ||
if_addr.h | ||
if_addrlabel.h | ||
if_alg.h | ||
if_arcnet.h | ||
if_arp.h | ||
if_bonding.h | ||
if_bridge.h | ||
if_cablemodem.h | ||
if_eql.h | ||
if_ether.h | ||
if_fc.h | ||
if_fddi.h | ||
if_frad.h | ||
if_hippi.h | ||
if_infiniband.h | ||
if_link.h | ||
if_ltalk.h | ||
if_packet.h | ||
if_phonet.h | ||
if_plip.h | ||
if_ppp.h | ||
if_pppol2tp.h | ||
if_pppox.h | ||
if_slip.h | ||
if_team.h | ||
if_tun.h | ||
if_tunnel.h | ||
if_vlan.h | ||
if_x25.h | ||
if.h | ||
igmp.h | ||
in6.h | ||
in_route.h | ||
in.h | ||
inet_diag.h | ||
inotify.h | ||
input.h | ||
ioctl.h | ||
ip6_tunnel.h | ||
ip_vs.h | ||
ip.h | ||
ipc.h | ||
ipmi_msgdefs.h | ||
ipmi.h | ||
ipsec.h | ||
ipv6_route.h | ||
ipv6.h | ||
ipx.h | ||
irda.h | ||
irqnr.h | ||
isdn_divertif.h | ||
isdn_ppp.h | ||
isdn.h | ||
isdnif.h | ||
iso_fs.h | ||
ivtv.h | ||
ivtvfb.h | ||
ixjuser.h | ||
jffs2.h | ||
joystick.h | ||
Kbuild | ||
kd.h | ||
kdev_t.h | ||
kernel-page-flags.h | ||
kernel.h | ||
kernelcapi.h | ||
kexec.h | ||
keyboard.h | ||
keyctl.h | ||
kvm_para.h | ||
kvm.h | ||
l2tp.h | ||
libc-compat.h | ||
limits.h | ||
llc.h | ||
loop.h | ||
lp.h | ||
magic.h | ||
major.h | ||
map_to_7segment.h | ||
matroxfb.h | ||
mdio.h | ||
media.h | ||
mei.h | ||
memfd.h | ||
mempolicy.h | ||
meye.h | ||
mic_common.h | ||
mic_ioctl.h | ||
mii.h | ||
minix_fs.h | ||
mman.h | ||
mmtimer.h | ||
module.h | ||
mpls.h | ||
mqueue.h | ||
mroute6.h | ||
mroute.h | ||
msdos_fs.h | ||
msg.h | ||
mtio.h | ||
n_r3964.h | ||
nbd.h | ||
ncp_fs.h | ||
ncp_mount.h | ||
ncp_no.h | ||
ncp.h | ||
neighbour.h | ||
net_dropmon.h | ||
net_tstamp.h | ||
net.h | ||
netconf.h | ||
netdevice.h | ||
netfilter_arp.h | ||
netfilter_bridge.h | ||
netfilter_decnet.h | ||
netfilter_ipv4.h | ||
netfilter_ipv6.h | ||
netfilter.h | ||
netlink_diag.h | ||
netlink.h | ||
netrom.h | ||
nfc.h | ||
nfs2.h | ||
nfs3.h | ||
nfs4_mount.h | ||
nfs4.h | ||
nfs_fs.h | ||
nfs_idmap.h | ||
nfs_mount.h | ||
nfs.h | ||
nfsacl.h | ||
nl80211.h | ||
nubus.h | ||
nvme.h | ||
nvram.h | ||
omap3isp.h | ||
omapfb.h | ||
oom.h | ||
openvswitch.h | ||
packet_diag.h | ||
param.h | ||
parport.h | ||
patchkey.h | ||
pci_regs.h | ||
pci.h | ||
perf_event.h | ||
personality.h | ||
pfkeyv2.h | ||
pg.h | ||
phantom.h | ||
phonet.h | ||
pkt_cls.h | ||
pkt_sched.h | ||
pktcdvd.h | ||
pmu.h | ||
poll.h | ||
posix_types.h | ||
ppdev.h | ||
ppp_defs.h | ||
ppp-comp.h | ||
ppp-ioctl.h | ||
pps.h | ||
prctl.h | ||
psci.h | ||
ptp_clock.h | ||
ptrace.h | ||
qnx4_fs.h | ||
qnxtypes.h | ||
quota.h | ||
radeonfb.h | ||
random.h | ||
raw.h | ||
rds.h | ||
reboot.h | ||
reiserfs_fs.h | ||
reiserfs_xattr.h | ||
resource.h | ||
rfkill.h | ||
romfs_fs.h | ||
rose.h | ||
route.h | ||
rtc.h | ||
rtnetlink.h | ||
scc.h | ||
sched.h | ||
screen_info.h | ||
sctp.h | ||
sdla.h | ||
seccomp.h | ||
securebits.h | ||
selinux_netlink.h | ||
sem.h | ||
serial_core.h | ||
serial_reg.h | ||
serial.h | ||
serio.h | ||
shm.h | ||
signal.h | ||
signalfd.h | ||
smiapp.h | ||
snmp.h | ||
sock_diag.h | ||
socket.h | ||
sockios.h | ||
som.h | ||
sonet.h | ||
sonypi.h | ||
sound.h | ||
soundcard.h | ||
stat.h | ||
stddef.h | ||
string.h | ||
suspend_ioctls.h | ||
swab.h | ||
synclink.h | ||
sysctl.h | ||
sysinfo.h | ||
target_core_user.h | ||
taskstats.h | ||
tcp_metrics.h | ||
tcp.h | ||
telephony.h | ||
termios.h | ||
time.h | ||
times.h | ||
timex.h | ||
tiocl.h | ||
tipc_config.h | ||
tipc.h | ||
toshiba.h | ||
tty_flags.h | ||
tty.h | ||
types.h | ||
udf_fs_i.h | ||
udp.h | ||
uhid.h | ||
uinput.h | ||
uio.h | ||
ultrasound.h | ||
un.h | ||
unistd.h | ||
unix_diag.h | ||
usbdevice_fs.h | ||
usbip.h | ||
utime.h | ||
utsname.h | ||
uuid.h | ||
uvcvideo.h | ||
v4l2-common.h | ||
v4l2-controls.h | ||
v4l2-dv-timings.h | ||
v4l2-mediabus.h | ||
v4l2-subdev.h | ||
veth.h | ||
vfio.h | ||
vhost.h | ||
videodev2.h | ||
virtio_9p.h | ||
virtio_balloon.h | ||
virtio_blk.h | ||
virtio_config.h | ||
virtio_console.h | ||
virtio_ids.h | ||
virtio_net.h | ||
virtio_pci.h | ||
virtio_ring.h | ||
virtio_rng.h | ||
vm_sockets.h | ||
vsp1.h | ||
vt.h | ||
wait.h | ||
wanrouter.h | ||
watchdog.h | ||
wil6210_uapi.h | ||
wimax.h | ||
wireless.h | ||
x25.h | ||
xattr.h | ||
xfrm.h | ||
zorro_ids.h | ||
zorro.h |