Re: [PATCH v2] linux-user: ppoll: eliminate large alloca

2023-08-24 Thread Philippe Mathieu-Daudé
On 24/8/23 19:51, Michael Tokarev wrote: do_ppoll() in linux-user/syscall.c uses alloca() to allocate an array of struct pullfds on the stack. The only upper boundary for number of entries for this array is so that whole thing fits in INT_MAX. But this is definitely too much for a stack allocatio

[PATCH v2] linux-user: ppoll: eliminate large alloca

2023-08-24 Thread Michael Tokarev
do_ppoll() in linux-user/syscall.c uses alloca() to allocate an array of struct pullfds on the stack. The only upper boundary for number of entries for this array is so that whole thing fits in INT_MAX. But this is definitely too much for a stack allocation. Use heap allocation instead. This, tog