[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100401144329.BE42.A69D9226@jp.fujitsu.com>
Date: Thu, 1 Apr 2010 14:54:43 +0900 (JST)
From: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To: Matt Mackall <mpm@...enic.com>
Cc: kosaki.motohiro@...fujitsu.com,
Linus Torvalds <torvalds@...ux-foundation.org>,
San Mehat <san@...gle.com>, linux-kernel@...r.kernel.org,
Brian Swetland <swetland@...gle.com>,
Dave Hansen <haveblue@...ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] proc: pagemap: Hold mmap_sem during page walk
> > So Matt, please actually address the _bug_ I pointed out rather than talk
> > about other things. And yes, getting rid of the vma accesses sounds like
> > it would fix it best. If that means that it doesn't work for hugepages, so
> > be it.
>
> That'd actually take us back to where it was when it hit mainline, which
> would make a lot of people unhappy. I wouldn't be one of them as there
> thankfully aren't any huge pages in my world. But I'm convinced
> put_user() must go. In which case, get_user_pages() stays, and I've got
> to switch things to direct physical page access into that array.
no. direct physical page access for /proc is completely wrong idea, i think.
please imazine the caller process is multi threaded and it use fork case,
example scenario)
1. the parent process has thread-A and thread-B.
2. thread-A call read_pagemap
3. read_pagemap grab the page-C
3. at the same time, thread-B call fork(), now page-C pointed from two process.
4. thread-B touch page-C, cow occur, then the parent process has cowed page (page-C')
and the child process has original page-C.
5. thread-A write page-C by physical page access, then the child page is
modified, instead parent one.
I just recommend simply do double buffering.
thanks.
> Even if I fix that, I believe San's original bug can still be triggered
> though, as all the new callers to find_vma are run outside of the
> target's mm_sem. Fixing that should be reasonably straight-forward.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists