Re: [PATCH 1/2] mm/vmalloc: export is_vmalloc_or_module_addr

From: Richard Yao
Date: Sat Feb 08 2014 - 14:58:44 EST


On 02/08/2014 02:45 PM, Linus Torvalds wrote:
> On Sat, Feb 8, 2014 at 11:12 AM, Richard Yao <ryao@xxxxxxxxxx> wrote:
> And what's the backtrace that gets mentioned - but not quoted - for
> the horrible 9p crap? So that we can see who the guilty party is that
> thinks that it's somehow ok to pass module addresses off to other
> kernel users..

My apologies for that. Here is the backtrace:

[<ffffffff814878ce>] p9_virtio_zc_request+0x45e/0x510
[<ffffffff814814ed>] p9_client_zc_rpc.constprop.16+0xfd/0x4f0
[<ffffffff814839dd>] p9_client_read+0x15d/0x240
[<ffffffff811c8440>] v9fs_fid_readn+0x50/0xa0
[<ffffffff811c84a0>] v9fs_file_readn+0x10/0x20
[<ffffffff811c84e7>] v9fs_file_read+0x37/0x70
[<ffffffff8114e3fb>] vfs_read+0x9b/0x160
[<ffffffff81153571>] kernel_read+0x41/0x60
[<ffffffff810c83ab>] copy_module_from_fd.isra.34+0xfb/0x180
[<ffffffff810cc420>] SyS_finit_module+0x70/0xd0
[<ffffffff814a08fd>] system_call_fastpath+0x1a/0x1f
[<ffffffffffffffff>] 0xffffffffffffffff

The addresses are being passed to permit zero-copy between the guest and
the host. You can see this in the original thread back from December,
which is from before I knew how to submit patches properly:

http://www.spinics.net/lists/linux-virtualization/msg21734.html

> Please let's just fix the real problem, don't add more horridness on
> top of it because somebody messed up earlier.

This code avoids a copy between QEMU's 9p server and a guest Linux
kernel. Without it, the 9p-virtio code must allocate additional buffers
into which QEMU will write the data and then copy from those buffers
into the actual kernel buffers. How would you like 9p-virtio to do this?

Attachment: signature.asc
Description: OpenPGP digital signature