Red Hat Bugzilla – Bug 229274
RHEL-3 kernel can hang while doing Sysrq on the keyboard during heavy network traffic
Last modified: 2007-11-16 20:14:46 EST
Description of problem:
The RHEL-3 kernel can hang while doing a Sysrq-? on the keyboard, while there is
heavy network traffic. Here is how to reproduce
1) Boot a single processor system with the SMP kernel (or, alternatively, boot
1) ping flood from 2 (or more) separate boxes to your victim machine
2) enable sysrq on the machine (echo 1 > /proc/sys/kernel/sysrq)
3) Press Alt-Sysrq-t repeatedly
And watch the box spin forever.
What happens is that we take the dev->xmit_lock in softirq context, to process
the incoming/outgoing network packets. However, interrupts are *not* disabled
during this time. So if you hit the Sysrq sequence while it is holding the
dev->xmit_lock, printk will be fired, which will lead to the
write_netconsole_msg() function in drivers/net/netconsole.c, which also tries to
take dev->xmit_lock, and we deadlock.
Jeff suggested that in write_netconsole_msg() we could do a spin_trylock()
and a check for xmit_owner != current_cpu, and if we don't get the lock (because
someone else is already holding it), we just drop the current packet.
Created attachment 148369 [details]
Debugging netconsole patch
For the morbidly curious, this is the patch used to show what happens when you
get into this situation.
This bug is filed against RHEL 3, which is in maintenance phase.
During the maintenance phase, only security errata and select mission
critical bug fixes will be released for enterprise products. Since
this bug does not meet that criteria, it is now being closed.
For more information of the RHEL errata support policy, please visit:
If you feel this bug is indeed mission critical, please contact your
support representative. You may be asked to provide detailed
information on how this bug is affecting you.