Title: RE: [linux-usb-devel] oops in serial_open and serial_close

Hi Flavio,

Check the major number and try to open device file "/dev/usb/ttyUSB0"



Regards
Shalini





-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Flavio Leitner
Sent: Wed 5/4/2005 6:51 PM
To: linux-usb-devel@lists.sourceforge.net
Cc: [EMAIL PROTECTED]
Subject: [linux-usb-devel] oops in serial_open and serial_close


Hello,

I'm testing with pl2303 but oops show at serial_open() then
I don't know if happens with other modules too. The program
that trigger bug is attached below and just open(), tcsetattr()
and close().

To reproduce:

# for i in $(seq 5); do ./test_case /dev/ttyUSB0 ; done &
# for i in $(seq 5); do ./test_case /dev/ttyUSB0 ; done &
<wait segfaults>

Thanks to Luis Capitulino to report this one.

#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <termios.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>

int main(int argc, char *argv[])
{
        int ret, fd;
        int pid;
        char *port;
        struct termios tio, original;

        port = argv[1];
        if (!port)
                port = "/dev/ttyUSB0";

        pid = getpid();

        fd = open(argv[1], O_RDWR | O_NONBLOCK | O_NOCTTY);
        if (fd < 0) {
                perror("open()");
                exit(-1);
        }

        usleep(100);

        memset(&tio, 0, sizeof(struct termios));
        tio.c_cflag = B9600 | CS8 | CREAD | CRTSCTS | CLOCAL | HUPCL;
        tio.c_iflag = IGNPAR | IGNBRK;
        tio.c_oflag = 0;
        tio.c_lflag = 0;
        tio.c_cc[VTIME] = 10;
        tio.c_cc[VMIN] = 0;

        usleep(200);
        ret = tcsetattr(fd, TCSANOW, &tio);
        if (ret) {
                perror("tcsetattr()");
                exit(-1);
        }

        close(fd);

        return 0;
}


Unable to handle kernel NULL pointer dereference at virtual address 00000084
 printing eip:
d0c708f9
*pde = 00000000
Oops: 0000 [#5]
Modules linked in: nfs lockd sunrpc pl2303 usbserial bluetooth nvidia agpgart autofs4 parport_pc lp parport 8139too mii ehci_hcd tsdev joydev snd_mixer_oss snd_ali5451 snd_ac97_codec snd_pcm snd_timer snd soundcore snd_page_alloc eeprom i2c_sensor i2c_ali1535 i2c_core fan button battery ac acpi_cpufreq freq_table processor psmouse evdev ide_cd cdrom rtc dm_mod ext3 mbcache jbd
CPU:    0
EIP:    0060:[<d0c708f9>]    Tainted: PF     VLI
EFLAGS: 00210246   (2.6.11-72032U10_16cl)
EIP is at serial_ioctl+0x29/0xd0 [usbserial]
eax: 00000000   ebx: 00000000   ecx: c0910a80   edx: c0910a80
esi: ffffffed   edi: 00005402   ebp: cccf9f18   esp: cccf9ef8
ds: 007b   es: 007b   ss: 0068
Process tc (pid: 3877, threadinfo=cccf8000 task=cc6b6540)
Stack: 00000000 00000000 400d2370 cc6b6540 00000004 cafab000 00005402 fffffff9
       cccf9f4c c020a9eb cafab000 c0910a80 00005402 bffff7a0 cafab000 bffff7a0
       00005402 c0910a80 bffff7a0 00005402 bffff7a0 cccf9f6c c016648f ce4220e4
Call Trace:
 [<c0103cff>] show_stack+0x7f/0xa0
 [<c0103ea6>] show_registers+0x156/0x1c0
 [<c0104098>] die+0xc8/0x150
 [<c0114026>] do_page_fault+0x336/0x6b2
 [<c0103993>] error_code+0x2b/0x30
 [<c020a9eb>] tty_ioctl+0x35b/0x4b0
 [<c016648f>] do_ioctl+0x4f/0x70
 [<c0166698>] vfs_ioctl+0x68/0x1e0
 [<c0166871>] sys_ioctl+0x61/0x90
 [<c0102ee3>] syscall_call+0x7/0xb
Code: 00 00 55 89 e5 83 ec 20 89 75 f8 8b 45 08 be ed ff ff ff 89 7d fc 8b 7d 10 89 5d f4 8b 98 7c 09 00 00 a1 04 76 c7 d0 85 c0 75 77 <8b> 83 84 00 00 00 85 c0 74 42 8b 03 8b 50 04 8b 82 b4 00 00 00

--
Flávio Bruno Leitner <[EMAIL PROTECTED]>
[0EA2 7F40 4CF4 1E63 4AF6  33C0 3E10 E205 F251 EDDA]


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to