Subject: Re: Adding a size parameter to stackgap_init()
To: Jaromir Dolecek <jdolecek@netbsd.org>
From: Emmanuel Dreyfus <manu@netbsd.org>
List: tech-kern
Date: 03/17/2002 13:51:41
> > I'm running out of idea about how to handle this problem. Maybe store
> > temporary data somewhere else? Or just make it bigger and hope we never
> > hit a case where it does not fit?
> The latter. Since you control when the stackgap is used, it's not
> possible for it to overflow randomly or unexpectedly.

The problem with swapctl(2) emulation is that there is no bound to the
requiered space. You need 1048 byte per swap object, else the system
call will fail (EINVAL).

I though about it, maybe the best way is splitting sys_swapctl in two
functions: sys_swapctl() which will handle argument copy from/to
userspace, and sys_swapctl1(), which will actually implement the
functionnality.

irix_sys_swapctl() would copyin, call sys_swapctl1(), translate the
result, and copyout. That way we would avoid using some temporary user
space storage with an unbound length.

-- 
Emmanuel Dreyfus.
Si la reponse est NT, c'est probablement 
que vous n'avez pas compris la question.
manu@netbsd.org