xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	dgdegra@tycho.nsa.gov
Subject: Re: [PATCH 1/4] flask: fix memory leaks
Date: Fri, 7 Feb 2014 12:51:44 +0000	[thread overview]
Message-ID: <52F4D6E0.60305@citrix.com> (raw)
In-Reply-To: <52F4B99C020000780011A1EE@nat28.tlf.novell.com>


[-- Attachment #1.1: Type: text/plain, Size: 1264 bytes --]

On 07/02/14 09:46, Jan Beulich wrote:
> Plus, in the case of security_preserve_bools(), prevent double freeing
> in the case of security_get_bools() failing.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
> --- a/xen/xsm/flask/flask_op.c
> +++ b/xen/xsm/flask/flask_op.c
> @@ -347,6 +347,7 @@ static int flask_security_set_bool(struc
>  
>          if ( arg->bool_id >= num )
>          {
> +            xfree(values);
>              rv = -ENOENT;
>              goto out;
>          }
> --- a/xen/xsm/flask/ss/services.c
> +++ b/xen/xsm/flask/ss/services.c
> @@ -1902,6 +1902,7 @@ err:
>      {
>          for ( i = 0; i < *len; i++ )
>              xfree((*names)[i]);
> +        xfree(*names);
>      }
>      xfree(*values);
>      goto out;
> @@ -2011,7 +2012,7 @@ static int security_preserve_bools(struc
>  
>      rc = security_get_bools(&nbools, &bnames, &bvalues, NULL);
>      if ( rc )
> -        goto out;
> +        return rc;
>      for ( i = 0; i < nbools; i++ )
>      {
>          booldatum = hashtab_search(p->p_bools.table, bnames[i]);
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


[-- Attachment #1.2: Type: text/html, Size: 2147 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2014-02-07 12:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-07  9:41 [PATCH 0/4] flask: XSA-84 follow-ups Jan Beulich
2014-02-07  9:46 ` [PATCH 1/4] flask: fix memory leaks Jan Beulich
2014-02-07 12:51   ` Andrew Cooper [this message]
2014-02-07  9:47 ` [PATCH 2/4] flask: fix error propagation from flask_security_set_bool() Jan Beulich
2014-02-07 12:56   ` Andrew Cooper
2014-02-07 13:04     ` Jan Beulich
2014-02-07 13:07       ` Andrew Cooper
2014-02-07  9:47 ` [PATCH 3/4] flask: check permissions first thing in flask_security_set_bool() Jan Beulich
2014-02-07 12:57   ` Andrew Cooper
2014-02-07  9:48 ` [PATCH 4/4] flask: add compat mode guest support Jan Beulich
2014-02-07 11:29 ` [PATCH 0/4] flask: XSA-84 follow-ups George Dunlap
2014-02-10 20:22 ` Daniel De Graaf
2014-02-11  8:02   ` Jan Beulich

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=52F4D6E0.60305@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=xen-devel@lists.xenproject.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;
as well as URLs for NNTP newsgroup(s).