From: Larry Finger <Larry.Finger@lwfinger.net>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: Question about do_mmap changes
Date: Mon, 04 Jun 2012 01:37:33 -0500 [thread overview]
Message-ID: <4FCC57AD.3000803@lwfinger.net> (raw)
In-Reply-To: <20120604062604.GV30000@ZenIV.linux.org.uk>
On 06/04/2012 01:26 AM, Al Viro wrote:
> On Mon, Jun 04, 2012 at 12:29:45AM -0500, Larry Finger wrote:
>> Al,
>>
>> In commit e3fc629d7bb70848fbf479688a66d4e76dff46ac in 3.5-rc1, you
>> change do_mmap() to static, and use do_mmap_pgoff() instaed. The
>> VirtualBox kernel module calls do_mmap(), and no longer compiles. I
>> fixed the compile problem with the patch
> [snip]
>> I am not quite sure why do_munmap() is undefined as the symbol is
>> exported; however, should do_mmap_pgoff() be exported?
>
> a) you'd better make very certain that you are holding ->mmap_sem on
> current->mm; I couldn't verify that.
>
> b) as for rtR0MemObjLinuxDoMmap(), I would suggest pulling down_write()/
> up_write() on ->mmap_sem into the function, collapsing them down into
> do_mmap() turning it into vm_mmap(). Oh, and probably breaking wrists
> to whoever had come up with that function name, but that's a matter of
> taste. Some prefer kneecaps.
>
> c) WTF is MY_DO_MUNMAP() and are you guaranteed that you are doing that to
> current->mm and not to something else? If not, you have a big problem;
> if yes, convert to vm_munmap().
>
> Again, doing mmap/munmap to some random process' mm is a bloody bad idea;
> there's a shitload of races in that area.
Oh, shit. I was hoping for an easy conversion of this code to work with 3.5 so
that I could use VB while testing 3.5. Clearly, the fixes will not be quick.
As you have likely gathered, I am not a VB developer. Is it OK if I pass your
comments on to the real developers and let them do the work?
Thanks,
Larry
next prev parent reply other threads:[~2012-06-04 6:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-04 5:29 Question about do_mmap changes Larry Finger
2012-06-04 6:26 ` Al Viro
2012-06-04 6:37 ` Larry Finger [this message]
2012-06-04 6:56 ` Al Viro
2012-06-04 7:27 ` Al Viro
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=4FCC57AD.3000803@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@ZenIV.linux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.