Re: [PATCH] Add user taint flag

From: Nick Piggin
Date: Mon May 22 2006 - 19:48:44 EST


Theodore Tso wrote:


+struct page *rmem_vma_nopage(struct vm_area_struct *vma,
+ unsigned long address, int *type)
+{
+ struct page *pageptr;
+ unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
+ unsigned long physaddr = address - vma->vm_start + offset;
+ unsigned long pageframe = physaddr >> PAGE_SHIFT;
+
+ if (!pfn_valid(pageframe))
+ return NOPAGE_SIGBUS;
+ pageptr = pfn_to_page(pageframe);
+ get_page(pageptr);
+ if (type)
+ *type = VM_FAULT_MINOR;
+ return pageptr;
+}


This won't work because struct page could easily be a free page.

I think /dev/mem should be able to remap physical memory now that
PG_reserved is gone.

--

Send instant messages to your online friends http://au.messenger.yahoo.com -
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/