All of lore.kernel.org
 help / color / mirror / Atom feed
From: KaiGai Kohei <kaigai@kaigai.gr.jp>
To: Joshua Brindle <jbrindle@tresys.com>
Cc: KaiGai Kohei <kaigai@ak.jp.nec.com>,
	Stephen Smalley <sds@tycho.nsa.gov>,
	jmorris@namei.org, paul.moore@hp.com, selinux@tycho.nsa.gov
Subject: Re: [PATCH 3/3] Thread/Child-Domain Assignment (rev.6)
Date: Sat, 13 Sep 2008 08:20:22 +0900	[thread overview]
Message-ID: <48CAF936.1090009@kaigai.gr.jp> (raw)
In-Reply-To: <48CAB248.6060701@tresys.com>

[-- Attachment #1: Type: text/plain, Size: 4787 bytes --]

Joshua Brindle wrote:
> KaiGai Kohei wrote:
>> The attached patch for libsepol add suport for a new policy version
>> named as (MOD_)POLICYDB_VERSION_BOUNDARY.
>> Userspace hierarchy checks are reworked in this revision.
>>
>> FEATURES:
>>
>> - Boundary feature support:
>>  The upcoming kernel has a feature to define boundary relationship
>>  between two users, roles and types. It enables to restrict a bounded
>>  one can never have wider permissions than its bounds one.
>>  Any XXXX_datum_t structure have "u32 bounds" member to indicate its
>>  bounds, and we can handle it with the latest version of policy format
>>  provided by this patch.
>>
>> - Loading attributes into kernel space:
>>  The upcoming kernel also allows to load entries of attribute.
>>  The attached patch turn off to drop them, when it tries to write
>>  kernel policy with its version is equal or greater than
>>  POLICYDB_VERSION_BOUNDARY.
>>  Any entries of attribute has a property of TYPEDATUM_PROPERTY_ATTRIBUTE.
>>
>> - Improvement of type_datum format on kernel/modular policy.
>>  The type_datum entry has several its attribute fields like "primary",
>>  "flavor" and "flags", and these are stored within separated fields
>>  on-disk format. This patch enables to pack them into a single field.
>>  Currently four bits are defined, and rest of them are reserved.
>>    #define TYPEDATUM_PROPERTY_PRIMARY      0x0001
>>    #define TYPEDATUM_PROPERTY_ATTRIBUTE    0x0002
>>    #define TYPEDATUM_PROPERTY_ALIAS        0x0004  /* userspace only */
>>    #define TYPEDATUM_PROPERTY_PERMISSIVE   0x0008  /* userspace only */
>>
>> - Hierarchy checks are reworked
>>  The existing userspace hierarchy checks are reworked for the upcoming
>>  boundary feature. It can handle parent one based on both newer bounds
>>  relationship and existing name-based hierarchy.
>>
>>  In addition, I put a trick to evaluate conditional rules correctly.
>>  The following example shows a confusable case. A_t is the bounds of B_t,
>>  so B_t can never has wider permission than A_t.
>>
>>  Example)
>>    allow B_t X_t : file { read_file_perms };
>>    if (A_can_write_X) {
>>        allow A_t X_t : file { write_file_perms };
>>    } else {
>>        allow A_t X_t : file { read_file_perms };
>>    }
>>
>>  A_t's permissions on X_t is depend on the 'A_can_write_X', however,
>>  a part of them, like 'read', are unconditionally allowed.
>>  If we can find common permission on both of true/false lists, these
>>  are pulled up to unconditional rules.
>>  Thus, B_t's read permission on X_t is not hierarchy violated in the
>>  above example. It also matches the upcoming kernel behavior no need
>>  to say.
>>
> 
> Was this the latest patch? I can't seem to apply it either to the latest
> git HEAD or to the last svn revision:

Sorry, my Thunderbird translated any tabs into spaces.
The patch is made based on the latest subversion repository.
Can you apply the attached one correctly?

Thanks,

