From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>,
Balbir Singh <balbir@linux.vnet.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Paul Moore <paul.moore@hp.com>,
Stephen Smalley <sds@epoch.ncsc.mil>,
Chris Vance <cvance@nai.com>, Wayne Salamon <wsalamon@nai.com>,
James Morris <jmorris@redhat.com>,
dgoeddel@trustedcs.com, Fengguang Wu <fengguang.wu@gmail.com>
Subject: Re: [BUGFIX] NULL pointer dereference in __vm_enough_memory()
Date: Mon, 13 Aug 2007 13:53:02 +0400 [thread overview]
Message-ID: <20070813095302.GA7239@cvg> (raw)
In-Reply-To: <20070813002342.GA6908@mail.ustc.edu.cn>
[WU Fengguang - Mon, Aug 13, 2007 at 08:23:42AM +0800]
| On Sun, Aug 12, 2007 at 08:21:43PM +0400, Cyrill Gorcunov wrote:
| > [Alan Cox - Sun, Aug 12, 2007 at 04:17:44PM +0100]
| > | Try this (it compiles but isnt tested). Its a weekend here, the sun is
| > | shining, the beach is a short walk, and I have more interesting things to
| > | do right now 8)
| > |
| > |
| [...]
| > | -int __vm_enough_memory(long pages, int cap_sys_admin)
| > | +int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin)
| > | {
| > | unsigned long free, allowed;
| > |
| > | @@ -166,7 +166,7 @@
| > |
| > | /* 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;
| > | + allowed -= mm->total_vm / 32;
| >
| > So mm->total_vm is 0 for __bprm_mm_init case. Is that ok? Or I miss
| > something?
|
| Yeah, Alan adds mm to the interfaces and leaves us the question of
| "what mm to pass in when current->mm == NULL?" ;)
|
Well, as I see, it seems the Alan's patch is correct. We pass
newly created mm to security_vm_enough_memory_mm() and get no errors
here even for overcommit = 2. But my question was that mm->total_vm
= 0 for this case and that is probably valid too I think. What about
the thing you pointed about? Well I think security_vm_enough_memory
should never be called from kernel thread (we have secrurity_vm_enough_memory_mm
for this). But I will check it more closely. Dont get me wrong - I'm not
VMM expert and may do errors ;)
Cyrill
next prev parent reply other threads:[~2007-08-13 13:38 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <46BEF5C0.3080902@linux.vnet.ibm.com>
[not found] ` <20070812120902.GA9972@mail.ustc.edu.cn>
2007-08-12 12:27 ` [BUGFIX] NULL pointer dereference in __vm_enough_memory() WU Fengguang
2007-08-12 12:27 ` WU Fengguang
2007-08-12 13:19 ` Alan Cox
2007-08-12 14:09 ` WU Fengguang
2007-08-12 14:09 ` WU Fengguang
2007-08-12 15:17 ` Alan Cox
2007-08-12 16:21 ` Cyrill Gorcunov
2007-08-13 0:23 ` WU Fengguang
2007-08-13 0:23 ` WU Fengguang
2007-08-13 9:53 ` Cyrill Gorcunov [this message]
2007-08-13 11:22 ` Alan Cox
2007-08-13 11:55 ` Cyrill Gorcunov
2007-08-13 0:14 ` Rene Herman
2007-08-13 7:38 ` WU Fengguang
2007-08-13 7:38 ` WU Fengguang
2007-08-13 13:01 ` [PATCH] fix " Alan Cox
2007-08-14 5:01 ` Andrew Morton
2007-08-14 17:50 ` Tobias Diedrich
2007-08-14 17:10 ` [BUGFIX] " Andy Isaacson
2007-08-15 8:53 ` WU Fengguang
2007-08-15 8:53 ` WU Fengguang
2007-08-11 13:21 Fengguang Wu
2007-08-11 13:21 ` 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
2007-08-12 5:48 ` WU Fengguang
2007-08-12 5:48 ` WU Fengguang
2007-08-12 8:58 ` WU Fengguang
2007-08-12 8:58 ` WU Fengguang
2007-08-12 9:25 ` Balbir Singh
2007-08-12 12:23 ` Cyrill Gorcunov
2007-08-12 5:46 ` WU Fengguang
2007-08-12 5:46 ` WU Fengguang
2007-08-11 14:17 ` Cyrill Gorcunov
2007-08-12 5:29 ` Fengguang Wu
2007-08-12 5:29 ` Fengguang Wu
2007-08-12 5:45 ` Cyrill Gorcunov
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=20070813095302.GA7239@cvg \
--to=gorcunov@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=balbir@linux.vnet.ibm.com \
--cc=cvance@nai.com \
--cc=dgoeddel@trustedcs.com \
--cc=fengguang.wu@gmail.com \
--cc=jmorris@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paul.moore@hp.com \
--cc=sds@epoch.ncsc.mil \
--cc=wsalamon@nai.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 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.