All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Brindle <jbrindle@tresys.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: SELinux <SELinux@tycho.nsa.gov>
Subject: Re: [PATCH] libsepol - cond_expr mapping and package num_sections bugs
Date: Mon, 30 Jan 2006 14:27:59 -0500	[thread overview]
Message-ID: <43DE68BF.5060201@tresys.com> (raw)
In-Reply-To: <1138647067.7076.160.camel@moss-spartans.epoch.ncsc.mil>

Stephen Smalley wrote:
> On Fri, 2006-01-27 at 16:16 -0500, Stephen Smalley wrote:
> 
>>This seems prone to similar bugs later.  Suppose I call
>>sepol_module_package_set_file_contexts multiple times; each time it
>>frees the old one and replaces it, so I shouldn't be incrementing the
>>number of sections here.
>>
>>Possibly num_sections shouldn't be part of the state of the struct at
>>all; it should just be a local variable.  In the read case, we pull it
>>from the image/file and use it locally (just need to pass it back from
>>read_offsets to the caller).  For write, we always start with a count of
>>1 and increment it if we have a p->file_contexts.
> 
> 
> How about the patch below instead?

ah! this is very close to a patch I was getting ready to send you, looks 
good to me, should solve the problem.

Btw, also getting ready to send a patch that adds 2 new sections to the 
package format so we'll see how flexible this really is then.

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  reply	other threads:[~2006-01-30 19:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-27 20:55 [PATCH] libsepol - cond_expr mapping and package num_sections bugs Joshua Brindle
2006-01-27 21:16 ` Stephen Smalley
2006-01-30 18:51   ` Stephen Smalley
2006-01-30 19:27     ` Joshua Brindle [this message]
2006-01-30 20:22       ` Stephen Smalley

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=43DE68BF.5060201@tresys.com \
    --to=jbrindle@tresys.com \
    --cc=SELinux@tycho.nsa.gov \
    --cc=sds@tycho.nsa.gov \
    /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.