03 Apr, 2009

1 commit

  • There is nothing special that has to be protected by cgroup_lock,
    so introduce devcgroup_mtuex for it's own use.

    Signed-off-by: Li Zefan
    Cc: Paul Menage
    Acked-by: Serge Hallyn
    Cc: Balbir Singh
    Cc: KAMEZAWA Hiroyuki
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Li Zefan
     

28 Mar, 2009

5 commits

  • This patch adds a new special option '-CIPSO' to the Smack subsystem. When used
    in the netlabel list, it means "use CIPSO networking". A use case is when your
    local network speaks CIPSO and you want also to connect to the unlabeled
    Internet. This patch also add some documentation describing that. The patch
    also corrects an oops when setting a '' SMACK64 xattr to a file.

    Signed-off-by: Etienne Basset
    Signed-off-by: Paul Moore
    Acked-by: Casey Schaufler
    Signed-off-by: James Morris

    Etienne Basset
     
  • This patch cleans up a lot of the Smack network access control code. The
    largest changes are to fix the labeling of incoming TCP connections in a
    manner similar to the recent SELinux changes which use the
    security_inet_conn_request() hook to label the request_sock and let the label
    move to the child socket via the normal network stack mechanisms. In addition
    to the incoming TCP connection fixes this patch also removes the smk_labled
    field from the socket_smack struct as the minor optimization advantage was
    outweighed by the difficulty in maintaining it's proper state.

    Signed-off-by: Paul Moore
    Acked-by: Casey Schaufler
    Signed-off-by: James Morris

    Paul Moore
     
  • The socket_post_accept() hook is not currently used by any in-tree modules
    and its existence continues to cause problems by confusing people about
    what can be safely accomplished using this hook. If a legitimate need for
    this hook arises in the future it can always be reintroduced.

    Signed-off-by: Paul Moore
    Signed-off-by: James Morris

    Paul Moore
     
  • The SELinux "compat_net" is marked as deprecated, the time has come to
    finally remove it from the kernel. Further code simplifications are
    likely in the future, but this patch was intended to be a simple,
    straight-up removal of the compat_net code.

    Signed-off-by: Paul Moore
    Signed-off-by: James Morris

    Paul Moore
     
  • The current NetLabel/SELinux behavior for incoming TCP connections works but
    only through a series of happy coincidences that rely on the limited nature of
    standard CIPSO (only able to convey MLS attributes) and the write equality
    imposed by the SELinux MLS constraints. The problem is that network sockets
    created as the result of an incoming TCP connection were not on-the-wire
    labeled based on the security attributes of the parent socket but rather based
    on the wire label of the remote peer. The issue had to do with how IP options
    were managed as part of the network stack and where the LSM hooks were in
    relation to the code which set the IP options on these newly created child
    sockets. While NetLabel/SELinux did correctly set the socket's on-the-wire
    label it was promptly cleared by the network stack and reset based on the IP
    options of the remote peer.

    This patch, in conjunction with a prior patch that adjusted the LSM hook
    locations, works to set the correct on-the-wire label format for new incoming
    connections through the security_inet_conn_request() hook. Besides the
    correct behavior there are many advantages to this change, the most significant
    is that all of the NetLabel socket labeling code in SELinux now lives in hooks
    which can return error codes to the core stack which allows us to finally get
    ride of the selinux_netlbl_inode_permission() logic which greatly simplfies
    the NetLabel/SELinux glue code. In the process of developing this patch I
    also ran into a small handful of AF_INET6 cleanliness issues that have been
    fixed which should make the code safer and easier to extend in the future.

    Signed-off-by: Paul Moore
    Acked-by: Casey Schaufler
    Signed-off-by: James Morris

    Paul Moore
     

27 Mar, 2009

1 commit


26 Mar, 2009

1 commit


24 Mar, 2009

1 commit


10 Mar, 2009

1 commit

  • Drop the printk message when an inode is found without an associated
    dentry. This should only happen when userspace can't be accessing those
    inodes and those labels will get set correctly on the next d_instantiate.
    Thus there is no reason to send this message.

    Signed-off-by: Eric Paris
    Signed-off-by: James Morris

    Eric Paris
     

06 Mar, 2009

