[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 2/2] linux-user: allocate heap memory for exe
From: |
P J P |
Subject: |
Re: [Qemu-devel] [PATCH v2 2/2] linux-user: allocate heap memory for execve arguments |
Date: |
Mon, 6 Mar 2017 23:36:07 +0530 (IST) |
+-- On Mon, 6 Mar 2017, Eric Blake wrote --+
| On 03/06/2017 01:17 AM, P J P wrote:
| > 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 <address@hidden>
| > ---
| > 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.
Yes, it seems to fix the issue. Still I think having ARG_MAX limit would be
good, as system exec(3) routines too impose _SC_ARG_MAX limit. I'll send a
revised patch with 'g_try_new' call instead of g_malloc0.
Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F