10 Apr, 2012

4 commits


04 Apr, 2012

3 commits


29 Mar, 2012

1 commit


20 May, 2011

1 commit


26 Apr, 2011

1 commit

  • Now that the security modules can decide whether they support the
    dcache RCU walk or not it's possible to make selinux a bit more
    RCU friendly. The SELinux AVC and security server access decision
    code is RCU safe. A specific piece of the LSM audit code may not
    be RCU safe.

    This patch makes the VFS RCU walk retry if it would hit the non RCU
    safe chunk of code. It will normally just work under RCU. This is
    done simply by passing the VFS RCU state as a flag down into the
    avc_audit() code and returning ECHILD there if it would have an issue.

    Based-on-patch-by: Andi Kleen
    Signed-off-by: Eric Paris
    Signed-off-by: Linus Torvalds

    Eric Paris
     

11 Jan, 2011

1 commit


17 Aug, 2009

1 commit

  • Convert avc_audit in security/selinux/avc.c to use lsm_audit.h,
    for better maintainability.

    - changed selinux to use common_audit_data instead of
    avc_audit_data
    - eliminated code in avc.c and used code from lsm_audit.h instead.

    Had to add a LSM_AUDIT_NO_AUDIT to lsm_audit.h so that avc_audit
    can call common_lsm_audit and do the pre and post callbacks without
    doing the actual dump. This makes it so that the patched version
    behaves the same way as the unpatched version.

    Also added a denied field to the selinux_audit_data private space,
    once again to make it so that the patched version behaves like the
    unpatched.

    I've tested and confirmed that AVCs look the same before and after
    this patch.

    Signed-off-by: Thomas Liu
    Acked-by: Stephen Smalley
    Signed-off-by: James Morris

    Thomas Liu
     

13 Jul, 2009

2 commits

  • This reverts commit 8113a8d80f4c6a3dc3724b39b470f3fee9c426b6.

    The patch causes a stack overflow on my system during boot.

    Signed-off-by: James Morris

    James Morris
     
  • Convert avc_audit in security/selinux/avc.c to use lsm_audit.h,
    for better maintainability and for less code duplication.

    - changed selinux to use common_audit_data instead of
    avc_audit_data
    - eliminated code in avc.c and used code from lsm_audit.h instead.

    I have tested to make sure that the avcs look the same before and
    after this patch.

    Signed-off-by: Thomas Liu
    Acked-by: Eric Paris
    Signed-off-by: James Morris

    Thomas Liu
     

25 Jun, 2009

1 commit


18 Jun, 2009

1 commit

  • The attached patch adds support to generate audit messages on two cases.

    The first one is a case when a multi-thread process tries to switch its
    performing security context using setcon(3), but new security context is
    not bounded by the old one.

    type=SELINUX_ERR msg=audit(1245311998.599:17): \
    op=security_bounded_transition result=denied \
    oldcontext=system_u:system_r:httpd_t:s0 \
    newcontext=system_u:system_r:guest_webapp_t:s0

    The other one is a case when security_compute_av() masked any permissions
    due to the type boundary violation.

    type=SELINUX_ERR msg=audit(1245312836.035:32): \
    op=security_compute_av reason=bounds \
    scontext=system_u:object_r:user_webapp_t:s0 \
    tcontext=system_u:object_r:shadow_t:s0:c0 \
    tclass=file perms=getattr,open

    Signed-off-by: KaiGai Kohei
    Acked-by: Stephen Smalley
    Signed-off-by: James Morris

    KaiGai Kohei
     

28 Aug, 2008

1 commit

  • The purpose of this patch is to assign per-thread security context
    under a constraint. It enables multi-threaded server application
    to kick a request handler with its fair security context, and
    helps some of userspace object managers to handle user's request.

    When we assign a per-thread security context, it must not have wider
    permissions than the original one. Because a multi-threaded process
    shares a single local memory, an arbitary per-thread security context
    also means another thread can easily refer violated information.

    The constraint on a per-thread security context requires a new domain
    has to be equal or weaker than its original one, when it tries to assign
    a per-thread security context.

    Bounds relationship between two types is a way to ensure a domain can
    never have wider permission than its bounds. We can define it in two
    explicit or implicit ways.

    The first way is using new TYPEBOUNDS statement. It enables to define
    a boundary of types explicitly. The other one expand the concept of
    existing named based hierarchy. If we defines a type with "." separated
    name like "httpd_t.php", toolchain implicitly set its bounds on "httpd_t".

    This feature requires a new policy version.
    The 24th version (POLICYDB_VERSION_BOUNDARY) enables to ship them into
    kernel space, and the following patch enables to handle it.

    Signed-off-by: KaiGai Kohei
    Acked-by: Stephen Smalley
    Signed-off-by: James Morris

    KaiGai Kohei
     

14 Jul, 2008

1 commit

  • Formatting and syntax changes

    whitespace, tabs to spaces, trailing space
    put open { on same line as struct def
    remove unneeded {} after if statements
    change printk("Lu") to printk("llu")
    convert asm/uaccess.h to linux/uaacess.h includes
    remove unnecessary asm/bug.h includes
    convert all users of simple_strtol to strict_strtol

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

    Eric Paris
     

15 Feb, 2008

1 commit

  • audit_log_d_path() is a d_path() wrapper that is used by the audit code. To
    use a struct path in audit_log_d_path() I need to embed it into struct
    avc_audit_data.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Jan Blunck
    Acked-by: Christoph Hellwig
    Cc: Al Viro
    Cc: "J. Bruce Fields"
    Cc: Neil Brown
    Cc: Stephen Smalley
    Cc: James Morris
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Blunck
     

30 Jan, 2008

1 commit

  • Instead of storing the packet's network interface name store the ifindex. This
    allows us to defer the need to lookup the net_device structure until the audit
    record is generated meaning that in the majority of cases we never need to
    bother with this at all.

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

    Paul Moore
     

17 Oct, 2007

1 commit

  • It reduces the selinux overhead on read/write by only revalidating
    permissions in selinux_file_permission if the task or inode labels have
    changed or the policy has changed since the open-time check. A new LSM
    hook, security_dentry_open, is added to capture the necessary state at open
    time to allow this optimization.

    (see http://marc.info/?l=selinux&m=118972995207740&w=2)

    Signed-off-by: Yuichi Nakamura
    Acked-by: Stephen Smalley
    Signed-off-by: James Morris

    Yuichi Nakamura
     

12 Jul, 2007

1 commit

  • In security_get_user_sids, move the transition permission checks
    outside of the section holding the policy rdlock, and use the AVC to
    perform the checks, calling cond_resched after each one. These
    changes should allow preemption between the individual checks and
    enable caching of the results. It may however increase the overall
    time spent in the function in some cases, particularly in the cache
    miss case.

    The long term fix will be to take much of this logic to userspace by
    exporting additional state via selinuxfs, and ultimately deprecating
    and eliminating this interface from the kernel.

    Tested-by: Ingo Molnar
    Signed-off-by: Stephen Smalley
    Signed-off-by: James Morris

    Stephen Smalley
     

05 Dec, 2006

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds