[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openvz-criu
Subject:    Re: [CRIU] [PATCH] bfd: avoid out-of-bound access
From:       Andrei Vagin <avagin () virtuozzo ! com>
Date:       2018-01-31 18:30:13
Message-ID: 20180131183011.GE12428 () outlook ! office365 ! com
[Download RAW message or body]

Applied
On Thu, Jan 25, 2018 at 04:46:59PM -0800, Andrei Vagin wrote:
> Write a nullbyte only if there is enought space for it.
> 
> Cc: Stephen Röttger <stephen.roettger@gmail.com>
> Reported-by: Stephen Röttger <stephen.roettger@gmail.com>
> Signed-off-by: Andrei Vagin <avagin@openvz.org>
> ---
>  criu/bfd.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/criu/bfd.c b/criu/bfd.c
> index 8269ab1a2..4d54543c7 100644
> --- a/criu/bfd.c
> +++ b/criu/bfd.c
> @@ -196,6 +196,10 @@ again:
>  		if (!b->sz)
>  			return NULL;
>  
> +		if (b->sz == BUFSIZE) {
> +			pr_err("The bfd buffer is too small\n");
> +			ERR_PTR(-EIO);
> +		}
>  		/*
>  		 * Last bytes may lack the \n at the
>  		 * end, need to report this as full
> -- 
> 2.13.6
> 
_______________________________________________
CRIU mailing list
CRIU@openvz.org
https://lists.openvz.org/mailman/listinfo/criu

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic