19 May, 2009

1 commit

  • On Tue, 2009-05-19 at 00:05 -0400, Eamon Walsh wrote:
    > Recent versions of coreutils have bumped the read buffer size from 4K to
    > 32K in several of the utilities.
    >
    > This means that "cat /selinux/booleans/xserver_object_manager" no longer
    > works, it returns "Invalid argument" on F11. getsebool works fine.
    >
    > sel_read_bool has a check for "count > PAGE_SIZE" that doesn't seem to
    > be present in the other read functions. Maybe it could be removed?

    Yes, that check is obsoleted by the conversion of those functions to
    using simple_read_from_buffer(), which will reduce count if necessary to
    what is available in the buffer.

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

    Stephen Smalley
     

02 Apr, 2009

1 commit

  • This patch enables applications to handle permissive domain correctly.

    Since the v2.6.26 kernel, SELinux has supported an idea of permissive
    domain which allows certain processes to work as if permissive mode,
    even if the global setting is enforcing mode.
    However, we don't have an application program interface to inform
    what domains are permissive one, and what domains are not.
    It means applications focuses on SELinux (XACE/SELinux, SE-PostgreSQL
    and so on) cannot handle permissive domain correctly.

    This patch add the sixth field (flags) on the reply of the /selinux/access
    interface which is used to make an access control decision from userspace.
    If the first bit of the flags field is positive, it means the required
    access control decision is on permissive domain, so application should
    allow any required actions, as the kernel doing.

    This patch also has a side benefit. The av_decision.flags is set at
    context_struct_compute_av(). It enables to check required permissions
    without read_lock(&policy_rwlock).

    Signed-off-by: KaiGai Kohei
    Acked-by: Stephen Smalley
    Acked-by: Eric Paris
    --
    security/selinux/avc.c | 2 +-
    security/selinux/include/security.h | 4 +++-
    security/selinux/selinuxfs.c | 4 ++--
    security/selinux/ss/services.c | 30 +++++-------------------------
    4 files changed, 11 insertions(+), 29 deletions(-)
    Signed-off-by: James Morris

    KaiGai Kohei
     

28 Mar, 2009

1 commit

  • 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
     

14 Feb, 2009

1 commit

  • 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
     

07 Jan, 2009

1 commit


06 Jan, 2009

1 commit


01 Jan, 2009

2 commits

  • Impact: cleanup

    In future, all cpumask ops will only be valid (in general) for bit
    numbers < nr_cpu_ids. So use that instead of NR_CPUS in iterators
    and other comparisons.

    This is always safe: no cpu number can be >= nr_cpu_ids, and
    nr_cpu_ids is initialized to NR_CPUS at boot.

    Signed-off-by: Rusty Russell
    Signed-off-by: Mike Travis
    Acked-by: Ingo Molnar
    Acked-by: James Morris
    Cc: Eric Biederman

    Rusty Russell
     
  • This patch is the first step towards removing the old "compat_net" code from
    the kernel. Secmark, the "compat_net" replacement was first introduced in
    2.6.18 (September 2006) and the major Linux distributions with SELinux support
    have transitioned to Secmark so it is time to start deprecating the "compat_net"
    mechanism. Testing a patched version of 2.6.28-rc6 with the initial release of
    Fedora Core 5 did not show any problems when running in enforcing mode.

    This patch adds an entry to the feature-removal-schedule.txt file and removes
    the SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT configuration option, forcing
    Secmark on by default although it can still be disabled at runtime. The patch
    also makes the Secmark permission checks "dynamic" in the sense that they are
    only executed when Secmark is configured; this should help prevent problems
    with older distributions that have not yet migrated to Secmark.

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

    Paul Moore
     

14 Nov, 2008

2 commits

  • Use RCU to access another task's creds and to release a task's own creds.
    This means that it will be possible for the credentials of a task to be
    replaced without another task (a) requiring a full lock to read them, and (b)
    seeing deallocated memory.

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

    David Howells
     
  • Separate the task security context from task_struct. At this point, the
    security data is temporarily embedded in the task_struct with two pointers
    pointing to it.

    Note that the Alpha arch is altered as it refers to (E)UID and (E)GID in
    entry.S via asm-offsets.

    With comment fixes Signed-off-by: Marc Dionne

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

    David Howells
     

14 Jul, 2008

2 commits

  • I've gotten complaints and reports about people not understanding the
    meaning of the current unknown class/perm handling the kernel emits on
    every policy load. Hopefully this will make make it clear to everyone
    the meaning of the message and won't waste a printk the user won't care
    about anyway on systems where the kernel and the policy agree on
    everything.

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

    Eric Paris
     
  • 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
     

