System panics if compact flash card is removed from IDE card reader without unmounting it first in RHEL5

Solution Unverified - Updated -

Issue

  • Kernel panic in ide_disk_remove if compact flash card is removed from IDE card reader without first unmounting it
  • System will pass to ‘kernel panic’ state if user remove CF card from device and forgets demount device.
  • If user does following actions operational system will pass to ‘kernel panic’ state:
  1. Insert device
  2. Mount device under root user (mount /dev/hdc1 /mnt/cf/)
  3. Remove device (without umount)
  4. Insert device again
  5. Unmount device under root user (umount /mnt/cf/)
  6. Remove device

    BUG: unable to handle kernel NULL pointer dereference at virtual address 00000004
     printing eip:
    c0568601
    *pde = 52b24067
    Oops: 0000 [#1]
    SMP 
    last sysfs file: /block/hdc/size
    Modules
    linked in: vfat fat ipt_DSCP xt_MARK xt_mark nls_utf8 loop cppmNmi(U)
    cppmLed(U) cppmGpio(U) adm1021 hwmon i2c_dev tcp_westwood mercury(U)
    ipv6 xt_tcpudp xt_comment xt_state iptable_filter iptable_mangle
    iptable_nat ip_nat ip_conntrack nfnetlink ip_tables x_tables dm_mirror
    dm_mod parport_pc lp parport e1000 i2c_i801 e100 mii pcspkr ide_cs
    i2c_core ata_piix libata sd_mod scsi_mod ext3 jbd ehci_hcd ohci_hcd
    uhci_hcd
    CPU:    0
    EIP:    0060:[<c0568601>]    Not tainted VLI
    EFLAGS: 00010286   (2.6.18-53.el5 #1) 
    EIP is at ide_disk_remove+0x8/0x2b
    eax: c07c1294   ebx: c07c1294   ecx: c07c1340   edx: c05685f9
    esi: 00000000   edi: c0692adc   ebp: c07c17cc   esp: f7c32e84
    ds: 007b   es: 007b   ss: 0068
    Process pccardd (pid: 249, ti=f7c32000 task=f7c30aa0 task.ti=f7c32000)
    Stack: c07c13b8 c07c1340 c0692adc c055df5a c054bc9e c07c1340 c07c1340 c0692480 
           c054be98 00000050 c054b67b c07c1340 c07c1340 00000000 c054a7db c07c1340 
           c07c1200 00000000 00000001 c054a829 c07c1280 c055e93c f793e940 ca33d000 
    Call Trace:
     [<c055df5a>] generic_ide_remove+0x1a/0x1d
     [<c054bc9e>] __device_release_driver+0x5a/0x79
     [<c054be98>] device_release_driver+0x1c/0x2b
     [<c054b67b>] bus_remove_device+0x78/0x8a
     [<c054a7db>] device_del+0xe9/0x12f
     [<c054a829>] device_unregister+0x8/0x10
     [<c055e93c>] ide_unregister+0x91/0x554
     [<f8832018>] ide_release+0x18/0x28 [ide_cs]
     [<f8832030>] ide_detach+0x8/0x14 [ide_cs]
     [<c056ed6b>] pcmcia_device_remove+0x51/0xd1
     [<c054bc9e>] __device_release_driver+0x5a/0x79
     [<c054be98>] device_release_driver+0x1c/0x2b
     [<c054b67b>] bus_remove_device+0x78/0x8a
     [<c054a7db>] device_del+0xe9/0x12f
     [<c054a829>] device_unregister+0x8/0x10
     [<c056ec18>] pcmcia_card_remove+0x58/0x77
     [<c056f366>] ds_event+0x4e/0x7c
     [<c056b34a>] send_event+0x41/0x7e
     [<c056b54e>] socket_shutdown+0xc/0xd1
     [<c056bbd8>] pccardd+0x137/0x1e9
     [<c04202b1>] default_wake_function+0x0/0xc
     [<c056baa1>] pccardd+0x0/0x1e9
     [<c0435f65>] kthread+0xc0/0xeb
     [<c0435ea5>] kthread+0x0/0xeb
     [<c0405c3b>] kernel_thread_helper+0x7/0x10
     =======================
    Code:
    e8 cb c2 ff ff 85 c0 74 04 80 63 54 ef ff 8b 80 00 00 00 89 f0 e8 5d ff
    ff ff 31 c0 83 c4 30 5b 5e 5f c3 57 56 53 8b 70 1c 89 c3 <8b> 56
    04 8b 7e 08 e8 75 5c ff ff 89 f8 e8 7e 9c f3 ff 89 d8 e8 
    EIP: [<c0568601>] ide_disk_remove+0x8/0x2b SS:ESP 0068:f7c32e84
    

Environment

  • Red Hat Enterprise Linux 5
  • IDE compact flash card reader (Note: Issue does not occur if card reader is attached to the SCSI bus).

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.