On 03/06/2017 09:53 AM, Eric Blake wrote: > On 03/06/2017 01:17 AM, P J P wrote: >> From: Prasad J Pandit <p...@fedoraproject.org> >> >> Arguments passed to execve(2) call from user program could >> be large, allocating stack memory for them via alloca(3) call >> would lead to bad behaviour. Use 'g_malloc0' to allocate memory >> for such arguments. >> >> Signed-off-by: Prasad J Pandit <p...@fedoraproject.org> >> --- >> linux-user/syscall.c | 7 +++++-- >> 1 file changed, 5 insertions(+), 2 deletions(-) > > Is this patch alone (without 1/2) sufficient to solve the problem? If > so, then drop 1/2. > >> >> Update per: replace alloca() with g_malloc0() >> -> https://lists.gnu.org/archive/html/qemu-devel/2017-03/msg00750.html >> >> diff --git a/linux-user/syscall.c b/linux-user/syscall.c >> index 86a4a9c..404fb0b 100644 >> --- a/linux-user/syscall.c >> +++ b/linux-user/syscall.c >> @@ -7800,8 +7800,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long >> arg1, > > What version of qemu are you patching? Line 7800 of current master is > nowhere near 'case TARGET_NR_execve:' (line 7899) > >> ret = -TARGET_E2BIG; >> break; >> } > > and current master has 'goto efault' rather than directly setting ret at > this point.
Okay, I see that this context came from patch 1/2. Sorry for the noise (I was trying to review this patch in isolation, since I've already argued that 1/2 is probably not necessary). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature