mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Chris Wright <chrisw@osdl.org>
Cc: "Mark F. Haigh" <Mark.Haigh@SpirentCom.COM>,
	linux-security-module@wirex.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kernel/fork.c: VM accounting bugfix (2.6.11-rc3-bk5)
Date: Wed, 9 Feb 2005 19:46:29 +0000 (GMT)	[thread overview]
Message-ID: <Pine.LNX.4.61.0502091932500.7544@goblin.wat.veritas.com> (raw)
In-Reply-To: <20050209112846.A24171@build.pdx.osdl.net>

On Wed, 9 Feb 2005, Chris Wright wrote:

> * Hugh Dickins (hugh@veritas.com) wrote:
> > dup_mmap's charge starts out at 0 and gets added to each time around
> > the loop through vmas; if security_vm_enough_memory fails at any point
> > in that loop, we need to vm_unacct_memory the charge already accumulated.
> 
> If that's the requirement, then it's broken as is, because there is
> nothing accumulating.  len is re-determined each pass, and charge is
> reset each pass.

You're right, it's me who's wrong, sorry.  I was remembering how it
was before 2.6.7, when Oleg pointed out that it was doubly unaccounting
(and it's probably me who was guilty of that double unaccounting too).

> But I think that it's ok, as we only care about the
> last pass.  If dup_mmap() fails part way through, the cleanup path should
> call unaccount for the (potentially) accounted by not fully setup vma then
> call exit_mmap() and clear all the vmas that got accounted for already.

Yes, that was Oleg's point when he fixed it.

> Either way, Mark's patch is not needed, and I don't think anything needs
> patching in this area.  Hugh, do you agree?

Yes I agree - thanks for clearing that up, Chris.

Hugh

  reply	other threads:[~2005-02-09 19:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-09  3:51 Mark F. Haigh
2005-02-09  7:04 ` Chris Wright
2005-02-09 12:30   ` Hugh Dickins
2005-02-09 19:28     ` Chris Wright
2005-02-09 19:46       ` Hugh Dickins [this message]
2005-02-09 20:04   ` Mark F. Haigh
  -- strict thread matches above, loose matches on Subject: below --
2005-02-09  3:48 Mark F. Haigh

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.61.0502091932500.7544@goblin.wat.veritas.com \
    --to=hugh@veritas.com \
    --cc=Mark.Haigh@SpirentCom.COM \
    --cc=chrisw@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@wirex.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