> [root@misterfreeze trunk]# patch -p0 --dry-run -F5< /root/selinux/patch                
> patching file libsepol/include/sepol/policydb/policydb.h
> Hunk #1 succeeded at 119 with fuzz 3.
> Hunk #2 FAILED at 146.
> Hunk #3 succeeded at 167 with fuzz 3.
> Hunk #4 FAILED at 607.
> Hunk #5 FAILED at 621.
> 3 out of 5 hunks FAILED -- saving rejects to file libsepol/include/sepol/policydb/policydb.h.rej
> patching file libsepol/src/policydb.c
> Hunk #1 succeeded at 110 with fuzz 3.
> Hunk #2 succeeded at 147 with fuzz 3.
> Hunk #3 succeeded at 182 with fuzz 3.
> Hunk #4 FAILED at 1873.
> Hunk #5 succeeded at 1947 with fuzz 3.
> Hunk #6 FAILED at 1962.
> Hunk #7 FAILED at 2338.
> 3 out of 7 hunks FAILED -- saving rejects to file libsepol/src/policydb.c.rej
> patching file libsepol/src/hierarchy.c
> Hunk #1 FAILED at 1.
> Hunk #2 FAILED at 46.
> Hunk #3 FAILED at 125.
> Hunk #4 FAILED at 157.
> Hunk #5 FAILED at 335.
> Hunk #6 FAILED at 402.
> Hunk #7 FAILED at 428.
> Hunk #8 succeeded at 467 with fuzz 3.
> 7 out of 8 hunks FAILED -- saving rejects to file libsepol/src/hierarchy.c.rej
> patching file libsepol/src/expand.c
> Hunk #1 succeeded at 466 with fuzz 3.
> Hunk #2 succeeded at 1959 with fuzz 3.
> Hunk #3 succeeded at 2462 with fuzz 3.
> Hunk #4 succeeded at 2480 with fuzz 3.
> Hunk #5 succeeded at 2498 with fuzz 3.
> Hunk #6 succeeded at 2590 with fuzz 3.
> patching file libsepol/src/write.c
> Hunk #1 succeeded at 920 with fuzz 3.
> Hunk #2 FAILED at 954.
> Hunk #3 succeeded at 1031 with fuzz 3.
> 1 out of 3 hunks FAILED -- saving rejects to file libsepol/src/write.c.rej
> patching file libsepol/src/link.c
> Hunk #1 succeeded at 660 with fuzz 3.
> Hunk #2 FAILED at 1453.
> 1 out of 2 hunks FAILED -- saving rejects to file libsepol/src/link.c.rej
> 


-- 
KaiGai Kohei <kaigai@kaigai.gr.jp>

