From: Hugh Dickins <hugh@veritas.com>
To: Andrew Morton <akpm@osdl.org>
Cc: dev@sw.ru, torvalds@osdl.org, linux-kernel@vger.kernel.org, xemul@sw.ru
Subject: Re: [PATCH] error path in setup_arg_pages() misses vm_unacct_memory()
Date: Tue, 13 Sep 2005 20:10:55 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.61.0509131945470.19481@goblin.wat.veritas.com> (raw)
In-Reply-To: <20050913113703.53d53d6a.akpm@osdl.org>
On Tue, 13 Sep 2005, Andrew Morton wrote:
>
> I don't think that it's any racier to move the allocation to after the
> check than to have it before the check. If we're worried, take mmap_sem -
> most place already do that, but not all.
mmap_sem? That locks a single mm, but here we're talking about
making reservations from what /proc/meminfo calls CommitLimit,
for the whole machine. I really don't see any need to change
the ordering of what's done at present.
> > But change the naming by all means, it was never good,
> > and grew worse when "security_" got stuck on the front.
>
> Yes, renaming it to something like alloc_vm_space() would suit.
Nor am I in any hurry to change the name, though I agree with
you and Alan that a name change would be good, in due course.
I'm more interested in fixing the bugs Kirill and co discovered,
and those I'm additionally finding on the way to fixing them in
insert_vm_struct. Notice how running a 32-bit binary on x86_64
leaks 4kB into Committed_AS each time?
But I'm puzzled as to why the same leak into Committed_AS doesn't
occur on ppc64, each time an ELF binary is run, if vDSO is enabled.
Or is it indeed leaking, but nobody has noticed? I don't have any
ppc64, could someone please check and see? Thanks.
insert_vm_struct is certainly the way to go (it's not obvious to
callers whether VM_ACCOUNT is set or not), and there won't be any
security_vm_enough_memory calls outside mm/ (and kernel/fork.c)
once I'm done: just a matter of where to stop (should it also
vm_stat_account? can we trust callers to maintain total_vm?
what about locked_vm? rlimits?).
Hugh
next prev parent reply other threads:[~2005-09-13 19:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-12 16:49 Kirill Korotaev
2005-09-12 20:23 ` Andrew Morton
2005-09-13 8:21 ` Kirill Korotaev
2005-09-13 8:40 ` Andrew Morton
2005-09-13 11:30 ` Hugh Dickins
2005-09-13 18:37 ` Andrew Morton
2005-09-13 19:10 ` Hugh Dickins [this message]
2005-09-13 11:58 ` Alan Cox
2005-09-13 11:20 ` Hugh Dickins
2005-09-13 12:13 ` Kirill Korotaev
2005-09-14 5:13 ` Hugh Dickins
2005-09-14 8:41 ` Kirill Korotaev
2005-09-14 9:14 ` Hugh Dickins
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.0509131945470.19481@goblin.wat.veritas.com \
--to=hugh@veritas.com \
--cc=akpm@osdl.org \
--cc=dev@sw.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
--cc=xemul@sw.ru \
/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
all inboxes | Powered by JetHome®