malloc pages map to user space

Eric Saint-Etienne eric.saintetienne at gmail.com
Thu Mar 22 14:42:54 UTC 2012


> By using kernel_map instead of kmem_map, vm_map_lookup() now always
> return a vm_object. That's a big progress.
> As expected, when this object is kmem_object, the user mapping works
> fine (for smaller or larger mallocs.)
>
> Otherwise that object doesn't match kernel_object. It's an anonymous
> object to me.
> Using that "anonymous" vm_object for mapping into user map (using
> vm_map_find()) doesn't directly fail,
> it does provide a virtual address in the user map. However I read
> zeros at that address, from within the user process.

Actually when using kernel_map, the object returned is NULL! However the
the vm_entry_t it returns seems a valid address, its 'object' field is NULL
too (that's consistent)
That's the reason why I didn't find it in any existing 'puclic' map (such as
kernel_map, buffers_map, kmem_map, exec_map or pipe_map)

But a NULL object isn't good at anything and I'm not sure what to do with
a vm_entry_t only... Any idea how to insert it in the process map?


More information about the freebsd-hackers mailing list