[CRIU] [PATCH 1/2] compel: Don't BUG if exec area is too small
Pavel Emelyanov
xemul at virtuozzo.com
Thu Dec 8 02:47:52 PST 2016
On 12/06/2016 12:15 AM, Cyrill Gorcunov wrote:
> Simply return MAP_FAILED here.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
> compel/src/lib/infect.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/compel/src/lib/infect.c b/compel/src/lib/infect.c
> index adef4db9e30e..fd92ee5d1da6 100644
> --- a/compel/src/lib/infect.c
> +++ b/compel/src/lib/infect.c
> @@ -1008,8 +1008,10 @@ static unsigned long find_executable_area(int pid)
>
> /* f now points at " rwx" (yes, with space) part */
> if (f[3] == 'x') {
> - BUG_ON(end - start < PARASITE_START_AREA_MIN);
I'd still BUG here, the PARASITE_START_AREA_MIN is less than 1k. No VMAs can
be of that size.
> - ret = start;
> + if ((end - start) >= PARASITE_START_AREA_MIN)
> + ret = start;
> + else
> + pr_err("No sutable area found to run syscalls\n");
> break;
> }
> }
>
More information about the CRIU
mailing list