mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: William Heimbigner <icxcnika@mar.tar.cc>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Peter Osterlund <petero2@telia.com>
Subject: Re: BUG: Null pointer dereference in fs/open.c
Date: Tue, 24 Apr 2007 04:09:18 +0000 (GMT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0704240347470.25153@server.thyself> (raw)
In-Reply-To: <Pine.LNX.4.64.0704231633210.25153@server.thyself>

This bug occurs in linux-2.6.20 and 2.6.21-rc7-git5, and does not occur in 
linux-2.6.19-git22.

After running "pktsetup 0 /dev/hdd", I get (timestamps removed):

pktcdvd: pkt_get_last_written failed
BUG: unable to handle kernel NULL pointer dereference at virtual address 0000000e
printing eip:
c0173f69
*pde = 00000000
Oops: 0000 [#1]
PREEMPT
Modules linked in: snd_ca0106 snd_ac97_codec ac97_bus 8139cp 8139too iTCO_wdt
CPU:    0
EIP:    0060:[<c0173f69>]    Not tainted VLI
EFLAGS: 00010203   (2.6.21-rc7-git5 #22)
EIP is at do_sys_open+0x59/0xd0
eax: 00000002   ebx: 40000020   ecx: 00000001   edx: 00000002
esi: df1e3000   edi: 00000003   ebp: de17bfa4   esp: de17bf84
ds: 007b   es: 007b   fs: 00d8  gs: 0033  ss: 0068
Process vol_id (pid: 4273, ti=de17b000 task=df4143f0 task.ti=de17b000)
Stack: 00000000 c013d2a5 ffffff9c 00000002 c059cea3 bfb6bf64 00008000 b7f60ff4
        de17bfb0 c017401c 00000000 de17b000 c01041c6 bfb6bf64 00008000 00000000
        00008000 b7f60ff4 bfb6a798 00000005 0000007b 0000007b 00000000 00000005
Call Trace:
  [<c010521a>] show_trace_log_lvl+0x1a/0x30
  [<c01052d9>] show_stack_log_lvl+0xa9/0xd0
  [<c010551c>] show_registers+0x21c/0x3a0
  [<c01057a4>] die+0x104/0x260
  [<c04c5947>] do_page_fault+0x277/0x610
  [<c04c408c>] error_code+0x74/0x7c
  [<c017401c>] sys_open+0x1c/0x20
  [<c01041c6>] sysenter_past_esp+0x5f/0x99
  =======================
Code: ff 85 c0 89 c7 78 77 8b 45 08 89 d9 89 f2 89 04 24 8b 45 e8 e8 69 ff 
ff ff 3d 00 f0 ff ff 89 45 ec 77 71 8b 55 ec bb 20 00 00 40 <8b> 42 0c 8b 
48 30 89 4d f0 0f b7 51 66 81 e2 00 f0 00 00 81 fa
EIP: [<c0173f69>] do_sys_open+0x59/0xd0 SS:ESP 0068:de17bf84


from fs/open.c, comments added:
// do_sys_open is consistently called with dfd=0xffffff9c,
// filename="/dev/.tmp-254-0", flags=0x8000, mode=0)
long do_sys_open(int dfd, const char __user *filename, int flags, int mode)
{
         char *tmp = getname(filename);
         int fd = PTR_ERR(tmp);

         if (!IS_ERR(tmp)) {
                 fd = get_unused_fd();
                 if (fd >= 0) {
// do_filp_open consistently returns 2, in this case
                         struct file *f = do_filp_open(dfd, tmp, flags, mode);
// IS_ERR always returns 0 for this command
                         if (IS_ERR(f)) {
                                 put_unused_fd(fd);
                                 fd = PTR_ERR(f);
                         } else {
// null pointer dereference occurs here
                                 fsnotify_open(f->f_path.dentry);
                                 fd_install(fd, f);
                         }
                 }
                 putname(tmp);
         }
         return fd;
}

I was able to workaround this, by testing if do_filp_open was returning 
2 or not, but obviously this is a very temporal solution to a very 
specific circumstance.

If there is any more information I can provide, let me know.
William Heimbigner
icxcnika@mar.tar.cc

  reply	other threads:[~2007-04-24  4:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-22 23:13 BUG: Null pointer dereference (2.6.21-rc7) William Heimbigner
2007-04-23  8:00 ` Andrew Morton
2007-04-23 13:58   ` William Heimbigner
2007-04-23 16:39     ` William Heimbigner
2007-04-24  4:09       ` William Heimbigner [this message]
     [not found]         ` <20070423215810.5a24ed9a.akpm@linux-foundation.org>
2007-04-24  5:10           ` BUG: Null pointer dereference in fs/open.c William Heimbigner
2007-04-24  5:17             ` Andrew Morton
2007-04-24  5:44               ` William Heimbigner
2007-04-24  5:56                 ` Andrew Morton
2007-04-25  7:48                 ` Andrew Morton
2007-04-25 22:53                   ` William Heimbigner
2007-04-25 23:05                     ` Andrew Morton
2007-04-26  0:48                       ` William Heimbigner
2007-04-26  6:39                         ` Jens Axboe
2007-04-26  6:33                       ` Jens Axboe
2007-04-24 20:46           ` Peter Osterlund

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=Pine.LNX.4.64.0704240347470.25153@server.thyself \
    --to=icxcnika@mar.tar.cc \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=petero2@telia.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome