lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 11 Feb 2010 20:54:46 +0900
From:	Tejun Heo <tj@...nel.org>
To:	Miklos Szeredi <miklos@...redi.hu>
CC:	mszeredi@...e.cz, linux-kernel@...r.kernel.org,
	fuse-devel@...ts.sourceforge.net, polynomial-c@...too.org,
	akpm@...ux-foundation.org
Subject: Re: [fuse-devel] [PATCH] FUSE/CUSE: implement direct mmap support

Hello,

On 02/11/2010 06:51 PM, Miklos Szeredi wrote:
> And even a page_id is superfluous, since all we want is differentiate
> between possibly separate maps for the same file and don't care about
> individual pages.
> 
> And even differentiating between maps on the same file is only ever
> possible for char devs, normal files will only ever have a single map.
> 
> So instead of "page_id" it could just be a "map_id", which will be
> zero for normal maps, and whatever for /dev/fuse maps.

Well, not exactly.  There are device mmap() implementations which
simply ignore @offset because offsetting doesn't make any sense at
all.  ossp mmap is actually done that way.  I really don't think it
would be wise to impose such restriction at the kernel API level.  For
highlevel interface, dealing with separate regions could be fine tho.

>> And if the server wants to mmap /dev/fuse then it can do that and send
>> the result in "dev_offset", to make it clear that it's a different
>> offset from the one the client used on the mmap.  And it can even use
>> that value as page_id, if it wants to or it can use a different
>> page_id.
> 
> And there's a weakness in the current server side mmap interface, for
> example:
> 
>  1) user mmaps region 3-5 (in page index)
>       server maps this region at 3-5
> 
>  2) user mmaps region 1-7
>      server can't tell kernel that it wants to reuse region 3-5 but
>      wants to create two other regions
> 
> What happens in that case?

If the server wants the two regions to be separate, it can map it to
say 5-11 and returnt he offset of 5.  If it wants them to be shared,
it will have to mmap 1-2 and 6-7 and return offset of 1.  But, the
server should really know better than growing the area this way.  If
this type of expansion ever becomes problem, we can implement
expendable mmap on the server side (ie. don't require VM_DONT_EXPAND).

> On the other hand if the map_id is separate from the dev_offset, then
> the server can map the second region as one map and the kernel can
> connect it up with the right pages based on the map_id returned in the
> MMAP reply.

How is this not possible in the current implementation?

Thanks.

-- 
tejun
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