All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander <aledin@evpatoria.com.ua>
To: linux-kernel@vger.kernel.org
Cc: Jiri Slaby <jirislaby@gmail.com>
Subject: [PATCH] char: mxser.c, tty->driver_data is not set, kernel 2.6.33.7
Date: Tue, 10 Aug 2010 17:21:18 +0300	[thread overview]
Message-ID: <4C61605E.1080508@evpatoria.com.ua> (raw)

Hello,

tty->driver_data is not initialized in drivers/char/mxser.c, so it results in
something like this:


BUG: unable to handle kernel NULL pointer dereference at 0000007c
IP: [<d098753f>] mxser_change_speed+0x1f/0x5e0 [mxser]
...
Pid: 1662, comm: msterm Not tainted 2.6.33.4-smp #1 nVidia-nForce/
EIP: 0060:[<d098753f>] EFLAGS: 00010092 CPU: 0
EIP is at mxser_change_speed+0x1f/0x5e0 [mxser]
EAX: cb0b1840 EBX: 00000000 ECX: 0000c400 EDX: cb263800
ESI: 00000cbd EDI: cb263800 EBP: cf9a3dc0 ESP: cf9a3d7c
DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
Process msterm (pid: 1662, ti=cf9a2000 task=cf930000 task.ti=cf9a2000)
Stack:
 00000000 cb263800 cb0ec000 00000001 00000003 c16274d0 c16274cc 00000001
<0> 00000292 cf9a3dc0 c1647740 d098b5bc d098b5bc cb263800 0000c405 d098b5bc
<0> cb263800 cf9a3de8 d0987e4e d098b5a0 d098b6fc 0000c406 0000c402 00000286
Call Trace:
 [<d0987e4e>] ? mxser_activate+0x12e/0x1b0 [mxser]
 [<c129d5df>] ? tty_port_open+0x6f/0xb0
 [<d0988306>] ? mxser_open+0x76/0x80 [mxser]
 [<c12970fc>] ? tty_open+0x22c/0x510
 [<c10dee4b>] ? chrdev_open+0xbb/0x1a0
 [<c105f0aa>] ? in_group_p+0x2a/0x30
 [<c10d9e53>] ? __dentry_open+0xe3/0x290
 [<c10e3f73>] ? inode_permission+0x83/0xb0
 [<c10db04a>] ? nameidata_to_filp+0x4a/0x60
 [<c10ded90>] ? chrdev_open+0x0/0x1a0
 [<c10e732a>] ? do_filp_open+0x6fa/0x9b0
 [<c1057b5d>] ? remove_wait_queue+0x3d/0x50
 [<c129bb4d>] ? tty_ldisc_deref+0xd/0x10
 [<c12961f7>] ? tty_write+0x1b7/0x1e0
 [<c10f0de4>] ? alloc_fd+0x74/0x100
 [<c10d9c06>] ? do_sys_open+0x56/0x110
 [<c10d9d2e>] ? sys_open+0x2e/0x40
 [<c1471874>] ? syscall_call+0x7/0xb
Code: b6 00 00 00 00 8d bc 27 00 00 00 00 55 89 e5 57 56 53 83 ec 38 0f 1f 44 00
00 89 45 c0 89 c2 8b 98 3c 01 00 00 8b 40 44 8b 70 08 <8b> 43 7c 85 c0 0f 84 bc
01 00 00 8b 42 10 8b 04 85 c0 df 98 d0
EIP: [<d098753f>] mxser_change_speed+0x1f/0x5e0 [mxser] SS:ESP 0068:cf9a3d7c
CR2: 000000000000007c

In kernels 2.6.34 and up it's fixed already, but not in 2.6.33.7.

The included patch is against 2.6.33.7:



--- linux-2.6.33.7/drivers/char/mxser.c	2010-08-02 20:27:18.000000000 +0300
+++ my-linux-2.6.33.7/drivers/char/mxser.c	2010-08-10 15:14:01.000000000 +0300
@@ -1012,6 +1012,8 @@
 	if (!info->ioaddr)
 		return -ENODEV;

+	tty->driver_data = info;
+
 	return tty_port_open(&info->port, tty, filp);
 }





-- 
Alexander Pravdin
aledin@evpatoria.com.ua


             reply	other threads:[~2010-08-10 14:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-10 14:21 Alexander [this message]
2010-08-10 20:20 ` [PATCH] char: mxser.c, tty->driver_data is not set, kernel 2.6.33.7 Jiri Slaby
2010-08-10 20:42   ` Alexander

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C61605E.1080508@evpatoria.com.ua \
    --to=aledin@evpatoria.com.ua \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.