20 Jul, 2012

1 commit

  • Remove linux/mm.h inclusion from netdevice.h -- it's unused (I've checked manually).

    To prevent mm.h inclusion via other channels also extract "enum dma_data_direction"
    definition into separate header. This tiny piece is what gluing netdevice.h with mm.h
    via "netdevice.h => dmaengine.h => dma-mapping.h => scatterlist.h => mm.h".
    Removal of mm.h from scatterlist.h was tried and was found not feasible
    on most archs, so the link was cutoff earlier.

    Hope people are OK with tiny include file.

    Note, that mm_types.h is still dragged in, but it is a separate story.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: David S. Miller

    Alexey Dobriyan
     

01 Jun, 2012

1 commit

  • commit 154c50ca4eb9ae472f50b6a481213e21ead4457d upstream.

    We reset the bool names and values array to NULL, but do not reset the
    number of entries in these arrays to 0. If we error out and then get back
    into this function we will walk these NULL pointers based on the belief
    that they are non-zero length.

    Signed-off-by: Eric Paris
    Signed-off-by: Greg Kroah-Hartman

    Eric Paris
     

23 Apr, 2012

2 commits

  • commit 51b79bee627d526199b2f6a6bef8ee0c0739b6d1 upstream.

    Add missing "personality.h"
    security/commoncap.c: In function 'cap_bprm_set_creds':
    security/commoncap.c:510: error: 'PER_CLEAR_ON_SETID' undeclared (first use in this function)
    security/commoncap.c:510: error: (Each undeclared identifier is reported only once
    security/commoncap.c:510: error: for each function it appears in.)

    Signed-off-by: Jonghwan Choi
    Acked-by: Serge Hallyn
    Signed-off-by: James Morris
    Cc: Eric Paris
    Signed-off-by: Greg Kroah-Hartman

    Jonghwan Choi
     
  • commit d52fc5dde171f030170a6cb78034d166b13c9445 upstream.

    If a process increases permissions using fcaps all of the dangerous
    personality flags which are cleared for suid apps should also be cleared.
    Thus programs given priviledge with fcaps will continue to have address space
    randomization enabled even if the parent tried to disable it to make it
    easier to attack.

    Signed-off-by: Eric Paris
    Reviewed-by: Serge Hallyn
    Signed-off-by: James Morris
    Signed-off-by: Greg Kroah-Hartman

    Eric Paris
     

13 Apr, 2012

1 commit

  • commit df91e49477a9be15921cb2854e1d12a3bdb5e425 upstream.

    Userspace can pass in arbitrary combinations of MS_* flags to mount().

    If both MS_BIND and one of MS_SHARED/MS_PRIVATE/MS_SLAVE/MS_UNBINDABLE are
    passed, device name which should be checked for MS_BIND was not checked because
    MS_SHARED/MS_PRIVATE/MS_SLAVE/MS_UNBINDABLE had higher priority than MS_BIND.

    If both one of MS_BIND/MS_MOVE and MS_REMOUNT are passed, device name which
    should not be checked for MS_REMOUNT was checked because MS_BIND/MS_MOVE had
    higher priority than MS_REMOUNT.

    Fix these bugs by changing priority to MS_REMOUNT -> MS_BIND ->
    MS_SHARED/MS_PRIVATE/MS_SLAVE/MS_UNBINDABLE -> MS_MOVE as with do_mount() does.

    Also, unconditionally return -EINVAL if more than one of
    MS_SHARED/MS_PRIVATE/MS_SLAVE/MS_UNBINDABLE is passed so that TOMOYO will not
    generate inaccurate audit logs, for commit 7a2e8a8f "VFS: Sanity check mount
    flags passed to change_mnt_propagation()" clarified that these flags must be
    exclusively passed.

    Signed-off-by: Tetsuo Handa
    Signed-off-by: James Morris
    Signed-off-by: Jonathan Nieder
    Signed-off-by: Greg Kroah-Hartman

    Tetsuo Handa
     

26 Jan, 2012

