> Then we need to have more control under user. Originally I thout that
> I can run several "user" processes and consume multiple amounts
> of kernel memory, and make a nice DOS, but I found that
> we have all allocated addresses in one static array, and when I
> started second instance of 'user' - BOOM! Reboot...
> Shouldn't we allow multiple execution of guests?
Of course. The current use of global variables is just a temporary
hack, this will need to be moved to --say-- a structure hanging off
the 'file' structure for the opened device node. This is probably
not much of a priority right now, however. (We should definitely
add a check, of course, so it doesn't crash but simply fails on the
second time.)
Generally speaking, the current kernel module is *not* safe to use.
What I meant to say is that it can be *made* safe, in fact safe
enough that no further safety checks are necessary in the user app.
> Then we need some way to restrict memory usage by guests of one user...
This is one of the safety checks we'll need to add. (This can be done
in the kernel module, of course.)
> > Ah, that is not enough. The point of the name change is that the
> > *contents* changed, too. The new vm_pgoff now contains a *page* number,
> Oops... missed that, and guess what?
[snip]
> And guest runs just fine... (need to comment out proc_[un]register, thou)
That's probably because the 'user' app calls mmap() only with the offset 0,
and page 0 happens to be the same as byte offset 0 ;-)
> patch-2.3.26 contains bunch of such lines (and similar):
> - addr += vma->vm_offset;
> + off = vma->vm_pgoff << PAGE_SHIFT;
> + addr += off;
> So, why we can't do the same?
Sure we can, but we want it to keep working on older kernels ...
I'm just wondering what's the best way to do this without adding
too many #ifdef's :-/
> Please change [EMAIL PROTECTED] to [EMAIL PROTECTED]
Done.
--
Ulrich Weigand,
IMMD 1, Universitaet Erlangen-Nuernberg,
Martensstr. 3, D-91058 Erlangen, Phone: +49 9131 85-7688