All of lore.kernel.org
 help / color / mirror / Atom feed
From: hooanon05@yahoo.co.jp
To: James Morris <jmorris@namei.org>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	alan@redhat.com, linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org
Subject: Re: current->mm == NULL in security_vm_enough_memory().
Date: Thu, 26 Mar 2009 13:26:43 +0900	[thread overview]
Message-ID: <7142.1238041603@jrobl> (raw)
In-Reply-To: <alpine.LRH.2.00.0903261236580.30336@tundra.namei.org>


James Morris:
> On Thu, 26 Mar 2009, Tetsuo Handa wrote:
> 
> > [   28.765817] ------------[ cut here ]------------
> > [   28.768916] WARNING: at security/security.c:217 security_vm_enough_memory+0xa0/0xb0()
> > [   28.772484] Hardware name: VMware Virtual Platform
> > [   28.774099] Modules linked in: pcnet32 crc32
> > [   28.776920] Pid: 3286, comm: khelper Not tainted 2.6.29-next-20090324-dirty #3
> > [   28.780317] Call Trace:
> > [   28.781323]  [<c0159200>] ? have_callable_console+0x30/0x50
> > [   28.784171]  [<c0158497>] warn_slowpath+0x97/0xf0
> > [   28.785739]  [<c0190f7c>] ? validate_chain+0x3fc/0x540
> > [   28.788402]  [<c0190f7c>] ? validate_chain+0x3fc/0x540
> > [   28.790103]  [<c0192dfc>] ? __lock_acquire+0x29c/0x8a0
> > [   28.792809]  [<c0194859>] ? __lock_acquired+0x109/0x1c0
> > [   28.794539]  [<c0338ea0>] security_vm_enough_memory+0xa0/0xb0
> > [   28.797391]  [<c0202117>] acct_stack_growth+0xd7/0x160
> > [   28.798842]  [<c02022b9>] expand_downwards+0x119/0x150
> > [   28.801709]  [<c020230d>] expand_stack+0xd/0x10
	:::
> > May I ignore this warning?
> 
> khelper is a kernel thread, so it should not have an ->mm, but I wonder 
> why this hasn't shown up before.  Odd...

The patch was merged in 2.6.28. See this url in detail.
http://marc.info/?t=122460314500001&r=1&w=2
Subject: __vm_enough_memory(), OVERCOMMIT_NEVER, current->mm, kernel thread

With this discussion, a new function security_vm_enough_memory_kern()
was introduced. All kernel thread should call this new one instead of
security_vm_enough_memory(). The added WARN_ON() worked exactly as Alan
Cox expected.
But I am not sure this is the case. When expand_stack() is called in the
user context, to call ..._kern() may be a bad idea.


J. R. Okajima

  reply	other threads:[~2009-03-26  4:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-26  1:30 current->mm == NULL in security_vm_enough_memory() Tetsuo Handa
2009-03-26  1:41 ` James Morris
2009-03-26  4:26   ` hooanon05 [this message]
2009-04-09 12:05   ` Tetsuo Handa
2009-04-10  5:14     ` hooanon05
2009-04-13 12:27     ` Tetsuo Handa
2009-04-14 16:40       ` Greg KH
2009-04-14 21:35         ` Tetsuo Handa
2009-04-14 17:45       ` Hugh Dickins
2009-04-14 18:03         ` Alan Cox
2009-04-14 18:05         ` Alan Cox

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=7142.1238041603@jrobl \
    --to=hooanon05@yahoo.co.jp \
    --cc=alan@redhat.com \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    /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.