Re: kiobugs in 2.3.48

From: V Ganesh (ganesh@veritas.com)
Date: Thu Mar 02 2000 - 01:23:19 EST


> > it used to be MAP_NR(page) earlier which was of course wrong. but
> > vaddr can come from userspace (read/write a raw device),
>
> It should be quite safe. kiobufs should always refer to kernel
> addresses, not user addresses. If you do a map_user_kiobuf(), the user
> pages will already have been converted into kernel virtual addresses and
> the appropriate pages pinned in memory. (That's what the follow_page()
> is for before map_user_kiobuf calls get_page_map().)

we do
map = follow_page(ptr);
to convert the userspace vaddr to a struct page *. right ?
where is it converted to a kernel virtual address ? if ptr already was a
kernel address, then we should have simply done
map = mem_map + MAP_NR(ptr).

then we do
map = get_page_map(map, ptr);
and now we pass this to get_page_map() which promptly returns 0, so
map = 0.

it's quite easy to hit this, just try reading a raw device.

ganesh

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Mar 07 2000 - 21:00:11 EST