OpenVZ Forum


Home » Mailing lists » Devel » Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control
Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control [message #10458 is a reply to message #10453] Mon, 19 February 2007 14:10 Go to previous messageGo to previous message
Balbir Singh is currently offline  Balbir Singh
Messages: 491
Registered: August 2006
Senior Member
Paul Menage wrote:
> On 2/19/07, Balbir Singh <balbir@in.ibm.com> wrote:
>>> More worrisome is the potential for use-after-free. What prevents the
>>> pointer at mm->container from referring to freed memory after we're dropped
>>> the lock?
>>>
>> The container cannot be freed unless all tasks holding references to it are
>> gone,
>
> ... or have been moved to other containers. If you're not holding
> task->alloc_lock or one of the container mutexes, there's nothing to
> stop the task being moved to another container, and the container
> being deleted.
>
> If you're in an RCU section then you can guarantee that the container
> (that you originally read from the task) and its subsystems at least
> won't be deleted while you're accessing them, but for accounting like
> this I suspect that's not enough, since you need to be adding to the
> accounting stats on the correct container. I think you'll need to hold
> mm->container_lock for the duration of memctl_update_rss()
>
> Paul
>

Yes, that sounds like the correct thing to do.

--
Warm Regards,
Balbir Singh
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: [patch 0/1] [RFC][net namespace] veth ioctl management
Next Topic: [PATCH] ecryptfs ecryptfs_read_super path_lookup errh fix
Goto Forum:
  


Current Time: Tue Oct 07 13:21:04 GMT 2025

Total time taken to generate the page: 0.33916 seconds