Re: p_vmspace in syscall

看板FB_hackers作者時間18年前 (2007/07/24 10:54), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/11 (看更多)
On Mon, 2 Jul 2007, Nicolas Cormier wrote: > I am trying to map some data allocated in kernel to a user process (via a > syscall). I need the proc's vmspace, but the value of p_vmspace of the input > proc argument is NULL ... How can I get a valid vmspace ? When operating in a system call, the 'td' argument to the system call function is the current thread pointer. You can follow td->td_proc to get to the current process (and therefore, its address space). In general, I prefer mapping user pages into kernel instead of kernel pages into user space, as it reduces the chances of leakage of kernel data to user space, and there are some useful primitives for making this easier. For example, take a look at the sf_buf infrastructure used for things like socket zero-copy send, which manages a temporary kernel mapping for a page. Robert N M Watson Computer Laboratory University of Cambridge _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
文章代碼(AID): #16fMdC00 (FB_hackers)
討論串 (同標題文章)
文章代碼(AID): #16fMdC00 (FB_hackers)