All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ondrej Mosnacek <omosnace@redhat.com>
To: selinux@vger.kernel.org
Cc: "Dominick Grift" <dominick.grift@defensec.nl>,
	"Christian Göttsche" <cgzones@googlemail.com>
Subject: [PATCH userspace v2 0/2] Support the 'self' keyword in type transitions
Date: Tue, 26 Apr 2022 12:51:16 +0200	[thread overview]
Message-ID: <20220426105118.506847-1-omosnace@redhat.com> (raw)

With the addition of the anon_inode class in the kernel, 'self'
transition rules became useful, but haven't been implemented.

This series implements the self keyword support in the CIL & TE
languages and the module policydb format. The kernel policydb format
doesn't need any changes, as type transitions are always expanded in the
kernel policydb.

The patches have been tested using the following WIP beakerlib/tmt test:
https://src.fedoraproject.org/fork/omos/tests/selinux/blob/self-in-tt/f/libsepol/self-keyword-in-type-transitions

Changes in v2:
- validate the flags member of filename_trans_rule_t in
  policy_validate.c (Christian Göttsche)
- add missing error check in filename_trans_rule_write()
  (Christian Göttsche)

Ondrej Mosnacek (2):
  libsepol/cil: add support for self keyword in type transitions
  libsepol,checkpolicy: add support for self keyword in type transitions

 checkpolicy/policy_define.c                |  42 +++++-
 libsepol/cil/src/cil_binary.c              | 168 +++++++++++++++------
 libsepol/cil/src/cil_resolve_ast.c         |  25 ++-
 libsepol/include/sepol/policydb/policydb.h |   4 +-
 libsepol/src/expand.c                      |  69 ++++++---
 libsepol/src/link.c                        |   1 +
 libsepol/src/module_to_cil.c               |  30 ++--
 libsepol/src/policydb.c                    |  33 +++-
 libsepol/src/policydb_validate.c           |   4 +
 libsepol/src/write.c                       |  19 ++-
 secilc/test/policy.cil                     |   3 +
 11 files changed, 298 insertions(+), 100 deletions(-)

-- 
2.35.1


             reply	other threads:[~2022-04-26 10:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-26 10:51 Ondrej Mosnacek [this message]
2022-04-26 10:51 ` [PATCH userspace v2 1/2] libsepol/cil: add support for self keyword in type transitions Ondrej Mosnacek
2022-04-26 10:51 ` [PATCH userspace v2 2/2] libsepol,checkpolicy: " Ondrej Mosnacek
2022-04-27 15:22   ` James Carter
2022-04-28 19:23   ` James Carter
2022-05-06 13:49     ` Ondrej Mosnacek
2022-05-06 15:42       ` James Carter
2022-05-09  9:27         ` Ondrej Mosnacek

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=20220426105118.506847-1-omosnace@redhat.com \
    --to=omosnace@redhat.com \
    --cc=cgzones@googlemail.com \
    --cc=dominick.grift@defensec.nl \
    --cc=selinux@vger.kernel.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.