From: Stephen Smalley <sds@tycho.nsa.gov>
To: Richard Haines <richard_c_haines@btinternet.com>
Cc: "selinux@tycho.nsa.gov" <selinux@tycho.nsa.gov>,
Paul Moore <paul@paul-moore.com>, Eric Paris <eparis@redhat.com>
Subject: Re: SELinux: Update policy version to support constraints info
Date: Thu, 31 Oct 2013 10:28:45 -0400 [thread overview]
Message-ID: <5272691D.3020503@tycho.nsa.gov> (raw)
In-Reply-To: <1383228520.10830.YahooMailNeo@web87902.mail.ir2.yahoo.com>
On 10/31/2013 10:08 AM, Richard Haines wrote:
> Here is my go at another kernel patch. I've done most of what you asked
> except I could not work out this comment:
>
> "Couldn't we avoid the need for passing down the policydb and checking
> the version just by ensuring e->type_names gets initialized to NULL and
> then the type_set_destroy() and kfree() calls degenerate to no-ops? I
> suppose this works, but it complicates the code a bit."
In the prior patch, you changed cls_destroy() to extract the policydb
from the void* argument and check the p->policyvers to decide whether or
not to free e->type_names. I pointed out that if you always initialize
it to NULL (which I think you get for free by virtue of the kazalloc of
the constraint_expr), then you can unconditionally free it. In this
patch, it appears you switched to unconditionally calling
constraint_expr_destroy() but you still have the change to pass p
(policydb) to the hashtab_map(p->symtab[i].table, destroy_f[i], p);
Which I don't believe you need anymore. Right? That was my point.
You can abbreviate if (a != NULL) as if (a).
./scripts/checkpatch.pl has some complaints about your line lengths.
Those aren't mandatory but consider whether you can fix them without
making the code ugly.
Try to post the patch in a fresh message with the patch inlined if
possible or send directly via git-send-email for easier commenting
inline and application.
--
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.
prev parent reply other threads:[~2013-10-31 14:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-21 23:32 SELinux: Update policy version to support constraints info Eric Paris
2013-10-22 12:43 ` Stephen Smalley
2013-10-24 10:22 ` Richard Haines
2013-10-24 18:36 ` Paul Moore
2013-10-24 18:59 ` Stephen Smalley
2013-10-24 20:39 ` Stephen Smalley
2013-10-30 20:27 ` Stephen Smalley
2013-10-31 14:08 ` Richard Haines
2013-10-31 14:28 ` Stephen Smalley [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=5272691D.3020503@tycho.nsa.gov \
--to=sds@tycho.nsa.gov \
--cc=eparis@redhat.com \
--cc=paul@paul-moore.com \
--cc=richard_c_haines@btinternet.com \
--cc=selinux@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.