All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
Cc: Linux Containers <containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>
Subject: Re: [PATCH 1/1] cr: fix ckpt_obj_fetch return values
Date: Wed, 13 May 2009 13:43:58 -0500	[thread overview]
Message-ID: <20090513184358.GA20393@us.ibm.com> (raw)
In-Reply-To: <20090513165251.GA18539-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

Quoting Serge E. Hallyn (serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org):
> ckpt_obj_fetch returned ERR_PTR(error) on some failures, NULL on
> others.  Not all of its callers were checking for NULL, which
> would lead to NULL dereferences.
> 
> Return -EINVAL if the object is not in the hash table.  Fix up
> pipe_file_restore to do the right thing.
> 
> Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> ---
>  checkpoint/files.c   |    4 +---
>  checkpoint/memory.c  |    6 +-----
>  checkpoint/objhash.c |    2 +-
>  checkpoint/process.c |    4 +---
>  fs/pipe.c            |    9 ++++-----
>  5 files changed, 8 insertions(+), 17 deletions(-)
> 
> diff --git a/checkpoint/objhash.c b/checkpoint/objhash.c
> index 0ed7cac..7b26005 100644
> --- a/checkpoint/objhash.c
> +++ b/checkpoint/objhash.c
> @@ -692,7 +692,7 @@ void *ckpt_obj_fetch(struct ckpt_ctx *ctx, int objref, enum obj_type type)
> 
>  	obj = obj_find_by_objref(ctx, objref);
>  	if (!obj)
> -		return NULL;
> +		ERR_PTR(-EINVAL);

obvious bug here :)

-serge

      parent reply	other threads:[~2009-05-13 18:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-13 16:52 [PATCH 1/1] cr: fix ckpt_obj_fetch return values Serge E. Hallyn
     [not found] ` <20090513165251.GA18539-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-05-13 18:43   ` Serge E. Hallyn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090513184358.GA20393@us.ibm.com \
    --to=serue-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.