2 commits

  • New selinux permission to separate the ability to turn on tty auditing from
    the ability to set audit rules.

    Signed-off-by: Eric Paris
    Acked-by: Stephen Smalley
    Signed-off-by: James Morris

    Eric Paris
     
  • When I did open permissions I didn't think any sockets would have an open.
    Turns out AF_UNIX sockets can have an open when they are bound to the
    filesystem namespace. This patch adds a new SOCK_FILE__OPEN permission.
    It's safe to add this as the open perms are already predicated on
    capabilities and capabilities means we have unknown perm handling so
    systems should be as backwards compatible as the policy wants them to
    be.

    https://bugzilla.redhat.com/show_bug.cgi?id=475224

    Signed-off-by: Eric Paris
    Acked-by: Stephen Smalley
    Signed-off-by: James Morris

    Eric Paris
     

05 Mar, 2009

2 commits

  • The following patch (against 2.6.29rc5) fixes a few issues in the
    smack/netlabel "unlabeled host support" functionnality that was added in
    2.6.29rc. It should go in before -final.

    1) smack_host_label disregard a "0.0.0.0/0 @" rule (or other label),
    preventing 'tagged' tasks to access Internet (many systems drop packets with
    IP options)

    2) netmasks were not handled correctly, they were stored in a way _not
    equivalent_ to conversion to be32 (it was equivalent for /0, /8, /16, /24,
    /32 masks but not other masks)

    3) smack_netlbladdr prefixes (IP/mask) were not consistent (mask&IP was not
    done), so there could have been different list entries for the same IP
    prefix; if those entries had different labels, well ...

    4) they were not sorted

    1) 2) 3) are bugs, 4) is a more cosmetic issue.
    The patch :

    -creates a new helper smk_netlbladdr_insert to insert a smk_netlbladdr,
    -sorted by netmask length

    -use the new sorted nature of smack_netlbladdrs list to simplify
    smack_host_label : the first match _will_ be the more specific

    -corrects endianness issues in smk_write_netlbladdr & netlbladdr_seq_show

    Signed-off-by:
    Acked-by: Casey Schaufler
    Reviewed-by: Paul Moore
    Signed-off-by: James Morris

    etienne
     
  • The following patch (against 2.6.29rc5) fixes a few issues in the
    smack/netlabel "unlabeled host support" functionnality that was added in
    2.6.29rc. It should go in before -final.

    1) smack_host_label disregard a "0.0.0.0/0 @" rule (or other label),
    preventing 'tagged' tasks to access Internet (many systems drop packets with
    IP options)

    2) netmasks were not handled correctly, they were stored in a way _not
    equivalent_ to conversion to be32 (it was equivalent for /0, /8, /16, /24,
    /32 masks but not other masks)

    3) smack_netlbladdr prefixes (IP/mask) were not consistent (mask&IP was not
    done), so there could have been different list entries for the same IP
    prefix; if those entries had different labels, well ...

    4) they were not sorted

    1) 2) 3) are bugs, 4) is a more cosmetic issue.
    The patch :

    -creates a new helper smk_netlbladdr_insert to insert a smk_netlbladdr,
    -sorted by netmask length

    -use the new sorted nature of smack_netlbladdrs list to simplify
    smack_host_label : the first match _will_ be the more specific

    -corrects endianness issues in smk_write_netlbladdr & netlbladdr_seq_show

    Signed-off-by:
    Acked-by: Casey Schaufler
    Reviewed-by: Paul Moore
    Signed-off-by: James Morris

    etienne
     

02 Mar, 2009

1 commit

  • Rick McNeal from LSI identified a panic in selinux_netlbl_inode_permission()
    caused by a certain sequence of SUNRPC operations. The problem appears to be
    due to the lack of NULL pointer checking in the function; this patch adds the
    pointer checks so the function will exit safely in the cases where the socket
    is not completely initialized.

    Signed-off-by: Paul Moore
    Signed-off-by: James Morris

    Paul Moore
     

27 Feb, 2009

