[CRIU] [PATCH 1/2] compel: Don't BUG if exec area is too small

Cyrill Gorcunov gorcunov at gmail.com
Thu Dec 8 03:02:31 PST 2016


On Thu, Dec 08, 2016 at 01:47:52PM +0300, Pavel Emelyanov wrote:
> 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.

BUG is too aggressive: it can take plase when something terrible
happened and we can't proceed. In turn here we can simply exit out
with error code.


More information about the CRIU mailing list