2 commits

  • commit 7b7e5916aa2f46e57f8bd8cb89c34620ebfda5da upstream.

    Don't free a valid measurement entry on TPM PCR extend failure.

    Signed-off-by: Roberto Sassu
    Signed-off-by: Mimi Zohar
    Signed-off-by: Greg Kroah-Hartman

    Roberto Sassu
     
  • commit 45fae7493970d7c45626ccd96d4a74f5f1eea5a9 upstream.

    Info about new measurements are cached in the iint for performance. When
    the inode is flushed from cache, the associated iint is flushed as well.
    Subsequent access to the inode will cause the inode to be re-measured and
    will attempt to add a duplicate entry to the measurement list.

    This patch frees the duplicate measurement memory, fixing a memory leak.

    Signed-off-by: Roberto Sassu
    Signed-off-by: Mimi Zohar
    Signed-off-by: Greg Kroah-Hartman

    Roberto Sassu
     

07 Jan, 2012

1 commit

  • commit 50345f1ea9cda4618d9c26e590a97ecd4bc7ac75 upstream.

    Fix the following bug in sel_netport_insert() where rcu_dereference() should
    be rcu_dereference_protected() as sel_netport_lock is held.

    ===================================================
    [ INFO: suspicious rcu_dereference_check() usage. ]
    ---------------------------------------------------
    security/selinux/netport.c:127 invoked rcu_dereference_check() without protection!

    other info that might help us debug this:

    rcu_scheduler_active = 1, debug_locks = 0
    1 lock held by ossec-rootcheck/3323:
    #0: (sel_netport_lock){+.....}, at: [] sel_netport_sid+0xbb/0x226

    stack backtrace:
    Pid: 3323, comm: ossec-rootcheck Not tainted 3.1.0-rc8-fsdevel+ #1095
    Call Trace:
    [] lockdep_rcu_dereference+0xa7/0xb0
    [] sel_netport_sid+0x1b7/0x226
    [] ? sel_netport_avc_callback+0xbc/0xbc
    [] selinux_socket_bind+0x115/0x230
    [] ? might_fault+0x4e/0x9e
    [] ? might_fault+0x97/0x9e
    [] security_socket_bind+0x11/0x13
    [] sys_bind+0x56/0x95
    [] ? sysret_check+0x27/0x62
    [] ? trace_hardirqs_on_caller+0x11e/0x155
    [] ? audit_syscall_entry+0x17b/0x1ae
    [] ? trace_hardirqs_on_thunk+0x3a/0x3f
    [] system_call_fastpath+0x16/0x1b

    Signed-off-by: David Howells
    Acked-by: Paul Moore
    Acked-by: Eric Dumazet
    Signed-off-by: James Morris
    Signed-off-by: Greg Kroah-Hartman

    David Howells
     

22 Dec, 2011

1 commit

  • commit 02125a826459a6ad142f8d91c5b6357562f96615 upstream.

    __d_path() API is asking for trouble and in case of apparmor d_namespace_path()
    getting just that. The root cause is that when __d_path() misses the root
    it had been told to look for, it stores the location of the most remote ancestor
    in *root. Without grabbing references. Sure, at the moment of call it had
    been pinned down by what we have in *path. And if we raced with umount -l, we
    could have very well stopped at vfsmount/dentry that got freed as soon as
    prepend_path() dropped vfsmount_lock.

    It is safe to compare these pointers with pre-existing (and known to be still
    alive) vfsmount and dentry, as long as all we are asking is "is it the same
    address?". Dereferencing is not safe and apparmor ended up stepping into
    that. d_namespace_path() really wants to examine the place where we stopped,
    even if it's not connected to our namespace. As the result, it looked
    at ->d_sb->s_magic of a dentry that might've been already freed by that point.
    All other callers had been careful enough to avoid that, but it's really
    a bad interface - it invites that kind of trouble.

    The fix is fairly straightforward, even though it's bigger than I'd like:
    * prepend_path() root argument becomes const.
    * __d_path() is never called with NULL/NULL root. It was a kludge
    to start with. Instead, we have an explicit function - d_absolute_root().
    Same as __d_path(), except that it doesn't get root passed and stops where
    it stops. apparmor and tomoyo are using it.
    * __d_path() returns NULL on path outside of root. The main
    caller is show_mountinfo() and that's precisely what we pass root for - to
    skip those outside chroot jail. Those who don't want that can (and do)
    use d_path().
    * __d_path() root argument becomes const. Everyone agrees, I hope.
    * apparmor does *NOT* try to use __d_path() or any of its variants
    when it sees that path->mnt is an internal vfsmount. In that case it's
    definitely not mounted anywhere and dentry_path() is exactly what we want
    there. Handling of sysctl()-triggered weirdness is moved to that place.
    * if apparmor is asked to do pathname relative to chroot jail
    and __d_path() tells it we it's not in that jail, the sucker just calls
    d_absolute_path() instead. That's the other remaining caller of __d_path(),
    BTW.
    * seq_path_root() does _NOT_ return -ENAMETOOLONG (it's stupid anyway -
    the normal seq_file logics will take care of growing the buffer and redoing
    the call of ->show() just fine). However, if it gets path not reachable
    from root, it returns SEQ_SKIP. The only caller adjusted (i.e. stopped
    ignoring the return value as it used to do).

    Reviewed-by: John Johansen
    ACKed-by: John Johansen
    Signed-off-by: Al Viro
    Signed-off-by: Greg Kroah-Hartman

    Al Viro
     