4 commits

  • Restrict the /proc/keys and /proc/key-users output to keys
    belonging to the same user namespace as the reading task.

    We may want to make this more complicated - so that any
    keys in a user-namespace which is belongs to the reading
    task are also shown. But let's see if anyone wants that
    first.

    Signed-off-by: Serge E. Hallyn
    Acked-by: David Howells
    Signed-off-by: James Morris

    Serge E. Hallyn
     
  • When listing keys, do not return keys belonging to the
    same uid in another user namespace. Otherwise uid 500
    in another user namespace will return keyrings called
    uid.500 for another user namespace.

    Signed-off-by: Serge E. Hallyn
    Acked-by: David Howells
    Signed-off-by: James Morris

    Serge E. Hallyn
     
  • If a key is owned by another user namespace, then treat the
    key as though it is owned by both another uid and gid.

    Signed-off-by: Serge E. Hallyn
    Acked-by: David Howells
    Signed-off-by: James Morris

    Serge E. Hallyn
     
  • per-uid keys were looked by uid only. Use the user namespace
    to distinguish the same uid in different namespaces.

    This does not address key_permission. So a task can for instance
    try to join a keyring owned by the same uid in another namespace.
    That will be handled by a separate patch.

    Signed-off-by: Serge E. Hallyn
    Acked-by: David Howells
    Signed-off-by: James Morris

    Serge E. Hallyn
     

23 Feb, 2009

3 commits

  • At some point we (okay, I) managed to break the ability for users to use the
    setsockopt() syscall to set IPv4 options when NetLabel was not active on the
    socket in question. The problem was noticed by someone trying to use the
    "-R" (record route) option of ping:

    # ping -R 10.0.0.1
    ping: record route: No message of desired type

    The solution is relatively simple, we catch the unlabeled socket case and
    clear the error code, allowing the operation to succeed. Please note that we
    still deny users the ability to override IPv4 options on socket's which have
    NetLabel labeling active; this is done to ensure the labeling remains intact.

    Signed-off-by: Paul Moore
    Signed-off-by: James Morris

    Paul Moore
     
  • Based on Andrew Morton's comments:
    - add missing locks around radix_tree_lookup in ima_iint_insert()

    Signed-off-by: Mimi Zohar
    Cc: James Morris
    Signed-off-by: Andrew Morton
    Signed-off-by: James Morris

    Mimi Zohar
     
  • tomoyo_realpath_init() is unconditionally called by security_initcall().
    But nobody will use realpath related functions if TOMOYO is not registered.

    So, let tomoyo_init() call tomoyo_realpath_init().

    This patch saves 4KB of memory allocation if TOMOYO is not registered.

    Signed-off-by: Kentaro Takeda
    Signed-off-by: Tetsuo Handa
    Signed-off-by: Toshiharu Harada
    Signed-off-by: James Morris

    Tetsuo Handa
     

20 Feb, 2009

1 commit

  • Based on Alexander Beregalov's post http://lkml.org/lkml/2009/2/19/198

    - replaced sg_set_buf() with sg_init_one()

    kernel BUG at include/linux/scatterlist.h:65!
    invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
    last sysfs file:
    CPU 2
    Modules linked in:
    Pid: 1, comm: swapper Not tainted 2.6.29-rc5-next-20090219 #5 PowerEdge 1950
    RIP: 0010:[] [] ima_calc_hash+0xc0/0x160
    RSP: 0018:ffff88007f46bc40 EFLAGS: 00010286
    RAX: ffffe200032c45e8 RBX: 00000000fffffff4 RCX: 0000000087654321
    RDX: 0000000000000002 RSI: 0000000000000001 RDI: ffff88007cf71048
    RBP: ffff88007f46bcd0 R08: 0000000000000000 R09: 0000000000000163
    R10: ffff88007f4707a8 R11: 0000000000000000 R12: ffff88007cf71048
    R13: 0000000000001000 R14: 0000000000000000 R15: 0000000000009d98
    FS: 0000000000000000(0000) GS:ffff8800051ac000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b
    CR2: 0000000000000000 CR3: 0000000000201000 CR4: 00000000000006e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400

    Signed-off-by: Mimi Zohar
    Tested-by: Alexander Beregalov
    Signed-off-by: James Morris

    Mimi Zohar
     

19 Feb, 2009

1 commit


16 Feb, 2009

1 commit


14 Feb, 2009

