Subject: Re: Adding a size parameter to stackgap_init()
To: None <tech-kern@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: tech-kern
Date: 03/17/2002 17:40:59
In article <1f96zpg.sc34yt12s6gcjM@[10.0.12.137]>,
Emmanuel Dreyfus <manu@netbsd.org> wrote:
>> > 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.
>

could be that we can modify the stackgap functions to allocate space below
the current user's stack pointer...

christos