Oops in 2.2.7 (scan_scsis)

Olaf Flebbe (o.flebbe@science-computing.de)
Wed, 05 May 1999 20:11:25 +0200


Hi,

Kernel Oops in Linux Intel 2.2.7, using egcs-1.1.1.
(Oops, I though I am using gcc 2.7.2.3 ;-)

I tried
echo "scsi add-single-device 0 0 3 0" > /proc/scsi/scsi
in order to add my scanner to the system, which had been accidently
without power at system boot time.

Boom! My shell died with an Kernel Oops. (echo is a shell built in
command)

Unfortunatly I cannot reproduce this error any more.

Somehow scsi_init_malloc has returned a NULL pointer and memset tried
to write on it. It would be safer to test the result of
scsi_init_malloc.
But why did it happen?

Please CC to me directly, I am not subscribed to linux-kernel.

Cheers
Olaf
------- scsi.c: scan_scsis -------
...
SCpnt = (Scsi_Cmnd *) scsi_init_malloc (sizeof (Scsi_Cmnd),
GFP_ATOMIC | GFP_DMA);
memset (SCpnt, 0, sizeof (Scsi_Cmnd)); <---Boom!
...
-------------------------------------

May 4 20:31:03 dragon kernel: Unable to handle kernel NULL pointer
dereference
at virtual address 00000000
May 4 20:31:03 dragon kernel: current->tss.cr3 = 016bf000, %cr3 =
016bf000
May 4 20:31:03 dragon kernel: *pde = 00000000
May 4 20:31:03 dragon kernel: Oops: 0002
May 4 20:31:03 dragon kernel: CPU: 0
May 4 20:31:03 dragon kernel: EIP: 0010:[scan_scsis+84/1020]
May 4 20:31:03 dragon kernel: EFLAGS: 00010246
May 4 20:31:03 dragon kernel: eax: 00000000 ebx: 00000001 ecx:
00000046 edx: 00000000
May 4 20:31:03 dragon kernel: esi: 00000000 edi: 00000000 ebp:
00000003 esp: c25dbdcc
^^^^^^^^ value
returned by scsi_init_malloc
May 4 20:31:03 dragon kernel: ds: 0018 es: 0018 ss: 0018
May 4 20:31:03 dragon kernel: Process bash (pid: 360, process nr: 55,
stackpage=c25db000)
May 4 20:31:03 dragon kernel: Stack: c0006800 00000003 c34cd000
c34e1000 00000000 00000000 00000000 0003002a
May 4 20:31:03 dragon kernel: 00000400 c012364e 00000000
ffffffff c0238d1b 0000000a 00000002 c34e1000
May 4 20:31:03 dragon kernel: c34a9422 c019700e 00000000
c25dbe28 000000
May 4 20:31:03 dragon kernel: Call Trace: [getblk+30/324]
[n_tty_receive_buf+3438/3488] [RCSid+45152/45664] [get_hash_table+23/36]
[inode_getblk+71/460] [vsprintf+819/876] [__wake_up+46/60]
May 4 20:31:03 dragon kernel: [printk+358/372]
[scsi_proc_info+513/1104] [scsi_device_types+2496/3392]
[scsi_proc_info+679/1104] [dispatch_scsi_info+54/164]
[proc_writescsi+102/136] [sys_write+220/256] [proc_writescsi+0/136]
May 4 20:31:03 dragon kernel: [system_call+52/64]
May 4 20:31:03 dragon kernel: Code: f3 ab 6a 08 6a 58 e8 f9 18 00 00 89
c7 89 7c 24 38 83 c4 08

-------------------------------------
Disassembly of scan_scsis:
Dump of assembler code for function scan_scsis:
0xc01aacdc <scan_scsis>: subl $0x124,%esp
0xc01aace2 <scan_scsis+6>: pushl %ebp
0xc01aace3 <scan_scsis+7>: pushl %edi
0xc01aace4 <scan_scsis+8>: pushl %esi
0xc01aace5 <scan_scsis+9>: pushl %ebx
0xc01aace6 <scan_scsis+10>: movb 0x13c(%esp,1),%bl
0xc01aaced <scan_scsis+17>: movb 0x140(%esp,1),%al
0xc01aacf4 <scan_scsis+24>: movb %al,0x27(%esp,1)
0xc01aacf8 <scan_scsis+28>: movb 0x144(%esp,1),%cl
0xc01aacff <scan_scsis+35>: movb %cl,0x26(%esp,1)
0xc01aad03 <scan_scsis+39>: movb 0x148(%esp,1),%al
0xc01aad0a <scan_scsis+46>: movb %al,0x25(%esp,1)
0xc01aad0e <scan_scsis+50>: pushl $0x88
0xc01aad13 <scan_scsis+55>: pushl $0x118
0xc01aad18 <scan_scsis+60>: call 0xc01ac634 <scsi_init_malloc>
0xc01aad1d <scan_scsis+65>: movl %eax,0x28(%esp,1)
0xc01aad21 <scan_scsis+69>: addl $0x8,%esp
0xc01aad24 <scan_scsis+72>: movl $0x46,%ecx
0xc01aad29 <scan_scsis+77>: xorl %eax,%eax
0xc01aad2b <scan_scsis+79>: movl 0x20(%esp,1),%edi
0xc01aad2f <scan_scsis+83>: cld
0xc01aad30 <scan_scsis+84>: repz stosl %eax,%es:(%edi) <---Boom!
o

-- 
  Dr. Olaf Flebbe                            Phone +49 (0)7071-9457-32
  science + computing gmbh                     FAX +49 (0)7071-9457-27
  Hagellocher Weg 71
  D-72070 Tuebingen  Email: o.flebbe@science-computing.de

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/