22 Nov, 2011

1 commit

  • commit 9f35a33b8d06263a165efe3541d9aa0cdbd70b3b upstream.

    Fix a NULL pointer deref in the user-defined key type whereby updating a
    negative key into a fully instantiated key will cause an oops to occur
    when the code attempts to free the non-existent old payload.

    This results in an oops that looks something like the following:

    BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
    IP: [] __call_rcu+0x11/0x13e
    PGD 3391d067 PUD 3894a067 PMD 0
    Oops: 0002 [#1] SMP
    CPU 1
    Pid: 4354, comm: keyctl Not tainted 3.1.0-fsdevel+ #1140 /DG965RY
    RIP: 0010:[] [] __call_rcu+0x11/0x13e
    RSP: 0018:ffff88003d591df8 EFLAGS: 00010246
    RAX: 0000000000000000 RBX: 0000000000000000 RCX: 000000000000006e
    RDX: ffffffff8161d0c0 RSI: 0000000000000000 RDI: 0000000000000000
    RBP: ffff88003d591e18 R08: 0000000000000000 R09: ffffffff8152fa6c
    R10: 0000000000000000 R11: 0000000000000300 R12: ffff88003b8f9538
    R13: ffffffff8161d0c0 R14: ffff88003b8f9d50 R15: ffff88003c69f908
    FS: 00007f97eb18c720(0000) GS:ffff88003bd00000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000000000000008 CR3: 000000003d47a000 CR4: 00000000000006e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Process keyctl (pid: 4354, threadinfo ffff88003d590000, task ffff88003c78a040)
    Stack:
    ffff88003e0ffde0 ffff88003b8f9538 0000000000000001 ffff88003b8f9d50
    ffff88003d591e28 ffffffff810860f0 ffff88003d591e68 ffffffff8117bfea
    ffff88003d591e68 ffffffff00000000 ffff88003e0ffde1 ffff88003e0ffde0
    Call Trace:
    [] call_rcu_sched+0x10/0x12
    [] user_update+0x8d/0xa2
    [] key_create_or_update+0x236/0x270
    [] sys_add_key+0x123/0x17e
    [] system_call_fastpath+0x16/0x1b

    Signed-off-by: David Howells
    Acked-by: Jeff Layton
    Acked-by: Neil Horman
    Acked-by: Steve Dickson
    Acked-by: James Morris
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    David Howells
     

05 Aug, 2011

2 commits

  • commit 25e75dff519bcce2cb35023105e7df51d7b9e691 upstream.

    AppArmor is masking the capabilities returned by capget against the
    capabilities mask in the profile. This is wrong, in complain mode the
    profile has effectively all capabilities, as the profile restrictions are
    not being enforced, merely tested against to determine if an access is
    known by the profile.

    This can result in the wrong behavior of security conscience applications
    like sshd which examine their capability set, and change their behavior
    accordingly. In this case because of the masked capability set being
    returned sshd fails due to DAC checks, even when the profile is in complain
    mode.

    Kernels affected: 2.6.36 - 3.0.

    Signed-off-by: John Johansen
    Signed-off-by: Greg Kroah-Hartman

    John Johansen
     
  • commit 04fdc099f9c80c7775dbac388fc97e156d4d47e7 upstream.

    The pointer returned from tracehook_tracer_task() is only valid inside
    the rcu_read_lock. However the tracer pointer obtained is being passed
    to aa_may_ptrace outside of the rcu_read_lock critical section.

    Mover the aa_may_ptrace test into the rcu_read_lock critical section, to
    fix this.

    Kernels affected: 2.6.36 - 3.0

    Reported-by: Oleg Nesterov
    Signed-off-by: John Johansen
    Signed-off-by: Greg Kroah-Hartman

    John Johansen
     

22 Jun, 2011

1 commit

  • Fix error handling in construct_key_and_link().

    If construct_alloc_key() returns an error, it shouldn't pass out through
    the normal path as the key_serial() called by the kleave() statement
    will oops when it gets an error code in the pointer:

    BUG: unable to handle kernel paging request at ffffffffffffff84
    IP: [] request_key_and_link+0x4d7/0x52f
    ..
    Call Trace:
    [] request_key+0x41/0x75
    [] cifs_get_spnego_key+0x206/0x226 [cifs]
    [] CIFS_SessSetup+0x511/0x1234 [cifs]
    [] cifs_setup_session+0x90/0x1ae [cifs]
    [] cifs_get_smb_ses+0x34b/0x40f [cifs]
    [] cifs_mount+0x13f/0x504 [cifs]
    [] cifs_do_mount+0xc4/0x672 [cifs]
    [] mount_fs+0x69/0x155
    [] vfs_kern_mount+0x63/0xa0
    [] do_kern_mount+0x4d/0xdf
    [] do_mount+0x63c/0x69f
    [] sys_mount+0x88/0xc2
    [] system_call_fastpath+0x16/0x1b

    Signed-off-by: David Howells
    Acked-by: Jeff Layton
    Signed-off-by: Linus Torvalds

    David Howells
     

21 Jun, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
    devcgroup_inode_permission: take "is it a device node" checks to inlined wrapper
    fix comment in generic_permission()
    kill obsolete comment for follow_down()
    proc_sys_permission() is OK in RCU mode
    reiserfs_permission() doesn't need to bail out in RCU mode
    proc_fd_permission() is doesn't need to bail out in RCU mode
    nilfs2_permission() doesn't need to bail out in RCU mode
    logfs doesn't need ->permission() at all
    coda_ioctl_permission() is safe in RCU mode
    cifs_permission() doesn't need to bail out in RCU mode
    bad_inode_permission() is safe from RCU mode
    ubifs: dereferencing an ERR_PTR in ubifs_mount()

    Linus Torvalds
     

20 Jun, 2011

1 commit


18 Jun, 2011

1 commit

  • ____call_usermodehelper() now erases any credentials set by the
    subprocess_inf::init() function. The problem is that commit
    17f60a7da150 ("capabilites: allow the application of capability limits
    to usermode helpers") creates and commits new credentials with
    prepare_kernel_cred() after the call to the init() function. This wipes
    all keyrings after umh_keys_init() is called.

    The best way to deal with this is to put the init() call just prior to
    the commit_creds() call, and pass the cred pointer to init(). That
    means that umh_keys_init() and suchlike can modify the credentials
    _before_ they are published and potentially in use by the rest of the
    system.

    This prevents request_key() from working as it is prevented from passing
    the session keyring it set up with the authorisation token to
    /sbin/request-key, and so the latter can't assume the authority to
    instantiate the key. This causes the in-kernel DNS resolver to fail
    with ENOKEY unconditionally.

    Signed-off-by: David Howells
    Acked-by: Eric Paris
    Tested-by: Jeff Layton
    Signed-off-by: Linus Torvalds

    David Howells
     

15 Jun, 2011

2 commits


14 Jun, 2011

1 commit

  • In tomoyo_mount_acl() since 2.6.36, kern_path() was called without checking
    dev_name != NULL. As a result, an unprivileged user can trigger oops by issuing
    mount(NULL, "/", "ext3", 0, NULL) request.
    Fix this by checking dev_name != NULL before calling kern_path(dev_name).

    Signed-off-by: Tetsuo Handa
    Cc: stable@kernel.org
    Signed-off-by: James Morris

    Tetsuo Handa
     

09 Jun, 2011

2 commits

  • Affected kernels 2.6.36 - 3.0

    AppArmor may do a GFP_KERNEL memory allocation with task_lock(tsk->group_leader);
    held when called from security_task_setrlimit. This will only occur when the
    task's current policy has been replaced, and the task's creds have not been
    updated before entering the LSM security_task_setrlimit() hook.

    BUG: sleeping function called from invalid context at mm/slub.c:847
    in_atomic(): 1, irqs_disabled(): 0, pid: 1583, name: cupsd
    2 locks held by cupsd/1583:
    #0: (tasklist_lock){.+.+.+}, at: [] do_prlimit+0x61/0x189
    #1: (&(&p->alloc_lock)->rlock){+.+.+.}, at: []
    do_prlimit+0x94/0x189
    Pid: 1583, comm: cupsd Not tainted 3.0.0-rc2-git1 #7
    Call Trace:
    [] __might_sleep+0x10d/0x112
    [] slab_pre_alloc_hook.isra.49+0x2d/0x33
    [] kmem_cache_alloc+0x22/0x132
    [] prepare_creds+0x35/0xe4
    [] aa_replace_current_profile+0x35/0xb2
    [] aa_current_profile+0x45/0x4c
    [] apparmor_task_setrlimit+0x19/0x3a
    [] security_task_setrlimit+0x11/0x13
    [] do_prlimit+0xd2/0x189
    [] sys_setrlimit+0x3b/0x48
    [] system_call_fastpath+0x16/0x1b

    Signed-off-by: John Johansen
    Reported-by: Miles Lane
    Cc: stable@kernel.org
    Signed-off-by: James Morris

    John Johansen
     
  • This is a rather hot function that is called with a potentially NULL
    "struct common_audit_data" pointer argument. And in that case it has to
    provide and initialize its own dummy common_audit_data structure.

    However, all the _common_ cases already pass it a real audit-data
    structure, so that uncommon NULL case not only creates a silly run-time
    test, more importantly it causes that function to have a big stack frame
    for the dummy variable that isn't even used in the common case!

    So get rid of that stupid run-time behavior, and make the (few)
    functions that currently call with a NULL pointer just call a new helper
    function instead (naturally called inode_has_perm_noapd(), since it has
    no adp argument).

    This makes the run-time test be a static code generation issue instead,
    and allows for a much denser stack since none of the common callers need
    the dummy structure. And a denser stack not only means less stack space
    usage, it means better cache behavior. So we have a win-win-win from
    this simplification: less code executed, smaller stack footprint, and
    better cache behavior.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

01 Jun, 2011

1 commit

  • When invalid parameters are passed to apparmor_setprocattr a NULL deref
    oops occurs when it tries to record an audit message. This is because
    it is passing NULL for the profile parameter for aa_audit. But aa_audit
    now requires that the profile passed is not NULL.

    Fix this by passing the current profile on the task that is trying to
    setprocattr.

    Signed-off-by: Kees Cook
    Signed-off-by: John Johansen
    Cc: stable@kernel.org
    Signed-off-by: James Morris

    Kees Cook
     

28 May, 2011

1 commit


27 May, 2011

5 commits

  • Right now security_get_user_sids() will pass in a NULL avd pointer to
    avc_has_perm_noaudit(), which then forces that function to have a dummy
    entry for that case and just generally test it.

    Don't do it. The normal callers all pass a real avd pointer, and this
    helper function is incredibly hot. So don't make avc_has_perm_noaudit()
    do conditional stuff that isn't needed for the common case.

    This also avoids some duplicated stack space.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Add cgroup subsystem callbacks for per-thread attachment in atomic contexts

    Add can_attach_task(), pre_attach(), and attach_task() as new callbacks
    for cgroups's subsystem interface. Unlike can_attach and attach, these
    are for per-thread operations, to be called potentially many times when
    attaching an entire threadgroup.

    Also, the old "bool threadgroup" interface is removed, as replaced by
    this. All subsystems are modified for the new interface - of note is
    cpuset, which requires from/to nodemasks for attach to be globally scoped
    (though per-cpuset would work too) to persist from its pre_attach to
    attach_task and attach.

    This is a pre-patch for cgroup-procs-writable.patch.

    Signed-off-by: Ben Blum
    Cc: "Eric W. Biederman"
    Cc: Li Zefan
    Cc: Matt Helsley
    Reviewed-by: Paul Menage
    Cc: Oleg Nesterov
    Cc: David Rientjes
    Cc: Miao Xie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ben Blum
     
  • I submit the patch again, according to patch submission convension.

    This patch enables to accept percent-encoded object names as forth
    argument of /selinux/create interface to avoid possible bugs when we
    give an object name including whitespace or multibutes.

    E.g) if and when a userspace object manager tries to create a new object
    named as "resolve.conf but fake", it shall give this name as the forth
    argument of the /selinux/create. But sscanf() logic in kernel space
    fetches only the part earlier than the first whitespace.
    In this case, selinux may unexpectedly answer a default security context
    configured to "resolve.conf", but it is bug.

    Although I could not test this patch on named TYPE_TRANSITION rules
    actually, But debug printk() message seems to me the logic works
    correctly.
    I assume the libselinux provides an interface to apply this logic
    transparently, so nothing shall not be changed from the viewpoint of
    application.

    Signed-off-by: KaiGai Kohei
    Signed-off-by: Eric Paris

    Kohei Kaigai
     
  • Conflicts:
    lib/flex_array.c
    security/selinux/avc.c
    security/selinux/hooks.c
    security/selinux/ss/policydb.c
    security/smack/smack_lsm.c

    Eric Paris
     
  • Since this cred was not created with copy_creds(), it needs to get
    initialized. Otherwise use of syscall(__NR_keyctl, KEYCTL_SESSION_TO_PARENT);
    can lead to a NULL deref. Thanks to Robert for finding this.

    But introduced by commit 47a150edc2a ("Cache user_ns in struct cred").

    Signed-off-by: Serge E. Hallyn
    Reported-by: Robert Święcki
    Cc: David Howells
    Cc: stable@kernel.org (2.6.39)
    Signed-off-by: Linus Torvalds

    Serge E. Hallyn
     

24 May, 2011

3 commits

  • Conflicts:
    lib/flex_array.c
    security/selinux/avc.c
    security/selinux/hooks.c
    security/selinux/ss/policydb.c
    security/smack/smack_lsm.c

    Manually resolve conflicts.

    Signed-off-by: James Morris

    James Morris
     
  • James Morris
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
    b43: fix comment typo reqest -> request
    Haavard Skinnemoen has left Atmel
    cris: typo in mach-fs Makefile
    Kconfig: fix copy/paste-ism for dell-wmi-aio driver
    doc: timers-howto: fix a typo ("unsgined")
    perf: Only include annotate.h once in tools/perf/util/ui/browsers/annotate.c
    md, raid5: Fix spelling error in comment ('Ofcourse' --> 'Of course').
    treewide: fix a few typos in comments
    regulator: change debug statement be consistent with the style of the rest
    Revert "arm: mach-u300/gpio: Fix mem_region resource size miscalculations"
    audit: acquire creds selectively to reduce atomic op overhead
    rtlwifi: don't touch with treewide double semicolon removal
    treewide: cleanup continuations and remove logging message whitespace
    ath9k_hw: don't touch with treewide double semicolon removal
    include/linux/leds-regulator.h: fix syntax in example code
    tty: fix typo in descripton of tty_termios_encode_baud_rate
    xtensa: remove obsolete BKL kernel option from defconfig
    m68k: fix comment typo 'occcured'
    arch:Kconfig.locks Remove unused config option.
    treewide: remove extra semicolons
    ...

    Linus Torvalds
     

20 May, 2011

4 commits

  • There is no point in counting hits - we can calculate it from the number
    of lookups and misses.

    This makes the avc statistics a bit smaller, and makes the code
    generation better too.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • You can turn off the avc cache stats, but distributions seem to not do
    that (perhaps because several performance tuning how-to's talk about the
    avc cache statistics).

    Which is sad, because the code it generates is truly horrendous, with
    the statistics update being sandwitched between get_cpu/put_cpu which in
    turn causes preemption disables etc. We're talking ten+ instructions
    just to increment a per-cpu variable in some pretty hot code.

    Fix the craziness by just using 'this_cpu_inc()' instead. Suddenly we
    only need a single 'inc' instruction to increment the statistics. This
    is quite noticeable in the incredibly hot avc_has_perm_noaudit()
    function (which triggers all the statistics by virtue of doing an
    avc_lookup() call).

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • * 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (78 commits)
    Revert "rcu: Decrease memory-barrier usage based on semi-formal proof"
    net,rcu: convert call_rcu(prl_entry_destroy_rcu) to kfree
    batman,rcu: convert call_rcu(softif_neigh_free_rcu) to kfree_rcu
    batman,rcu: convert call_rcu(neigh_node_free_rcu) to kfree()
    batman,rcu: convert call_rcu(gw_node_free_rcu) to kfree_rcu
    net,rcu: convert call_rcu(kfree_tid_tx) to kfree_rcu()
    net,rcu: convert call_rcu(xt_osf_finger_free_rcu) to kfree_rcu()
    net/mac80211,rcu: convert call_rcu(work_free_rcu) to kfree_rcu()
    net,rcu: convert call_rcu(wq_free_rcu) to kfree_rcu()
    net,rcu: convert call_rcu(phonet_device_rcu_free) to kfree_rcu()
    perf,rcu: convert call_rcu(swevent_hlist_release_rcu) to kfree_rcu()
    perf,rcu: convert call_rcu(free_ctx) to kfree_rcu()
    net,rcu: convert call_rcu(__nf_ct_ext_free_rcu) to kfree_rcu()
    net,rcu: convert call_rcu(net_generic_release) to kfree_rcu()
    net,rcu: convert call_rcu(netlbl_unlhsh_free_addr6) to kfree_rcu()
    net,rcu: convert call_rcu(netlbl_unlhsh_free_addr4) to kfree_rcu()
    security,rcu: convert call_rcu(sel_netif_free) to kfree_rcu()
    net,rcu: convert call_rcu(xps_dev_maps_release) to kfree_rcu()
    net,rcu: convert call_rcu(xps_map_release) to kfree_rcu()
    net,rcu: convert call_rcu(rps_map_release) to kfree_rcu()
    ...

    Linus Torvalds
     
  • move LSM-, credentials-, and keys-related files from Documentation/
    to Documentation/security/,
    add Documentation/security/00-INDEX, and
    update all occurrences of Documentation/
    to Documentation/security/.

    Randy Dunlap
     

19 May, 2011

1 commit


13 May, 2011

2 commits


12 May, 2011

2 commits

  • In tomoyo_correct_domain() since 2.6.36, TOMOYO was by error validating
    "" + "/foo/\" + "/bar" when " /foo/\* /bar" was given.
    As a result, legal domainnames like " /foo/\* /bar" are rejected.

    Reported-by: Hayama Yossihiro
    Signed-off-by: Tetsuo Handa
    Signed-off-by: James Morris

    Tetsuo Handa
     
  • In the interest of keeping userspace from having to create new root
    filesystems all the time, let's follow the lead of the other in-kernel
    filesystems and provide a proper mount point for it in sysfs.

    For selinuxfs, this mount point should be in /sys/fs/selinux/

    Cc: Stephen Smalley
    Cc: James Morris
    Cc: Eric Paris
    Cc: Lennart Poettering
    Cc: Daniel J Walsh
    Signed-off-by: Greg Kroah-Hartman
    [include kobject.h - Eric Paris]
    [use selinuxfs_obj throughout - Eric Paris]
    Signed-off-by: Eric Paris

    Greg Kroah-Hartman