22 Apr, 2008

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6:
    SELinux: one little, two little, three little whitespaces, the avc.c saga.
    SELinux: cleanup on isle selinuxfs.c
    changing whitespace for fun and profit: policydb.c
    SELinux: whitespace and formating fixes for hooks.c
    SELinux: clean up printks
    SELinux: sidtab.c whitespace, syntax, and static declaraction cleanups
    SELinux: services.c whitespace, syntax, and static declaraction cleanups
    SELinux: mls.c whitespace, syntax, and static declaraction cleanups
    SELinux: hashtab.c whitespace, syntax, and static declaraction cleanups
    SELinux: ebitmap.c whitespace, syntax, and static declaraction cleanups
    SELinux: conditional.c whitespace, syntax, and static declaraction cleanups
    SELinux: avtab.c whitespace, syntax, and static declaraction cleanups
    SELinux: xfrm.c whitespace, syntax, and static declaraction cleanups
    SELinux: nlmsgtab.c whitespace, syntax, and static declaraction cleanups
    SELinux: netnode.c whitespace, syntax, and static declaraction cleanups
    SELinux: netlink.c whitespace, syntax, and static declaraction cleanups
    SELinux: netlabel.c whitespace, syntax, and static declaraction cleanups
    SELinux: netif.c whitespace, syntax, and static declaraction cleanups

    Linus Torvalds
     

21 Apr, 2008

2 commits

  • Why would anyone just clean up white space all day? Because they were
    out too late last night and don't want to think for a day. So here is a
    nice clean selinuxfs.c patch.

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

    Eric Paris
     
  • 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
     

19 Apr, 2008

1 commit


18 Apr, 2008

2 commits

  • __FUNCTION__ is gcc-specific, use __func__

    Signed-off-by: Harvey Harrison
    Cc: James Morris
    Cc: Stephen Smalley
    Signed-off-by: Andrew Morton
    Signed-off-by: James Morris

    Harvey Harrison
     
  • Adds a new open permission inside SELinux when 'opening' a file. The idea
    is that opening a file and reading/writing to that file are not the same
    thing. Its different if a program had its stdout redirected to /tmp/output
    than if the program tried to directly open /tmp/output. This should allow
    policy writers to more liberally give read/write permissions across the
    policy while still blocking many design and programing flaws SELinux is so
    good at catching today.

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

    Eric Paris
     

02 Feb, 2008

2 commits


30 Jan, 2008

1 commit


25 Jan, 2008

1 commit


05 Dec, 2007

2 commits

  • Instead of using f_op to detect dead booleans, check the inode index
    against the number of booleans and check the dentry name against the
    boolean name for that index on reads and writes. This prevents
    incorrect use of a boolean file opened prior to a policy reload while
    allowing valid use of it as long as it still corresponds to the same
    boolean in the policy.

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

    Stephen Smalley
     
  • Do not clear f_op when removing entries since it isn't safe to do.

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

    Stephen Smalley
     

17 Oct, 2007

1 commit

  • Allow policy to select, in much the same way as it selects MLS support, how
    the kernel should handle access decisions which contain either unknown
    classes or unknown permissions in known classes. The three choices for the
    policy flags are

    0 - Deny unknown security access. (default)
    2 - reject loading policy if it does not contain all definitions
    4 - allow unknown security access

    The policy's choice is exported through 2 booleans in
    selinuxfs. /selinux/deny_unknown and /selinux/reject_unknown.

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

    Eric Paris
     

12 Jul, 2007

3 commits


26 Apr, 2007

4 commits


13 Feb, 2007

1 commit

  • Many struct file_operations in the kernel can be "const". Marking them const
    moves these to the .rodata section, which avoids false sharing with potential
    dirty data. In addition it'll catch accidental writes at compile time to
    these shared resources.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

09 Dec, 2006

1 commit


01 Oct, 2006

1 commit


27 Sep, 2006

1 commit

  • This eliminates the i_blksize field from struct inode. Filesystems that want
    to provide a per-inode st_blksize can do so by providing their own getattr
    routine instead of using the generic_fillattr() function.

    Note that some filesystems were providing pretty much random (and incorrect)
    values for i_blksize.

    [bunk@stusta.de: cleanup]
    [akpm@osdl.org: generic_fillattr() fix]
    Signed-off-by: "Theodore Ts'o"
    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Theodore Ts'o
     

01 Jul, 2006

1 commit


23 Jun, 2006

1 commit

  • Extend the get_sb() filesystem operation to take an extra argument that
    permits the VFS to pass in the target vfsmount that defines the mountpoint.

    The filesystem is then required to manually set the superblock and root dentry
    pointers. For most filesystems, this should be done with simple_set_mnt()
    which will set the superblock pointer and then set the root dentry to the
    superblock's s_root (as per the old default behaviour).

    The get_sb() op now returns an integer as there's now no need to return the
    superblock pointer.

    This patch permits a superblock to be implicitly shared amongst several mount
    points, such as can be done with NFS to avoid potential inode aliasing. In
    such a case, simple_set_mnt() would not be called, and instead the mnt_root
    and mnt_sb would be set directly.

    The patch also makes the following changes:

    (*) the get_sb_*() convenience functions in the core kernel now take a vfsmount
    pointer argument and return an integer, so most filesystems have to change
    very little.

    (*) If one of the convenience function is not used, then get_sb() should
    normally call simple_set_mnt() to instantiate the vfsmount. This will
    always return 0, and so can be tail-called from get_sb().

    (*) generic_shutdown_super() now calls shrink_dcache_sb() to clean up the
    dcache upon superblock destruction rather than shrink_dcache_anon().

    This is required because the superblock may now have multiple trees that
    aren't actually bound to s_root, but that still need to be cleaned up. The
    currently called functions assume that the whole tree is rooted at s_root,
    and that anonymous dentries are not the roots of trees which results in
    dentries being left unculled.

    However, with the way NFS superblock sharing are currently set to be
    implemented, these assumptions are violated: the root of the filesystem is
    simply a dummy dentry and inode (the real inode for '/' may well be
    inaccessible), and all the vfsmounts are rooted on anonymous[*] dentries
    with child trees.

    [*] Anonymous until discovered from another tree.

    (*) The documentation has been adjusted, including the additional bit of
    changing ext2_* into foo_* in the documentation.

    [akpm@osdl.org: convert ipath_fs, do other stuff]
    Signed-off-by: David Howells
    Acked-by: Al Viro
    Cc: Nathan Scott
    Cc: Roland Dreier
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     

18 Jun, 2006

1 commit

  • Add new per-packet access controls to SELinux, replacing the old
    packet controls.

    Packets are labeled with the iptables SECMARK and CONNSECMARK targets,
    then security policy for the packets is enforced with these controls.

    To allow for a smooth transition to the new controls, the old code is
    still present, but not active by default. To restore previous
    behavior, the old controls may be activated at runtime by writing a
    '1' to /selinux/compat_net, and also via the kernel boot parameter
    selinux_compat_net. Switching between the network control models
    requires the security load_policy permission. The old controls will
    probably eventually be removed and any continued use is discouraged.

    With this patch, the new secmark controls for SElinux are disabled by
    default, so existing behavior is entirely preserved, and the user is
    not affected at all.

    It also provides a config option to enable the secmark controls by
    default (which can always be overridden at boot and runtime). It is
    also noted in the kconfig help that the user will need updated
    userspace if enabling secmark controls for SELinux and that they'll
    probably need the SECMARK and CONNMARK targets, and conntrack protocol
    helpers, although such decisions are beyond the scope of kernel
    configuration.

    Signed-off-by: James Morris
    Signed-off-by: Andrew Morton
    Signed-off-by: David S. Miller

    James Morris
     

26 Mar, 2006

1 commit

  • * 'audit.b3' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current: (22 commits)
    [PATCH] fix audit_init failure path
    [PATCH] EXPORT_SYMBOL patch for audit_log, audit_log_start, audit_log_end and audit_format
    [PATCH] sem2mutex: audit_netlink_sem
    [PATCH] simplify audit_free() locking
    [PATCH] Fix audit operators
    [PATCH] promiscuous mode
    [PATCH] Add tty to syscall audit records
    [PATCH] add/remove rule update
    [PATCH] audit string fields interface + consumer
    [PATCH] SE Linux audit events
    [PATCH] Minor cosmetic cleanups to the code moved into auditfilter.c
    [PATCH] Fix audit record filtering with !CONFIG_AUDITSYSCALL
    [PATCH] Fix IA64 success/failure indication in syscall auditing.
    [PATCH] Miscellaneous bug and warning fixes
    [PATCH] Capture selinux subject/object context information.
    [PATCH] Exclude messages by message type
    [PATCH] Collect more inode information during syscall processing.
    [PATCH] Pass dentry, not just name, in fsnotify creation hooks.
    [PATCH] Define new range of userspace messages.
    [PATCH] Filter rule comparators
    ...

    Fixed trivial conflict in security/selinux/hooks.c

    Linus Torvalds