From: Oleg Nesterov <oleg@redhat.com>
To: Michal Hocko <mhocko@suse.cz>
Cc: Ingo Molnar <mingo@elte.hu>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
David Long <dave.long@linaro.org>,
Hugh Dickins <hughd@google.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] uprobes: Add mem_cgroup_charge_anon() into uprobe_write_opcode()
Date: Mon, 19 May 2014 15:50:00 +0200 [thread overview]
Message-ID: <20140519135000.GA20010@redhat.com> (raw)
In-Reply-To: <20140519124134.GB3017@dhcp22.suse.cz>
On 05/19, Michal Hocko wrote:
>
> On Mon 05-05-14 17:13:20, Oleg Nesterov wrote:
>
> Ups, this really slipped through...
> Sorry about that.
>
> > Hugh says:
> >
> > The one I noticed was that it forgets all about memcg (because
> > it was copied from KSM, and there the replacement page has already
> > been charged to a memcg). See how mm/memory.c do_anonymous_page()
> > does a mem_cgroup_charge_anon().
> >
> > Hopefully not a big problem, uprobes is a system-wide thing and only
> > root can insert the probes. But I agree, should be fixed anyway.
>
> I am not familiar with uprobes but AFAIU this can be a non-trivial of
> (now) uncharged memory. The fact that only root is allowed to install
> probes doesn't change the fact that this is still unaccounted memory and
> so setups which are tuned to not trigger OOM killer would be broken.
Sorry for confusion. I only tried to say that a user can't exploit this
problem. And "system-wide" means that installing a uprobe has other
negative impacts on the whole system. IOW, I do not think that, say, this
fix is -stable material.
> > Add mem_cgroup_{un,}charge_anon() into uprobe_write_opcode(). To simplify
> > the error handling (and avoid the new "uncharge" label) the patch also
> > moves anon_vma_prepare() up before we alloc/charge the new page.
> >
> > While at it fix the comment about ->mmap_sem, it is held for write.
>
> > Suggested-by: Hugh Dickins <hughd@google.com>
> > Signed-off-by: Oleg Nesterov <oleg@redhat.com>
>
> Acked-by: Michal Hocko <mhocko@suse.cz>
Thanks!
Oleg.
next prev parent reply other threads:[~2014-05-19 14:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-05 15:13 [PATCH] uprobes: Add mem_cgroup_charge_anon() into uprobe_write_opcode() Oleg Nesterov
2014-05-19 12:41 ` Michal Hocko
2014-05-19 13:50 ` Oleg Nesterov [this message]
2014-05-21 10:05 ` Srikar Dronamraju
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=20140519135000.GA20010@redhat.com \
--to=oleg@redhat.com \
--cc=ananth@in.ibm.com \
--cc=dave.long@linaro.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@suse.cz \
--cc=mingo@elte.hu \
--cc=srikar@linux.vnet.ibm.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