public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	WU Fengguang <wfg@mail.ustc.edu.cn>
Subject: Re: [BUGFIX] NULL pointer dereference in __vm_enough_memory()
Date: Sat, 11 Aug 2007 22:13:10 +0400	[thread overview]
Message-ID: <20070811181310.GB7232@cvg> (raw)
In-Reply-To: <46BDF965.3050402@linux.vnet.ibm.com>

[Balbir Singh - Sat, Aug 11, 2007 at 11:31:09PM +0530]
| Andrew Morton wrote:
| > On Sat, 11 Aug 2007 20:00:12 +0530 "Balbir Singh" <balbir@linux.vnet.ibm.com> wrote:
| > 
| >> On 8/11/07, Fengguang Wu <fengguang.wu@gmail.com> wrote:
| > 
| > hm, both people who replied to this removed Fengguang from cc.  Disagreement
| > between headers and MUAs, perhaps?
| > 
| 
| Oops... Not sure how that happened. I'll check my sent mail.
| 
| >>> Andrew,
| >>>
| >>> I'm not sure if this patch is the right fix for the bug.  But it do
| >>> stops the oops message. The bug also happens in 2.6.23-rc1-mm2/2.6.23-rc2-mm2.
| >>> I'm running debian/sid. The .config is attached.
| >>>
| >>>
| >>> Unable to handle kernel NULL pointer dereference at 0000000000000138 RIP
| >>>  [<ffffffff81092f66>] __vm_enough_memory+0x76/0x120
| >>> PGD 7cd84067 PUD 7d9c3067 PMD 0
| >>> Oops: 0000 [2] SMP
| >>> CPU 1
| >>> Modules linked in: eeprom lm85 hwmon_vid i2c_core tun fuse kvm snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm snd_timer sg snd soundcore sr_mod cdrom snd_page_alloc pcspkr evdev button raid0 usbhid sd_mod uhci_hcd ehci_hcd ata_piix ahci ohci1394 ieee1394 thermal processor fan
| >>> Pid: 4305, comm: khelper Tainted: G      D 2.6.23-rc2 #9
| >>> RIP: 0010:[<ffffffff81092f66>]  [<ffffffff81092f66>] __vm_enough_memory+0x76/0x120
| >>> RSP: 0000:ffff81007a3d1d30  EFLAGS: 00010206
| >>> RAX: 0000000000000000 RBX: 0000000000000001 RCX: 000000000003e142
| >>> RDX: 00000000000004f4 RSI: 0000000000000001 RDI: 0000000000000001
| >>> RBP: ffff81007a3d1d40 R08: ffff81007a3d1d78 R09: 0000000000000000
| >>> R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000001
| >>> R13: 0000000000000000 R14: ffff81007d0c0188 R15: ffff81007d577b18
| >>> FS:  0000000000000000(0000) GS:ffff81007efa11d0(0000) knlGS:0000000000000000
| >>> CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
| >>> CR2: 0000000000000138 CR3: 000000003799b000 CR4: 00000000000006e0
| >>> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
| >>> DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
| >>> Process khelper (pid: 4305, threadinfo ffff81007a3d0000, task ffff81007a30acc0)
| >>> Stack:  0000000000000001 ffff81007d577b18 ffff81007a3d1d60 ffffffff811297ff
| >>>  0000000000000001 ffff810037c84bb8 ffff81007a3d1da0 ffffffff81092532
| >>>  ffff81007d0c0188 0000000000000000 ffff81007d577b20 0000000000000000
| >>> Call Trace:
| >>>  [<ffffffff811297ff>] cap_vm_enough_memory+0x2f/0x40
| >>>  [<ffffffff81092532>] insert_vm_struct+0xa2/0xb0
| >>>  [<ffffffff810b020e>] bprm_mm_init+0x11e/0x1b0
| >>>  [<ffffffff810b1b71>] do_execve+0x81/0x220
| >>>  [<ffffffff8104bf90>] __call_usermodehelper+0x0/0x90
| >>>  [<ffffffff8100abc6>] sys_execve+0x46/0xb0
| >>>  [<ffffffff8104bf90>] __call_usermodehelper+0x0/0x90
| >>>  [<ffffffff8100cf64>] kernel_execve+0x64/0xd0
| >>>  [<ffffffff8104bf90>] __call_usermodehelper+0x0/0x90
| >>>  [<ffffffff8104c384>] ____call_usermodehelper+0x174/0x190
| >>>  [<ffffffff8100cef8>] child_rip+0xa/0x12
| >>>  [<ffffffff810356f8>] schedule_tail+0x78/0x100
| >>>  [<ffffffff8100c60c>] restore_args+0x0/0x30
| >>>  [<ffffffff8104c210>] ____call_usermodehelper+0x0/0x190
| >>>  [<ffffffff8100ceee>] child_rip+0x0/0x12
| >>>
| >>>
| >>> Code: 48 8b 80 38 01 00 00 48 c1 e8 05 48 29 c1 48 39 ca 0f 8c 89
| >>> RIP  [<ffffffff81092f66>] __vm_enough_memory+0x76/0x120
| >>>  RSP <ffff81007a3d1d30>
| >>> CR2: 0000000000000138
| >>>
| >>> Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn>
| >>> ---
| >>>  mm/mmap.c |    3 ++-
| >>>  1 file changed, 2 insertions(+), 1 deletion(-)
| >>>
| >>> --- linux-2.6.23-rc2-mm2.orig/mm/mmap.c
| >>> +++ linux-2.6.23-rc2-mm2/mm/mmap.c
| >>> @@ -166,7 +166,8 @@ int __vm_enough_memory(long pages, int c
| >>>
| >>>         /* Don't let a single process grow too big:
| >>>            leave 3% of the size of this process for other processes */
| >>> -       allowed -= current->mm->total_vm / 32;
| >>> +       if (current->mm)
| >>> +               allowed -= current->mm->total_vm / 32;
| >>>
| >>>         /*
| >>>          * cast `allowed' as a signed long because vm_committed_space
| >>>
| >>>
| >> Shouldn't we just not stop vm accounting for kernel threads?
| >>
| > 
| > Could be.  It'd help heaps if we knew which patch in -mm caused
| > this, but from a quick peek it seems to me that mainline should be
| > vulnerable as well.
| 
| Thats a valid point. It would be interesting to see what the overcommit
| setting was, when the panic occurred.

May I suggest - could it be commit b6a2fea39318e43fee84fa7b0b90d68bed92d2ba
Not sure but take a look please

		Cyrill


  reply	other threads:[~2007-08-11 18:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070811132131.GA13775@mail.ustc.edu.cn>
2007-08-11 13:21 ` [BUGFIX] NULL pointer dereference in __vm_enough_memory() Fengguang Wu
2007-08-11 14:30   ` Balbir Singh
2007-08-11 17:00     ` Andrew Morton
2007-08-11 18:01       ` Balbir Singh
2007-08-11 18:13         ` Cyrill Gorcunov [this message]
     [not found]         ` <20070812054831.GB8992@mail.ustc.edu.cn>
2007-08-12  5:48           ` WU Fengguang
     [not found]           ` <20070812085808.GA7239@mail.ustc.edu.cn>
2007-08-12  8:58             ` WU Fengguang
2007-08-12  9:25               ` Balbir Singh
2007-08-12 12:23                 ` Cyrill Gorcunov
     [not found]       ` <20070812054606.GA8992@mail.ustc.edu.cn>
2007-08-12  5:46         ` WU Fengguang
2007-08-11 14:17 ` Cyrill Gorcunov
     [not found]   ` <20070812052915.GA6769@mail.ustc.edu.cn>
2007-08-12  5:29     ` Fengguang Wu
2007-08-12  5:45     ` Cyrill Gorcunov
     [not found] <46BEF5C0.3080902@linux.vnet.ibm.com>
     [not found] ` <20070812120902.GA9972@mail.ustc.edu.cn>
     [not found]   ` <20070812122746.GA10109@mail.ustc.edu.cn>
2007-08-12 12:27     ` WU Fengguang
2007-08-12 13:19       ` Alan Cox
     [not found]         ` <20070812140917.GA13683@mail.ustc.edu.cn>
2007-08-12 14:09           ` WU Fengguang
2007-08-12 15:17             ` Alan Cox
2007-08-12 16:21               ` Cyrill Gorcunov
     [not found]                 ` <20070813002342.GA6908@mail.ustc.edu.cn>
2007-08-13  0:23                   ` WU Fengguang
2007-08-13  9:53                   ` Cyrill Gorcunov
2007-08-13 11:22                     ` Alan Cox
2007-08-13 11:55                       ` Cyrill Gorcunov
2007-08-13  0:14               ` Rene Herman
     [not found]               ` <20070813073853.GA5262@mail.ustc.edu.cn>
2007-08-13  7:38                 ` WU Fengguang
2007-08-14 17:10     ` Andy Isaacson
     [not found]       ` <20070815085308.GA18959@mail.ustc.edu.cn>
2007-08-15  8:53         ` WU Fengguang

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=20070811181310.GB7232@cvg \
    --to=gorcunov@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wfg@mail.ustc.edu.cn \
    /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