21 Oct, 2010

2 commits

  • There is interest in being able to see what the actual policy is that was
    loaded into the kernel. The patch creates a new selinuxfs file
    /selinux/policy which can be read by userspace. The actual policy that is
    loaded into the kernel will be written back out to userspace.

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

    Eric Paris
     
  • AVTAB_MAX_SIZE was a define which was supposed to be used in userspace to
    define a maximally sized avtab when userspace wasn't sure how big of a table
    it needed. It doesn't make sense in the kernel since we always know our table
    sizes. The only place it is used we have a more appropiately named define
    called AVTAB_MAX_HASH_BUCKETS, use that instead.

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

    Eric Paris
     

02 Aug, 2010

1 commit

  • The avtab_read_item() function tends to return -1 as a default error
    code which is wrong (-1 means -EPERM). I modified it to return
    appropriate error codes which is -EINVAL or the error code from
    next_entry() or insertf().

    next_entry() returns -EINVAL.
    insertf() is a function pointer to either avtab_insert() or
    cond_insertf().
    avtab_insert() returns -EINVAL, -ENOMEM, and -EEXIST.
    cond_insertf() currently returns -1, but I will fix it in a later patch.

    There is code in avtab_read() which translates the -1 returns from
    avtab_read_item() to -EINVAL. The translation is no longer needed, so I
    removed it.

    Signed-off-by: Dan Carpenter
    Acked-by: Stephen D. Smalley
    Signed-off-by: James Morris

    Dan Carpenter
     

15 Aug, 2008

1 commit


05 Aug, 2008

1 commit


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
     

21 Apr, 2008

2 commits

  • Make sure all printk start with KERN_*
    Make sure all printk end with \n
    Make sure all printk have the word 'selinux' in them
    Change "function name" to "%s", __func__ (found 2 wrong)

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

    Eric Paris
     
  • This patch changes avtab.c to fix whitespace and syntax issues. Things that
    are fixed may include (does not not have to include)

    whitespace at end of lines
    spaces followed by tabs
    spaces used instead of tabs
    spacing around parenthesis
    locateion of { around struct and else clauses
    location of * in pointer declarations
    removal of initialization of static data to keep it in the right section
    useless {} in if statemetns
    useless checking for NULL before kfree
    fixing of the indentation depth of switch statements
    and any number of other things I forgot to mention

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

    Eric Paris
     

18 Apr, 2008

1 commit


25 Jan, 2008

1 commit


08 Nov, 2007

1 commit

  • Add more validity checks at policy load time to reject malformed
    policies and prevent subsequent out-of-range indexing when in permissive
    mode. Resolves the NULL pointer dereference reported in
    https://bugzilla.redhat.com/show_bug.cgi?id=357541.

    Signed-off-by: Stephen Smalley
    Signed-off-by: James Morris

    Stephen Smalley
     

17 Oct, 2007

1 commit

  • This patch reduces memory usage of SELinux by tuning avtab. Number of hash
    slots in avtab was 32768. Unused slots used memory when number of rules is
    fewer. This patch decides number of hash slots dynamically based on number
    of rules. (chain length)^2 is also printed out in avtab_hash_eval to see
    standard deviation of avtab hash table.

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

    Yuichi Nakamura
     

20 Jul, 2007

1 commit

  • Slab destructors were no longer supported after Christoph's
    c59def9f222d44bb7e2f0a559f2906191a0862d7 change. They've been
    BUGs for both slab and slub, and slob never supported them
    either.

    This rips out support for the dtor pointer from kmem_cache_create()
    completely and fixes up every single callsite in the kernel (there were
    about 224, not including the slab allocator definitions themselves,
    or the documentation references).

    Signed-off-by: Paul Mundt

    Paul Mundt
     

27 Feb, 2007

1 commit

  • Below is a patch which demotes many printk lines to KERN_DEBUG from
    KERN_INFO. It should help stop the spamming of logs with messages in
    which users are not interested nor is there any action that users should
    take. It also promotes some KERN_INFO to KERN_ERR such as when there
    are improper attempts to register/unregister security modules.

    A similar patch was discussed a while back on list:
    http://marc.theaimsgroup.com/?t=116656343500003&r=1&w=2
    This patch addresses almost all of the issues raised. I believe the
    only advice not taken was in the demoting of messages related to
    undefined permissions and classes.

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

    security/selinux/hooks.c | 20 ++++++++++----------
    security/selinux/ss/avtab.c | 2 +-
    security/selinux/ss/policydb.c | 6 +++---
    security/selinux/ss/sidtab.c | 2 +-
    4 files changed, 15 insertions(+), 15 deletions(-)
    Signed-off-by: James Morris

    Eric Paris
     

12 Feb, 2007

1 commit

  • Replace appropriate pairs of "kmem_cache_alloc()" + "memset(0)" with the
    corresponding "kmem_cache_zalloc()" call.

    Signed-off-by: Robert P. J. Day
    Cc: "Luck, Tony"
    Cc: Andi Kleen
    Cc: Roland McGrath
    Cc: James Bottomley
    Cc: Greg KH
    Acked-by: Joel Becker
    Cc: Steven Whitehouse
    Cc: Jan Kara
    Cc: Michael Halcrow
    Cc: "David S. Miller"
    Cc: Stephen Smalley
    Cc: James Morris
    Cc: Chris Wright
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     

08 Dec, 2006

2 commits

  • Replace all uses of kmem_cache_t with struct kmem_cache.

    The patch was generated using the following script:

    #!/bin/sh
    #
    # Replace one string by another in all the kernel sources.
    #

    set -e

    for file in `find * -name "*.c" -o -name "*.h"|xargs grep -l $1`; do
    quilt add $file
    sed -e "1,\$s/$1/$2/g" $file >/tmp/$$
    mv /tmp/$$ $file
    quilt refresh
    done

    The script was run like this

    sh replace kmem_cache_t "struct kmem_cache"

    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     
  • SLAB_KERNEL is an alias of GFP_KERNEL.

    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

07 Jan, 2006

1 commit


05 Sep, 2005

2 commits

  • This patch adds endian notations to the SELinux code.

    Signed-off-by: Stephen Smalley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • This patch improves memory use by SELinux by both reducing the avtab node
    size and reducing the number of avtab nodes. The memory savings are
    substantial, e.g. on a 64-bit system after boot, James Morris reported the
    following data for the targeted and strict policies:

    #objs objsize kernmem
    Targeted:
    Before: 237888 40 9.1MB
    After: 19968 24 468KB

    Strict:
    Before: 571680 40 21.81MB
    After: 221052 24 5.06MB

    The improvement in memory use comes at a cost in the speed of security
    server computations of access vectors, but these computations are only
    required on AVC cache misses, and performance measurements by James Morris
    using a number of benchmarks have shown that the change does not cause any
    significant degradation.

    Note that a rebuilt policy via an updated policy toolchain
    (libsepol/checkpolicy) is required in order to gain the full benefits of
    this patch, although some memory savings benefits are immediately applied
    even to older policies (in particular, the reduction in avtab node size).
    Sources for the updated toolchain are presently available from the
    sourceforge CVS tree (http://sourceforge.net/cvs/?group_id=21266), and
    tarballs are available from http://www.flux.utah.edu/~sds.

    Signed-off-by: Stephen Smalley
    Signed-off-by: James Morris
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Smalley
     

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