10 commits

  • Due to wrong initialization, "cat /sys/kernel/security/tomoyo/exception_policy"
    returned nothing.

    Signed-off-by: Kentaro Takeda
    Signed-off-by: Tetsuo Handa
    Signed-off-by: Toshiharu Harada
    Signed-off-by: James Morris

    Tetsuo Handa
     
  • We do not need O(1) access to the tail of the avc cache lists and so we are
    wasting lots of space using struct list_head instead of struct hlist_head.
    This patch converts the avc cache to use hlists in which there is a single
    pointer from the head which saves us about 4k of global memory.

    Resulted in about a 1.5% decrease in time spent in avc_has_perm_noaudit based
    on oprofile sampling of tbench. Although likely within the noise....

    Signed-off-by: Eric Paris
    Reviewed-by: Paul Moore
    Signed-off-by: James Morris

    Eric Paris
     
  • The code making use of struct avc_cache was not easy to read thanks to liberal
    use of &avc_cache.{slots_lock,slots}[hvalue] throughout. This patch simply
    creates local pointers and uses those instead of the long global names.

    Signed-off-by: Eric Paris
    Signed-off-by: James Morris

    Eric Paris
     
  • It appears there was an intention to have the security server only decide
    certain permissions and leave other for later as some sort of a portential
    performance win. We are currently always deciding all 32 bits of
    permissions and this is a useless couple of branches and wasted space.
    This patch completely drops the av.decided concept.

    This in a 17% reduction in the time spent in avc_has_perm_noaudit
    based on oprofile sampling of a tbench benchmark.

    Signed-off-by: Eric Paris
    Reviewed-by: Paul Moore
    Acked-by: Stephen Smalley
    Signed-off-by: James Morris

    Eric Paris
     
  • we are often needlessly jumping through hoops when it comes to avd
    entries in avc_has_perm_noaudit and we have extra initialization and memcpy
    which are just wasting performance. Try to clean the function up a bit.

    This patch resulted in a 13% drop in time spent in avc_has_perm_noaudit in my
    oprofile sampling of a tbench benchmark.

    Signed-off-by: Eric Paris
    Reviewed-by: Paul Moore
    Acked-by: Stephen Smalley
    Signed-off-by: James Morris

    Eric Paris
     
  • Currently SELinux code has an atomic which was intended to track how many
    times an avc entry was used and to evict entries when they haven't been
    used recently. Instead we never let this atomic get above 1 and evict when
    it is first checked for eviction since it hits zero. This is a total waste
    of time so I'm completely dropping ae.used.

    This change resulted in about a 3% faster avc_has_perm_noaudit when running
    oprofile against a tbench benchmark.

    Signed-off-by: Eric Paris
    Reviewed by: Paul Moore
    Acked-by: Stephen Smalley
    Signed-off-by: James Morris

    Eric Paris
     
  • The avc update node callbacks do not check the seqno of the caller with the
    seqno of the node found. It is possible that a policy change could happen
    (although almost impossibly unlikely) in which a permissive or
    permissive_domain decision is not valid for the entry found. Simply pass
    and check that the seqno of the caller and the seqno of the node found
    match.

    Signed-off-by: Eric Paris
    Acked-by: Stephen Smalley
    Signed-off-by: James Morris

    Eric Paris
     
  • When a context is pulled in from disk we don't know that it is null
    terminated. This patch forecebly null terminates contexts when we pull
    them from disk.

    Signed-off-by: Eric Paris
    Acked-by: Stephen Smalley
    Signed-off-by: James Morris

    Eric Paris
     
  • Currently when an inode is read into the kernel with an invalid label
    string (can often happen with removable media) we output a string like:

    SELinux: inode_doinit_with_dentry: context_to_sid([SOME INVALID LABEL])
    returned -22 dor dev=[blah] ino=[blah]

    Which is all but incomprehensible to all but a couple of us. Instead, on
    EINVAL only, I plan to output a much more user friendly string and I plan to
    ratelimit the printk since many of these could be generated very rapidly.

    Signed-off-by: Eric Paris
    Acked-by: Stephen Smalley
    Signed-off-by: James Morris

    Eric Paris
     
  • For cleanliness and efficiency remove all calls to secondary-> and instead
    call capabilities code directly. capabilities are the only module that
    selinux stacks with and so the code should not indicate that other stacking
    might be possible.

    Signed-off-by: Eric Paris
    Acked-by: Stephen Smalley
    Signed-off-by: James Morris

    Eric Paris
     

13 Feb, 2009

1 commit

  • IMA_LSM_RULES requires AUDIT. This is automatic if SECURITY_SELINUX=y
    but not when SECURITY_SMACK=y (and SECURITY_SELINUX=n), so make the
    dependency explicit. This fixes the following build error:

    security/integrity/ima/ima_policy.c:111:error: implicit declaration of function 'security_audit_rule_match'
    security/integrity/ima/ima_policy.c:230:error: implicit declaration of function 'security_audit_rule_init'

    Signed-off-by: Randy Dunlap
    Acked-by: Mimi Zohar
    Signed-off-by: James Morris

    Randy Dunlap
     

