Bug 141996 - CAN-2004-1237 instant kernel panic from one line perl program - BAD
Summary: CAN-2004-1237 instant kernel panic from one line perl program - BAD
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel
Version: 3.0
Hardware: i686
OS: Linux
medium
high
Target Milestone: ---
Assignee: Peter Martuccelli
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-12-06 16:51 UTC by ara howard
Modified: 2007-11-30 22:07 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-12-07 21:28:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2005:043 0 normal SHIPPED_LIVE Important: kernel security update 2005-01-18 05:00:00 UTC

Description ara howard 2004-12-06 16:51:39 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1)
Gecko/20030225

Description of problem:
certain perl constructs (well, underlying system calls i'm sure) can
easily cause kernel panic when run under cron but NOT when run from
the command line.  this type of kernel panic is, of course, extremely
difficult to trace.

Version-Release number of selected component (if applicable):
Linux 2.4.21-20.EL i68

How reproducible:
Always

Steps to Reproduce:
1. create the following perl script as $HOME/kernel_panic.pl:

  #!/usr/bin/perl
  open ('kerel_panic');

obviously make this file executable

2. add a crontab line similar to following to run this program

  * * * * * $HOME/kernel_panic.pl


3. sit back and watch a userland crontab entry not only panic the
kernel, but make it almost impossible to reboot and, therefore, debug.
    

btw.  i'd reccomend cron'ing the above at a specific time so as NOT to
 render your machine useless

Actual Results:  instant kernel panic

Expected Results:  nothing - the file does not exist so the program
should have simply failed. 

Additional info:

note that this use of open in perl is not that common

  open 'file'

normally you'd see

  open FILE, '< file'

or something.  however this shoud NOT panic the kernel!

Comment 1 Ernie Petrides 2004-12-07 00:08:47 UTC
I reproduced this crash under 2.4.21-27.EL (U4) by queuing the cron job
using the "crontab -u $user -l" command (and waiting for the minute to
roll over).  The oops is in the "audit" module at __audit_get_target+0x1ee.
The logical bottom-of-stack is syscall_trace_leave+0x58.


Comment 2 Ernie Petrides 2004-12-07 00:29:07 UTC
If you don't heed the advice of scheduling the cron job for a specific
time (for a "one-shot" run), then your test system will continue to panic
during each reboot.  In order to recover, boot with "init=/bin/bash" added
to the kernel args, use "fsck" to fix up file systems, remount the root
file system (presuming it contains /var) read-write (with the command
"mount -n -o remount,rw /"), and then run "crontab -u $user -r"
to recover (and then reboot).


Comment 3 Ernie Petrides 2004-12-07 21:24:02 UTC
The oops would be from EIP __audit_get_target+0x1f6 in a Beehive-built
kernel.  The +0x1ee offset I wrote in comment #1 was from a test build
using my local (older) compiler.


Comment 4 Ernie Petrides 2004-12-07 21:28:59 UTC
A fix for this problem has already been committed to the RHEL3 U5
patch pool on 15-Nov-2004 (in kernel version 2.4.21-25.1.EL).

To work around this problem before U5 is released (a few months
from now), please disable auditing with the following commands:

    chkconfig audit off
    service audit stop


*** This bug has been marked as a duplicate of 132245 ***

Comment 5 Peter Martuccelli 2005-01-04 18:09:05 UTC
*** Bug 143866 has been marked as a duplicate of this bug. ***

Comment 6 David Lawrence 2005-01-18 23:52:35 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2005-043.html



Note You need to log in before you can comment on or make changes to this bug.