[-- Attachment #2: thread-context-libsepol.6.patch --]
[-- Type: application/octect-stream, Size: 34663 bytes --]

  reply	other threads:[~2008-09-12 23:20 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-15 10:06 [RFC] An idea of thread/child-domain assignment KaiGai Kohei
2008-07-15 13:38 ` Stephen Smalley
2008-07-16  2:17   ` KaiGai Kohei
2008-07-16  6:08     ` KaiGai Kohei
2008-07-16 12:00       ` Stephen Smalley
2008-07-16 12:18     ` Stephen Smalley
2008-07-18  6:21       ` KaiGai Kohei
2008-07-23  3:58         ` KaiGai Kohei
2008-07-25 12:51           ` [PATCH 0/3] Thread/Child-Domain Assignment KaiGai Kohei
2008-07-25 13:03             ` [PATCH 1/3] " KaiGai Kohei
2008-07-25 13:44               ` Stephen Smalley
2008-07-25 17:06                 ` Joshua Brindle
2008-07-26  8:24                   ` KaiGai Kohei
2008-07-25 17:07                 ` Joshua Brindle
2008-07-26  7:55                 ` KaiGai Kohei
2008-07-26 17:28                   ` Stephen Smalley
2008-07-26 18:14                     ` Joshua Brindle
2008-07-28  3:06                       ` KaiGai Kohei
2008-07-28 17:31                       ` Stephen Smalley
2008-07-29  6:51                         ` KaiGai Kohei
2008-07-29 12:06                           ` Stephen Smalley
2008-07-30 14:10                             ` Joshua Brindle
2008-07-30 14:57                               ` Stephen Smalley
2008-08-01  6:26                             ` KaiGai Kohei
2008-07-25 13:03             ` [PATCH 2/3] " KaiGai Kohei
2008-07-29  7:15               ` KaiGai Kohei
2008-07-29 12:25                 ` Scott Schmit
2008-07-29 13:28                   ` Stephen Smalley
2008-07-25 13:04             ` [PATCH 3/3] " KaiGai Kohei
2008-07-25 13:04             ` [PATCH 4/3] " KaiGai Kohei
2008-08-05  5:47             ` [PATCH 0/3] Thread/Child-Domain Assignment (rev.2) KaiGai Kohei
2008-08-05  5:55               ` [PATCH 1/3] " KaiGai Kohei
2008-08-05 12:53                 ` Stephen Smalley
2008-08-06 10:05                   ` KaiGai Kohei
2008-08-06 10:13                   ` [PATCH 1/3] Thread/Child-Domain Assignment (rev.3) KaiGai Kohei
2008-08-14  7:38                     ` [PATCH 1/3] Thread/Child-Domain Assignment (rev.4) KaiGai Kohei
2008-08-15 18:13                       ` Stephen Smalley
2008-08-20  9:41                         ` KaiGai Kohei
2008-08-25 12:32                         ` [PATCH 1/3] Thread/Child-Domain Assignment (rev.6) KaiGai Kohei
2008-08-25 12:57                           ` Stephen Smalley
2008-08-25 13:45                             ` KaiGai Kohei
2008-08-26  7:11                             ` KaiGai Kohei
2008-08-26  9:01                           ` James Morris
2008-08-26 10:29                           ` James Morris
2008-08-26 10:47                             ` James Morris
2008-08-27  1:15                               ` KaiGai Kohei
2008-08-27  8:04                               ` [LTP][PATCH 1/2] Replacement of deprecated interfaces KaiGai Kohei
2008-08-27 12:14                                 ` Stephen Smalley
2008-08-28  6:26                                   ` KaiGai Kohei
2008-08-28 12:10                                     ` Subrata Modak
2008-08-28 12:52                                       ` KaiGai Kohei
2008-08-28 13:34                                         ` Subrata Modak
2008-10-23  9:48                                     ` Subrata Modak
2008-08-27  8:05                               ` [LTP][PATCH 2/2] Add a new test case for bounds types KaiGai Kohei
2008-10-22 13:00                                 ` Subrata Modak
2008-10-23  8:10                                   ` KaiGai Kohei
2008-10-23  9:30                                     ` Subrata Modak
2008-08-27  1:11                             ` [PATCH 1/3] Thread/Child-Domain Assignment (rev.6) KaiGai Kohei
2008-08-28  7:35                             ` [PATCH] SELinux: add boundary support and thread context assignment KaiGai Kohei
2008-08-28 12:43                               ` Stephen Smalley
2008-08-28 15:06                               ` James Morris
2008-08-05  5:55               ` [PATCH 2/3] Thread/Child-Domain Assignment (rev.2) KaiGai Kohei
2008-08-06 10:14                 ` [PATCH 2/3] Thread/Child-Domain Assignment (rev.3) KaiGai Kohei
2008-10-09 17:10                 ` [PATCH 2/3] Thread/Child-Domain Assignment (rev.2) Joshua Brindle
2008-10-10  1:19                   ` KaiGai Kohei
2008-10-10  1:22                     ` Joshua Brindle
2008-08-05  5:55               ` [PATCH 3/3] " KaiGai Kohei
2008-08-06 10:13                 ` [PATCH 3/3] Thread/Child-Domain Assignment (rev.3) KaiGai Kohei
2008-08-25 12:32                 ` [PATCH 3/3] Thread/Child-Domain Assignment (rev.4) KaiGai Kohei
2008-08-28 15:51                   ` Joshua Brindle
2008-08-29  1:54                     ` KaiGai Kohei
2008-08-29  3:01                       ` Joshua Brindle
2008-09-01  6:26                         ` KaiGai Kohei
2008-09-01  9:08                           ` [PATCH] libsepol : Add support for a new policy version (POLICYDB_VERSION_BOUNDARY) KaiGai Kohei
2008-09-01 14:47                           ` [PATCH 3/3] Thread/Child-Domain Assignment (rev.4) Joshua Brindle
2008-09-01 16:11                             ` KaiGai Kohei
2008-09-09  2:04                               ` [PATCH 3/3] Thread/Child-Domain Assignment (rev.6) KaiGai Kohei
2008-09-12 18:17                                 ` Joshua Brindle
2008-09-12 23:20                                   ` KaiGai Kohei [this message]
2008-09-15 13:44                                     ` Joshua Brindle
2008-09-16  1:50                                       ` KaiGai Kohei
2008-09-30 14:00                                     ` Joshua Brindle
2008-10-01  7:53                                       ` KaiGai Kohei
2008-10-01 19:56                                         ` Joshua Brindle
2008-10-04 23:30                                         ` Joshua Brindle
2008-10-06  9:19                                           ` KaiGai Kohei
2008-10-06 19:13                                             ` Joshua Brindle
2008-10-07  6:39                                               ` KaiGai Kohei
2008-10-09 15:30                                                 ` Joshua Brindle
2008-10-09 17:00                                                   ` Joshua Brindle
2008-10-10  0:57                                                   ` KaiGai Kohei
2008-10-09 17:11                                                 ` Joshua Brindle
2008-10-06 12:30                                           ` Stephen Smalley
2008-10-06 19:13                                             ` Joshua Brindle
2008-08-11 17:58               ` [PATCH 0/3] Thread/Child-Domain Assignment (rev.2) Joshua Brindle
2008-08-13  5:53                 ` KaiGai Kohei
2008-08-14  8:55             ` A toy of SQL injection (Re: [PATCH 0/3] Thread/Child-Domain Assignment) KaiGai Kohei

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=48CAF936.1090009@kaigai.gr.jp \
    --to=kaigai@kaigai.gr.jp \
    --cc=jbrindle@tresys.com \
    --cc=jmorris@namei.org \
    --cc=kaigai@ak.jp.nec.com \
    --cc=paul.moore@hp.com \
    --cc=sds@tycho.nsa.gov \
    --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.