12 Feb, 2009

4 commits

  • Fix sparse warning.

    $ make C=2 SUBDIRS=security/tomoyo CF="-D__cold__="
    CHECK security/tomoyo/common.c
    CHECK security/tomoyo/realpath.c
    CHECK security/tomoyo/tomoyo.c
    security/tomoyo/tomoyo.c:110:8: warning: symbol 'buf' shadows an earlier one
    security/tomoyo/tomoyo.c:100:7: originally declared here

    Signed-off-by: Kentaro Takeda
    Signed-off-by: Tetsuo Handa
    Signed-off-by: Toshiharu Harada
    Signed-off-by: James Morris

    Tetsuo Handa
     
  • LSMs need to be linked before root_plug to ensure the security=
    boot parameter works with them. Do this for Tomoyo.

    (root_plug probably needs to be taken out and shot at some point,
    too).

    Signed-off-by: James Morris

    James Morris
     
  • TOMOYO uses LSM hooks for pathname based access control and securityfs support.

    Signed-off-by: Kentaro Takeda
    Signed-off-by: Tetsuo Handa
    Signed-off-by: James Morris

    Kentaro Takeda
     
  • DAC's permissions and TOMOYO's permissions are not one-to-one mapping.

    Regarding DAC, there are "read", "write", "execute" permissions.
    Regarding TOMOYO, there are "allow_read", "allow_write", "allow_read/write",
    "allow_execute", "allow_create", "allow_unlink", "allow_mkdir", "allow_rmdir",
    "allow_mkfifo", "allow_mksock", "allow_mkblock", "allow_mkchar",
    "allow_truncate", "allow_symlink", "allow_rewrite", "allow_link",
    "allow_rename" permissions.

    +----------------------------------+----------------------------------+
    | requested operation | required TOMOYO's permission |
    +----------------------------------+----------------------------------+
    | sys_open(O_RDONLY) | allow_read |
    +----------------------------------+----------------------------------+
    | sys_open(O_WRONLY) | allow_write |
    +----------------------------------+----------------------------------+
    | sys_open(O_RDWR) | allow_read/write |
    +----------------------------------+----------------------------------+
    | open_exec() from do_execve() | allow_execute |
    +----------------------------------+----------------------------------+
    | open_exec() from !do_execve() | allow_read |
    +----------------------------------+----------------------------------+
    | sys_read() | (none) |
    +----------------------------------+----------------------------------+
    | sys_write() | (none) |
    +----------------------------------+----------------------------------+
    | sys_mmap() | (none) |
    +----------------------------------+----------------------------------+
    | sys_uselib() | allow_read |
    +----------------------------------+----------------------------------+
    | sys_open(O_CREAT) | allow_create |
    +----------------------------------+----------------------------------+
    | sys_open(O_TRUNC) | allow_truncate |
    +----------------------------------+----------------------------------+
    | sys_truncate() | allow_truncate |
    +----------------------------------+----------------------------------+
    | sys_ftruncate() | allow_truncate |
    +----------------------------------+----------------------------------+
    | sys_open() without O_APPEND | allow_rewrite |
    +----------------------------------+----------------------------------+
    | setfl() without O_APPEND | allow_rewrite |
    +----------------------------------+----------------------------------+
    | sys_sysctl() for writing | allow_write |
    +----------------------------------+----------------------------------+
    | sys_sysctl() for reading | allow_read |
    +----------------------------------+----------------------------------+
    | sys_unlink() | allow_unlink |
    +----------------------------------+----------------------------------+
    | sys_mknod(S_IFREG) | allow_create |
    +----------------------------------+----------------------------------+
    | sys_mknod(0) | allow_create |
    +----------------------------------+----------------------------------+
    | sys_mknod(S_IFIFO) | allow_mkfifo |
    +----------------------------------+----------------------------------+
    | sys_mknod(S_IFSOCK) | allow_mksock |
    +----------------------------------+----------------------------------+
    | sys_bind(AF_UNIX) | allow_mksock |
    +----------------------------------+----------------------------------+
    | sys_mknod(S_IFBLK) | allow_mkblock |
    +----------------------------------+----------------------------------+
    | sys_mknod(S_IFCHR) | allow_mkchar |
    +----------------------------------+----------------------------------+
    | sys_symlink() | allow_symlink |
    +----------------------------------+----------------------------------+
    | sys_mkdir() | allow_mkdir |
    +----------------------------------+----------------------------------+
    | sys_rmdir() | allow_rmdir |
    +----------------------------------+----------------------------------+
    | sys_link() | allow_link |
    +----------------------------------+----------------------------------+
    | sys_rename() | allow_rename |
    +----------------------------------+----------------------------------+

    TOMOYO requires "allow_execute" permission of a pathname passed to do_execve()
    but does not require "allow_read" permission of that pathname.
    Let's consider 3 patterns (statically linked, dynamically linked,
    shell script). This description is to some degree simplified.

    $ cat hello.c
    #include
    int main() {
    printf("Hello\n");
    return 0;
    }
    $ cat hello.sh
    #! /bin/sh
    echo "Hello"
    $ gcc -static -o hello-static hello.c
    $ gcc -o hello-dynamic hello.c
    $ chmod 755 hello.sh

    Case 1 -- Executing hello-static from bash.

    (1) The bash process calls fork() and the child process requests
    do_execve("hello-static").

    (2) The kernel checks "allow_execute hello-static" from "bash" domain.

    (3) The kernel calculates "bash hello-static" as the domain to transit to.

    (4) The kernel overwrites the child process by "hello-static".

    (5) The child process transits to "bash hello-static" domain.

    (6) The "hello-static" starts and finishes.

    Case 2 -- Executing hello-dynamic from bash.

    (1) The bash process calls fork() and the child process requests
    do_execve("hello-dynamic").

    (2) The kernel checks "allow_execute hello-dynamic" from "bash" domain.

    (3) The kernel calculates "bash hello-dynamic" as the domain to transit to.

    (4) The kernel checks "allow_read ld-linux.so" from "bash hello-dynamic"
    domain. I think permission to access ld-linux.so should be charged
    hello-dynamic program, for "hello-dynamic needs ld-linux.so" is not
    a fault of bash program.

    (5) The kernel overwrites the child process by "hello-dynamic".

    (6) The child process transits to "bash hello-dynamic" domain.

    (7) The "hello-dynamic" starts and finishes.

    Case 3 -- Executing hello.sh from bash.

    (1) The bash process calls fork() and the child process requests
    do_execve("hello.sh").

    (2) The kernel checks "allow_execute hello.sh" from "bash" domain.

    (3) The kernel calculates "bash hello.sh" as the domain to transit to.

    (4) The kernel checks "allow_read /bin/sh" from "bash hello.sh" domain.
    I think permission to access /bin/sh should be charged hello.sh program,
    for "hello.sh needs /bin/sh" is not a fault of bash program.

    (5) The kernel overwrites the child process by "/bin/sh".

    (6) The child process transits to "bash hello.sh" domain.

    (7) The "/bin/sh" requests open("hello.sh").

    (8) The kernel checks "allow_read hello.sh" from "bash hello.sh" domain.

    (9) The "/bin/sh" starts and finishes.

    Whether a file is interpreted as a program or not depends on an application.
    The kernel cannot know whether the file is interpreted as a program or not.
    Thus, TOMOYO treats "hello-static" "hello-dynamic" "ld-linux.so" "hello.sh"
    "/bin/sh" equally as merely files; no distinction between executable and
    non-executable. Therefore, TOMOYO doesn't check DAC's execute permission.
    TOMOYO checks "allow_read" permission instead.

    Calling do_execve() is a bold gesture that an old program's instance (i.e.
    current process) is ready to be overwritten by a new program and is ready to
    transfer control to the new program. To split purview of programs, TOMOYO
    requires "allow_execute" permission of the new program against the old
    program's instance and performs domain transition. If do_execve() succeeds,
    the old program is no longer responsible against the consequence of the new
    program's behavior. Only the new program is responsible for all consequences.

    But TOMOYO doesn't require "allow_read" permission of the new program.
    If TOMOYO requires "allow_read" permission of the new program, TOMOYO will
    allow an attacker (who hijacked the old program's instance) to open the new
    program and steal data from the new program. Requiring "allow_read" permission
    will widen purview of the old program.

    Not requiring "allow_read" permission of the new program against the old
    program's instance is my design for reducing purview of the old program.
    To be able to know whether the current process is in do_execve() or not,
    I want to add in_execve flag to "task_struct".

    Signed-off-by: Kentaro Takeda
    Signed-off-by: Tetsuo Handa
    Signed-off-by: Toshiharu Harada
    Signed-off-by: James Morris

    Kentaro Takeda