Linux Container Development
 help / color / mirror / Atom feed
From: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
To: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: Linux Containers <containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>
Subject: Re: [PATCH linux-cr urgent] lsm: fix unlabeled restore case.
Date: Sun, 14 Mar 2010 22:50:37 -0400	[thread overview]
Message-ID: <4B9DA07D.8020402@cs.columbia.edu> (raw)
In-Reply-To: <20100312204706.GA408-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>


This is already in v20-rc1.

Oren

Serge E. Hallyn wrote:
> If an object is being restored which was checkpointed without an
> LSM label, then we should return 0 BEFORE we try to ckpt_obj_fetch
> a -1 objref (and obviously return error).
> 
> This makes the msg cr_tests ipc testcase fail if, for instance,
> CONFIG_SECURITY=y but no LSM is active.
> 
> IMO this definately should be in the tree that gets sent out...
> 
> Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> ---
>  security/security.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/security/security.c b/security/security.c
> index 2b147cf..4b3f932 100644
> --- a/security/security.c
> +++ b/security/security.c
> @@ -1528,14 +1528,14 @@ int security_restore_obj(struct ckpt_ctx *ctx, void *v, int sectype,
>  		if (sectype != CKPT_SECURITY_MSG_MSG)
>  			return 0;
>  
> -	l = ckpt_obj_fetch(ctx, secref, CKPT_OBJ_SECURITY);
> -	if (IS_ERR(l))
> -		return PTR_ERR(l);
> -
>  	/* return if checkpointed label was "Not Applicable" */
>  	if (secref == SECURITY_CTX_NONE)
>  		return 0;
>  
> +	l = ckpt_obj_fetch(ctx, secref, CKPT_OBJ_SECURITY);
> +	if (IS_ERR(l))
> +		return PTR_ERR(l);
> +
>  	/* Ask the LSM to apply a void*security to the object
>  	 * based on the checkpointed context string */
>  	switch (sectype) {

      parent reply	other threads:[~2010-03-15  2:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-12 20:47 [PATCH linux-cr urgent] lsm: fix unlabeled restore case Serge E. Hallyn
     [not found] ` <20100312204706.GA408-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-15  2:50   ` Oren Laadan [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=4B9DA07D.8020402@cs.columbia.edu \
    --to=orenl-eqauephvms7envbuuze7ea@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=serue-r/Jw6+rmf7HQT0dZR+AlfA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox