15 Mar, 2014

1 commit


10 Mar, 2014

1 commit

  • This fixes CVE-2014-0102.

    The following command sequence produces an oops:

    keyctl new_session
    i=`keyctl newring _ses @s`
    keyctl link @s $i

    The problem is that search_nested_keyrings() sees two keyrings that have
    matching type and description, so keyring_compare_object() returns true.
    s_n_k() then passes the key to the iterator function -
    keyring_detect_cycle_iterator() - which *should* check to see whether this is
    the keyring of interest, not just one with the same name.

    Because assoc_array_find() will return one and only one match, I assumed that
    the iterator function would only see an exact match or never be called - but
    the iterator isn't only called from assoc_array_find()...

    The oops looks something like this:

    kernel BUG at /data/fs/linux-2.6-fscache/security/keys/keyring.c:1003!
    invalid opcode: 0000 [#1] SMP
    ...
    RIP: keyring_detect_cycle_iterator+0xe/0x1f
    ...
    Call Trace:
    search_nested_keyrings+0x76/0x2aa
    __key_link_check_live_key+0x50/0x5f
    key_link+0x4e/0x85
    keyctl_keyring_link+0x60/0x81
    SyS_keyctl+0x65/0xe4
    tracesys+0xdd/0xe2

    The fix is to make keyring_detect_cycle_iterator() check that the key it
    has is the key it was actually looking for rather than calling BUG_ON().

    A testcase has been included in the keyutils testsuite for this:

    http://git.kernel.org/cgit/linux/kernel/git/dhowells/keyutils.git/commit/?id=891f3365d07f1996778ade0e3428f01878a1790b

    Reported-by: Tommi Rantala
    Signed-off-by: David Howells
    Acked-by: James Morris
    Signed-off-by: Linus Torvalds

    David Howells
     

06 Mar, 2014

1 commit

  • Conflicts:
    drivers/net/wireless/ath/ath9k/recv.c
    drivers/net/wireless/mwifiex/pcie.c
    net/ipv6/sit.c

    The SIT driver conflict consists of a bug fix being done by hand
    in 'net' (missing u64_stats_init()) whilst in 'net-next' a helper
    was created (netdev_alloc_pcpu_stats()) which takes care of this.

    The two wireless conflicts were overlapping changes.

    Signed-off-by: David S. Miller

    David S. Miller
     

24 Feb, 2014

1 commit


21 Feb, 2014

1 commit

  • When writing policy via /sys/fs/selinux/policy I wrote the type and class
    of filename trans rules in CPU endian instead of little endian. On
    x86_64 this works just fine, but it means that on big endian arch's like
    ppc64 and s390 userspace reads the policy and converts it from
    le32_to_cpu. So the values are all screwed up. Write the values in le
    format like it should have been to start.

    Signed-off-by: Eric Paris
    Acked-by: Stephen Smalley
    Cc: stable@vger.kernel.org
    Signed-off-by: Paul Moore

    Eric Paris
     

12 Feb, 2014

1 commit

  • Inserting a entry into flowcache, or flushing flowcache should be based
    on per net scope. The reason to do so is flushing operation from fat
    netns crammed with flow entries will also making the slim netns with only
    a few flow cache entries go away in original implementation.

    Since flowcache is tightly coupled with IPsec, so it would be easier to
    put flow cache global parameters into xfrm namespace part. And one last
    thing needs to do is bumping flow cache genid, and flush flow cache should
    also be made in per net style.

    Signed-off-by: Fan Du
    Signed-off-by: Steffen Klassert

    Fan Du
     

10 Feb, 2014

1 commit


06 Feb, 2014

2 commits

  • Setting an empty security context (length=0) on a file will
    lead to incorrectly dereferencing the type and other fields
    of the security context structure, yielding a kernel BUG.
    As a zero-length security context is never valid, just reject
    all such security contexts whether coming from userspace
    via setxattr or coming from the filesystem upon a getxattr
    request by SELinux.

    Setting a security context value (empty or otherwise) unknown to
    SELinux in the first place is only possible for a root process
    (CAP_MAC_ADMIN), and, if running SELinux in enforcing mode, only
    if the corresponding SELinux mac_admin permission is also granted
    to the domain by policy. In Fedora policies, this is only allowed for
    specific domains such as livecd for setting down security contexts
    that are not defined in the build host policy.

    Reproducer:
    su
    setenforce 0
    touch foo
    setfattr -n security.selinux foo

    Caveat:
    Relabeling or removing foo after doing the above may not be possible
    without booting with SELinux disabled. Any subsequent access to foo
    after doing the above will also trigger the BUG.

    BUG output from Matthew Thode:
    [ 473.893141] ------------[ cut here ]------------
    [ 473.962110] kernel BUG at security/selinux/ss/services.c:654!
    [ 473.995314] invalid opcode: 0000 [#6] SMP
    [ 474.027196] Modules linked in:
    [ 474.058118] CPU: 0 PID: 8138 Comm: ls Tainted: G D I
    3.13.0-grsec #1
    [ 474.116637] Hardware name: Supermicro X8ST3/X8ST3, BIOS 2.0
    07/29/10
    [ 474.149768] task: ffff8805f50cd010 ti: ffff8805f50cd488 task.ti:
    ffff8805f50cd488
    [ 474.183707] RIP: 0010:[] []
    context_struct_compute_av+0xce/0x308
    [ 474.219954] RSP: 0018:ffff8805c0ac3c38 EFLAGS: 00010246
    [ 474.252253] RAX: 0000000000000000 RBX: ffff8805c0ac3d94 RCX:
    0000000000000100
    [ 474.287018] RDX: ffff8805e8aac000 RSI: 00000000ffffffff RDI:
    ffff8805e8aaa000
    [ 474.321199] RBP: ffff8805c0ac3cb8 R08: 0000000000000010 R09:
    0000000000000006
    [ 474.357446] R10: 0000000000000000 R11: ffff8805c567a000 R12:
    0000000000000006
    [ 474.419191] R13: ffff8805c2b74e88 R14: 00000000000001da R15:
    0000000000000000
    [ 474.453816] FS: 00007f2e75220800(0000) GS:ffff88061fc00000(0000)
    knlGS:0000000000000000
    [ 474.489254] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [ 474.522215] CR2: 00007f2e74716090 CR3: 00000005c085e000 CR4:
    00000000000207f0
    [ 474.556058] Stack:
    [ 474.584325] ffff8805c0ac3c98 ffffffff811b549b ffff8805c0ac3c98
    ffff8805f1190a40
    [ 474.618913] ffff8805a6202f08 ffff8805c2b74e88 00068800d0464990
    ffff8805e8aac860
    [ 474.653955] ffff8805c0ac3cb8 000700068113833a ffff880606c75060
    ffff8805c0ac3d94
    [ 474.690461] Call Trace:
    [ 474.723779] [] ? lookup_fast+0x1cd/0x22a
    [ 474.778049] [] security_compute_av+0xf4/0x20b
    [ 474.811398] [] avc_compute_av+0x2a/0x179
    [ 474.843813] [] avc_has_perm+0x45/0xf4
    [ 474.875694] [] inode_has_perm+0x2a/0x31
    [ 474.907370] [] selinux_inode_getattr+0x3c/0x3e
    [ 474.938726] [] security_inode_getattr+0x1b/0x22
    [ 474.970036] [] vfs_getattr+0x19/0x2d
    [ 475.000618] [] vfs_fstatat+0x54/0x91
    [ 475.030402] [] vfs_lstat+0x19/0x1b
    [ 475.061097] [] SyS_newlstat+0x15/0x30
    [ 475.094595] [] ? __audit_syscall_entry+0xa1/0xc3
    [ 475.148405] [] system_call_fastpath+0x16/0x1b
    [ 475.179201] Code: 00 48 85 c0 48 89 45 b8 75 02 0f 0b 48 8b 45 a0 48
    8b 3d 45 d0 b6 00 8b 40 08 89 c6 ff ce e8 d1 b0 06 00 48 85 c0 49 89 c7
    75 02 0b 48 8b 45 b8 4c 8b 28 eb 1e 49 8d 7d 08 be 80 01 00 00 e8
    [ 475.255884] RIP []
    context_struct_compute_av+0xce/0x308
    [ 475.296120] RSP
    [ 475.328734] ---[ end trace f076482e9d754adc ]---

    Reported-by: Matthew Thode
    Signed-off-by: Stephen Smalley
    Cc: stable@vger.kernel.org
    Signed-off-by: Paul Moore

    Stephen Smalley
     
  • The SELinux AF_NETLINK/NETLINK_SOCK_DIAG socket class was missing the
    SOCK_DIAG_BY_FAMILY definition which caused SELINUX_ERR messages when
    the ss tool was run.

    # ss
    Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
    u_str ESTAB 0 0 * 14189 * 14190
    u_str ESTAB 0 0 * 14145 * 14144
    u_str ESTAB 0 0 * 14151 * 14150
    {...}
    # ausearch -m SELINUX_ERR
    ----
    time->Thu Jan 23 11:11:16 2014
    type=SYSCALL msg=audit(1390493476.445:374):
    arch=c000003e syscall=44 success=yes exit=40
    a0=3 a1=7fff03aa11f0 a2=28 a3=0 items=0 ppid=1852 pid=1895
    auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0
    tty=pts0 ses=1 comm="ss" exe="/usr/sbin/ss"
    subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)
    type=SELINUX_ERR msg=audit(1390493476.445:374):
    SELinux: unrecognized netlink message type=20 for sclass=32

    Signed-off-by: Paul Moore

    Paul Moore
     

05 Feb, 2014

2 commits

  • Linux 3.13

    Conflicts:
    security/selinux/hooks.c

    Trivial merge issue in selinux_inet_conn_request() likely due to me
    including patches that I sent to the stable folks in my next tree
    resulting in the patch hitting twice (I think). Thankfully it was an
    easy fix this time, but regardless, lesson learned, I will not do that
    again.

    Paul Moore
     
  • Binaries compiled for arm may run on arm64 if CONFIG_COMPAT is
    selected. Set LSM_MMAP_MIN_ADDR to 32768 if ARM64 && COMPAT to
    prevent selinux failures launching 32-bit static executables that
    are mapped at 0x8000.

    Signed-off-by: Colin Cross
    Acked-by: Will Deacon
    Acked-by: Eric Paris
    Acked-by: James Morris
    Signed-off-by: Catalin Marinas

    Colin Cross
     

24 Jan, 2014

1 commit

  • Pull audit update from Eric Paris:
    "Again we stayed pretty well contained inside the audit system.
    Venturing out was fixing a couple of function prototypes which were
    inconsistent (didn't hurt anything, but we used the same value as an
    int, uint, u32, and I think even a long in a couple of places).

    We also made a couple of minor changes to when a couple of LSMs called
    the audit system. We hoped to add aarch64 audit support this go
    round, but it wasn't ready.

    I'm disappearing on vacation on Thursday. I should have internet
    access, but it'll be spotty. If anything goes wrong please be sure to
    cc rgb@redhat.com. He'll make fixing things his top priority"

    * git://git.infradead.org/users/eparis/audit: (50 commits)
    audit: whitespace fix in kernel-parameters.txt
    audit: fix location of __net_initdata for audit_net_ops
    audit: remove pr_info for every network namespace
    audit: Modify a set of system calls in audit class definitions
    audit: Convert int limit uses to u32
    audit: Use more current logging style
    audit: Use hex_byte_pack_upper
    audit: correct a type mismatch in audit_syscall_exit()
    audit: reorder AUDIT_TTY_SET arguments
    audit: rework AUDIT_TTY_SET to only grab spin_lock once
    audit: remove needless switch in AUDIT_SET
    audit: use define's for audit version
    audit: documentation of audit= kernel parameter
    audit: wait_for_auditd rework for readability
    audit: update MAINTAINERS
    audit: log task info on feature change
    audit: fix incorrect set of audit_sock
    audit: print error message when fail to create audit socket
    audit: fix dangling keywords in audit_log_set_loginuid() output
    audit: log on errors from filter user rules
    ...

    Linus Torvalds
     

22 Jan, 2014

2 commits

  • Pull cgroup updates from Tejun Heo:
    "The bulk of changes are cleanups and preparations for the upcoming
    kernfs conversion.

    - cgroup_event mechanism which is and will be used only by memcg is
    moved to memcg.

    - pidlist handling is updated so that it can be served by seq_file.

    Also, the list is not sorted if sane_behavior. cgroup
    documentation explicitly states that the file is not sorted but it
    has been for quite some time.

    - All cgroup file handling now happens on top of seq_file. This is
    to prepare for kernfs conversion. In addition, all operations are
    restructured so that they map 1-1 to kernfs operations.

    - Other cleanups and low-pri fixes"

    * 'for-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: (40 commits)
    cgroup: trivial style updates
    cgroup: remove stray references to css_id
    doc: cgroups: Fix typo in doc/cgroups
    cgroup: fix fail path in cgroup_load_subsys()
    cgroup: fix missing unlock on error in cgroup_load_subsys()
    cgroup: remove for_each_root_subsys()
    cgroup: implement for_each_css()
    cgroup: factor out cgroup_subsys_state creation into create_css()
    cgroup: combine css handling loops in cgroup_create()
    cgroup: reorder operations in cgroup_create()
    cgroup: make for_each_subsys() useable under cgroup_root_mutex
    cgroup: css iterations and css_from_dir() are safe under cgroup_mutex
    cgroup: unify pidlist and other file handling
    cgroup: replace cftype->read_seq_string() with cftype->seq_show()
    cgroup: attach cgroup_open_file to all cgroup files
    cgroup: generalize cgroup_pidlist_open_file
    cgroup: unify read path so that seq_file is always used
    cgroup: unify cgroup_write_X64() and cgroup_write_string()
    cgroup: remove cftype->read(), ->read_map() and ->write()
    hugetlb_cgroup: convert away from cftype->read()
    ...

    Linus Torvalds
     
  • Pull security layer updates from James Morris:
    "Changes for this kernel include maintenance updates for Smack, SELinux
    (and several networking fixes), IMA and TPM"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (39 commits)
    SELinux: Fix memory leak upon loading policy
    tpm/tpm-sysfs: active_show() can be static
    tpm: tpm_tis: Fix compile problems with CONFIG_PM_SLEEP/CONFIG_PNP
    tpm: Make tpm-dev allocate a per-file structure
    tpm: Use the ops structure instead of a copy in tpm_vendor_specific
    tpm: Create a tpm_class_ops structure and use it in the drivers
    tpm: Pull all driver sysfs code into tpm-sysfs.c
    tpm: Move sysfs functions from tpm-interface to tpm-sysfs
    tpm: Pull everything related to /dev/tpmX into tpm-dev.c
    char: tpm: nuvoton: remove unused variable
    tpm: MAINTAINERS: Cleanup TPM Maintainers file
    tpm/tpm_i2c_atmel: fix coccinelle warnings
    tpm/tpm_ibmvtpm: fix unreachable code warning (smatch warning)
    tpm/tpm_i2c_stm_st33: Check return code of get_burstcount
    tpm/tpm_ppi: Check return value of acpi_get_name
    tpm/tpm_ppi: Do not compare strcmp(a,b) == -1
    ima: remove unneeded size_limit argument from ima_eventdigest_init_common()
    ima: update IMA-templates.txt documentation
    ima: pass HASH_ALGO__LAST as hash algo in ima_eventdigest_init()
    ima: change the default hash algorithm to SHA1 in ima_eventdigest_ng_init()
    ...

    Linus Torvalds
     

14 Jan, 2014

2 commits

  • Remove the call to audit_log() (which call audit_log_start()) and deal with
    the errors in the caller, logging only once if the condition is met. Calling
    audit_log_start() in this location makes buffer allocation and locking more
    complicated in the calling tree (audit_filter_user()).

    Signed-off-by: Richard Guy Briggs
    Signed-off-by: Eric Paris

    Richard Guy Briggs
     
  • Two of the conditions in selinux_audit_rule_match() should never happen and
    the third indicates a race that should be retried. Remove the calls to
    audit_log() (which call audit_log_start()) and deal with the errors in the
    caller, logging only once if the condition is met. Calling audit_log_start()
    in this location makes buffer allocation and locking more complicated in the
    calling tree (audit_filter_user()).

    Signed-off-by: Richard Guy Briggs
    Signed-off-by: Eric Paris

    Richard Guy Briggs
     

12 Jan, 2014

1 commit

  • While running stress tests on adding and deleting ftrace instances I hit
    this bug:

    BUG: unable to handle kernel NULL pointer dereference at 0000000000000020
    IP: selinux_inode_permission+0x85/0x160
    PGD 63681067 PUD 7ddbe067 PMD 0
    Oops: 0000 [#1] PREEMPT
    CPU: 0 PID: 5634 Comm: ftrace-test-mki Not tainted 3.13.0-rc4-test-00033-gd2a6dde-dirty #20
    Hardware name: /DG965MQ, BIOS MQ96510J.86A.0372.2006.0605.1717 06/05/2006
    task: ffff880078375800 ti: ffff88007ddb0000 task.ti: ffff88007ddb0000
    RIP: 0010:[] [] selinux_inode_permission+0x85/0x160
    RSP: 0018:ffff88007ddb1c48 EFLAGS: 00010246
    RAX: 0000000000000000 RBX: 0000000000800000 RCX: ffff88006dd43840
    RDX: 0000000000000001 RSI: 0000000000000081 RDI: ffff88006ee46000
    RBP: ffff88007ddb1c88 R08: 0000000000000000 R09: ffff88007ddb1c54
    R10: 6e6576652f6f6f66 R11: 0000000000000003 R12: 0000000000000000
    R13: 0000000000000081 R14: ffff88006ee46000 R15: 0000000000000000
    FS: 00007f217b5b6700(0000) GS:ffffffff81e21000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033^M
    CR2: 0000000000000020 CR3: 000000006a0fe000 CR4: 00000000000007f0
    Call Trace:
    security_inode_permission+0x1c/0x30
    __inode_permission+0x41/0xa0
    inode_permission+0x18/0x50
    link_path_walk+0x66/0x920
    path_openat+0xa6/0x6c0
    do_filp_open+0x43/0xa0
    do_sys_open+0x146/0x240
    SyS_open+0x1e/0x20
    system_call_fastpath+0x16/0x1b
    Code: 84 a1 00 00 00 81 e3 00 20 00 00 89 d8 83 c8 02 40 f6 c6 04 0f 45 d8 40 f6 c6 08 74 71 80 cf 02 49 8b 46 38 4c 8d 4d cc 45 31 c0 b7 50 20 8b 70 1c 48 8b 41 70 89 d9 8b 78 04 e8 36 cf ff ff
    RIP selinux_inode_permission+0x85/0x160
    CR2: 0000000000000020

    Investigating, I found that the inode->i_security was NULL, and the
    dereference of it caused the oops.

    in selinux_inode_permission():

    isec = inode->i_security;

    rc = avc_has_perm_noaudit(sid, isec->sid, isec->sclass, perms, 0, &avd);

    Note, the crash came from stressing the deletion and reading of debugfs
    files. I was not able to recreate this via normal files. But I'm not
    sure they are safe. It may just be that the race window is much harder
    to hit.

    What seems to have happened (and what I have traced), is the file is
    being opened at the same time the file or directory is being deleted.
    As the dentry and inode locks are not held during the path walk, nor is
    the inodes ref counts being incremented, there is nothing saving these
    structures from being discarded except for an rcu_read_lock().

    The rcu_read_lock() protects against freeing of the inode, but it does
    not protect freeing of the inode_security_struct. Now if the freeing of
    the i_security happens with a call_rcu(), and the i_security field of
    the inode is not changed (it gets freed as the inode gets freed) then
    there will be no issue here. (Linus Torvalds suggested not setting the
    field to NULL such that we do not need to check if it is NULL in the
    permission check).

    Note, this is a hack, but it fixes the problem at hand. A real fix is
    to restructure the destroy_inode() to call all the destructor handlers
    from the RCU callback. But that is a major job to do, and requires a
    lot of work. For now, we just band-aid this bug with this fix (it
    works), and work on a more maintainable solution in the future.

    Link: http://lkml.kernel.org/r/20140109101932.0508dec7@gandalf.local.home
    Link: http://lkml.kernel.org/r/20140109182756.17abaaa8@gandalf.local.home

    Cc: stable@vger.kernel.org
    Signed-off-by: Steven Rostedt
    Signed-off-by: Linus Torvalds

    Steven Rostedt
     

08 Jan, 2014

1 commit


07 Jan, 2014

1 commit

  • Hello.

    I got below leak with linux-3.10.0-54.0.1.el7.x86_64 .

    [ 681.903890] kmemleak: 5538 new suspected memory leaks (see /sys/kernel/debug/kmemleak)

    Below is a patch, but I don't know whether we need special handing for undoing
    ebitmap_set_bit() call.
    ----------
    >>From fe97527a90fe95e2239dfbaa7558f0ed559c0992 Mon Sep 17 00:00:00 2001
    From: Tetsuo Handa
    Date: Mon, 6 Jan 2014 16:30:21 +0900
    Subject: [PATCH] SELinux: Fix memory leak upon loading policy

    Commit 2463c26d "SELinux: put name based create rules in a hashtable" did not
    check return value from hashtab_insert() in filename_trans_read(). It leaks
    memory if hashtab_insert() returns error.

    unreferenced object 0xffff88005c9160d0 (size 8):
    comm "systemd", pid 1, jiffies 4294688674 (age 235.265s)
    hex dump (first 8 bytes):
    57 0b 00 00 6b 6b 6b a5 W...kkk.
    backtrace:
    [] kmemleak_alloc+0x4e/0xb0
    [] kmem_cache_alloc_trace+0x12e/0x360
    [] policydb_read+0xd1d/0xf70
    [] security_load_policy+0x6c/0x500
    [] sel_write_load+0xac/0x750
    [] vfs_write+0xc0/0x1f0
    [] SyS_write+0x4c/0xa0
    [] system_call_fastpath+0x16/0x1b
    [] 0xffffffffffffffff

    However, we should not return EEXIST error to the caller, or the systemd will
    show below message and the boot sequence freezes.

    systemd[1]: Failed to load SELinux policy. Freezing.

    Signed-off-by: Tetsuo Handa
    Acked-by: Eric Paris
    Cc: stable@vger.kernel.org
    Signed-off-by: Paul Moore

    Tetsuo Handa
     

06 Jan, 2014

2 commits


03 Jan, 2014

3 commits


01 Jan, 2014

2 commits

  • Eric Paris politely points out:

    Inside smack_file_receive() it seems like you are initting the audit
    field with LSM_AUDIT_DATA_TASK. And then use
    smk_ad_setfield_u_fs_path().

    Seems like LSM_AUDIT_DATA_PATH would make more sense. (and depending
    on how it's used fix a crash...)

    He is correct. This puts things in order.

    Targeted for git://git.gitorious.org/smack-next/kernel.git

    Signed-off-by: Casey Schaufler

    Casey Schaufler
     
  • The mount restrictions imposed by Smack rely heavily on the
    use of the filesystem "floor", which is the label that all
    processes writing to the filesystem must have access to. It
    turns out that while the "floor" notion is sound, it has yet
    to be fully implemented and has never been used.

    The sb_mount and sb_umount hooks only make sense if the
    filesystem floor is used actively, and it isn't. They can
    be reintroduced if a rational restriction comes up. Until
    then, they get removed.

    The sb_kern_mount hook is required for the option processing.
    It is too permissive in the case of unprivileged mounts,
    effectively bypassing the CAP_MAC_ADMIN restrictions if
    any of the smack options are specified. Unprivileged mounts
    are no longer allowed to set Smack filesystem options.
    Additionally, the root and default values are set to the
    label of the caller, in keeping with the policy that objects
    get the label of their creator.

    Targeted for git://git.gitorious.org/smack-next/kernel.git

    Signed-off-by: Casey Schaufler

    Casey Schaufler
     

24 Dec, 2013

4 commits

  • smk_write_change_rule() is calling capable rather than
    the more correct smack_privileged(). This allows for setting
    rules in violation of the onlycap facility. This is the
    simple repair.

    Targeted for git://git.gitorious.org/smack-next/kernel.git

    Signed-off-by: Casey Schaufler

    Casey Schaufler
     
  • The syslog control requires that the calling proccess
    have the floor ("_") Smack label. Tizen does not run any
    processes except for kernel helpers with the floor label.
    This changes allows the admin to configure a specific
    label for syslog. The default value is the star ("*")
    label, effectively removing the restriction. The value
    can be set using smackfs/syslog for anyone who wants
    a more restrictive behavior.

    Targeted for git://git.gitorious.org/smack-next/kernel.git

    Signed-off-by: Casey Schaufler

    Casey Schaufler
     
  • selinux_setprocattr() does ptrace_parent(p) under task_lock(p),
    but task_struct->alloc_lock doesn't pin ->parent or ->ptrace,
    this looks confusing and triggers the "suspicious RCU usage"
    warning because ptrace_parent() does rcu_dereference_check().

    And in theory this is wrong, spin_lock()->preempt_disable()
    doesn't necessarily imply rcu_read_lock() we need to access
    the ->parent.

    Reported-by: Evan McNabb
    Signed-off-by: Oleg Nesterov
    Cc: stable@vger.kernel.org
    Signed-off-by: Paul Moore

    Oleg Nesterov
     
  • Fix a broken networking check. Return an error if peer recv fails. If
    secmark is active and the packet recv succeeds the peer recv error is
    ignored.

    Signed-off-by: Chad Hanson
    Cc: stable@vger.kernel.org
    Signed-off-by: Paul Moore

    Chad Hanson
     

20 Dec, 2013

1 commit

  • Smack prohibits processes from using the star ("*") and web ("@") labels
    because we don't want files with those labels getting created implicitly.
    All setting of those labels should be done explicitly. The trouble is that
    there is no check for these labels in the processing of SMACK64EXEC. That
    is repaired.

    Targeted for git://git.gitorious.org/smack-next/kernel.git

    Signed-off-by: Casey Schaufler

    Casey Schaufler
     

17 Dec, 2013

2 commits


16 Dec, 2013

2 commits

  • Pull SELinux fixes from James Morris.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
    selinux: process labeled IPsec TCP SYN-ACK packets properly in selinux_ip_postroute()
    selinux: look for IPsec labels on both inbound and outbound packets
    selinux: handle TCP SYN-ACK packets correctly in selinux_ip_postroute()
    selinux: handle TCP SYN-ACK packets correctly in selinux_ip_output()
    selinux: fix possible memory leak

    Linus Torvalds
     
  • This reverts commit 102aefdda4d8275ce7d7100bc16c88c74272b260.

    Tom London reports that it causes sync() to hang on Fedora rawhide:

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

    and Josh Boyer bisected it down to this commit. Reverting the commit in
    the rawhide kernel fixes the problem.

    Eric Paris root-caused it to incorrect subtype matching in that commit
    breaking fuse, and has a tentative patch, but by now we're better off
    retrying this in 3.14 rather than playing with it any more.

    Reported-by: Tom London
    Bisected-by: Josh Boyer
    Acked-by: Eric Paris
    Cc: James Morris
    Cc: Anand Avati
    Cc: Paul Moore
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

14 Dec, 2013

1 commit

  • Revert "selinux: consider filesystem subtype in policies"

    This reverts commit 102aefdda4d8275ce7d7100bc16c88c74272b260.

    Explanation from Eric Paris:

    SELinux policy can specify if it should use a filesystem's
    xattrs or not. In current policy we have a specification that
    fuse should not use xattrs but fuse.glusterfs should use
    xattrs. This patch has a bug in which non-glusterfs
    filesystems would match the rule saying fuse.glusterfs should
    use xattrs. If both fuse and the particular filesystem in
    question are not written to handle xattr calls during the mount
    command, they will deadlock.

    I have fixed the bug to do proper matching, however I believe a
    revert is still the correct solution. The reason I believe
    that is because the code still does not work. The s_subtype is
    not set until after the SELinux hook which attempts to match on
    the ".gluster" portion of the rule. So we cannot match on the
    rule in question. The code is useless.

    Signed-off-by: Paul Moore

    Paul Moore
     

13 Dec, 2013

4 commits