01 Jun, 2012

2 commits


22 May, 2012

1 commit


19 May, 2012

2 commits

  • BugLink: http://bugs.launchpad.net/bugs/955892

    All failures from __d_path where being treated as disconnected paths,
    however __d_path can also fail when the generated pathname is too long.

    The initial ENAMETOOLONG error was being lost, and ENAMETOOLONG was only
    returned if the subsequent dentry_path call resulted in that error. Other
    wise if the path was split across a mount point such that the dentry_path
    fit within the buffer when the __d_path did not the failure was treated
    as a disconnected path.

    Signed-off-by: John Johansen

    John Johansen
     
  • BugLink: http://bugs.launchpad.net/bugs/978038

    also affects apparmor portion of
    BugLink: http://bugs.launchpad.net/bugs/987371

    The unconfined profile is not stored in the regular profile list, but
    change_profile and exec transitions may want access to it when setting
    up specialized transitions like switch to the unconfined profile of a
    new policy namespace.

    Signed-off-by: John Johansen

    John Johansen
     

14 Apr, 2012

2 commits

  • Add support for AppArmor to explicitly fail requested domain transitions
    if NO_NEW_PRIVS is set and the task is not unconfined.

    Transitions from unconfined are still allowed because this always results
    in a reduction of privileges.

    Acked-by: Eric Paris
    Signed-off-by: Will Drewry
    Signed-off-by: John Johansen
    Signed-off-by: Andy Lutomirski

    v18: new acked-by, new description
    Signed-off-by: James Morris

    John Johansen
     
  • With this change, calling
    prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)
    disables privilege granting operations at execve-time. For example, a
    process will not be able to execute a setuid binary to change their uid
    or gid if this bit is set. The same is true for file capabilities.

    Additionally, LSM_UNSAFE_NO_NEW_PRIVS is defined to ensure that
    LSMs respect the requested behavior.

    To determine if the NO_NEW_PRIVS bit is set, a task may call
    prctl(PR_GET_NO_NEW_PRIVS, 0, 0, 0, 0);
    It returns 1 if set and 0 if it is not set. If any of the arguments are
    non-zero, it will return -1 and set errno to -EINVAL.
    (PR_SET_NO_NEW_PRIVS behaves similarly.)

    This functionality is desired for the proposed seccomp filter patch
    series. By using PR_SET_NO_NEW_PRIVS, it allows a task to modify the
    system call behavior for itself and its child tasks without being
    able to impact the behavior of a more privileged task.

    Another potential use is making certain privileged operations
    unprivileged. For example, chroot may be considered "safe" if it cannot
    affect privileged tasks.

    Note, this patch causes execve to fail when PR_SET_NO_NEW_PRIVS is
    set and AppArmor is in use. It is fixed in a subsequent patch.

    Signed-off-by: Andy Lutomirski
    Signed-off-by: Will Drewry
    Acked-by: Eric Paris
    Acked-by: Kees Cook

    v18: updated change desc
    v17: using new define values as per 3.4
    Signed-off-by: James Morris

    Andy Lutomirski
     

10 Apr, 2012

4 commits


04 Apr, 2012

2 commits

  • It just bloats the audit data structure for no good reason, since the
    only time those fields are filled are just before calling the
    common_lsm_audit() function, which is also the only user of those
    fields.

    So just make them be the arguments to common_lsm_audit(), rather than
    bloating that structure that is passed around everywhere, and is
    initialized in hot paths.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Linus found that the gigantic size of the common audit data caused a big
    perf hit on something as simple as running stat() in a loop. This patch
    requires LSMs to declare the LSM specific portion separately rather than
    doing it in a union. Thus each LSM can be responsible for shrinking their
    portion and don't have to pay a penalty just because other LSMs have a
    bigger space requirement.

    Signed-off-by: Eric Paris
    Signed-off-by: Linus Torvalds

    Eric Paris
     

27 Mar, 2012

1 commit

  • Fix failure in aa_change_onexec api when the request is made from a confined
    task. This failure was caused by two problems

    The AA_MAY_ONEXEC perm was not being mapped correctly for this case.

    The executable name was being checked as second time instead of using the
    requested onexec profile name, which may not be the same as the exec
    profile name. This mistake can not be exploited to grant extra permission
    because of the above flaw where the ONEXEC permission was not being mapped
    so it will not be granted.

    BugLink: http://bugs.launchpad.net/bugs/963756

    Signed-off-by: John Johansen
    Signed-off-by: James Morris

    John Johansen
     

20 Mar, 2012

1 commit


15 Mar, 2012

2 commits


14 Mar, 2012

7 commits


28 Feb, 2012

9 commits


15 Jan, 2012

1 commit

  • * 'for-linus' of git://selinuxproject.org/~jmorris/linux-security:
    capabilities: remove __cap_full_set definition
    security: remove the security_netlink_recv hook as it is equivalent to capable()
    ptrace: do not audit capability check when outputing /proc/pid/stat
    capabilities: remove task_ns_* functions
    capabitlies: ns_capable can use the cap helpers rather than lsm call
    capabilities: style only - move capable below ns_capable
    capabilites: introduce new has_ns_capabilities_noaudit
    capabilities: call has_ns_capability from has_capability
    capabilities: remove all _real_ interfaces
    capabilities: introduce security_capable_noaudit
    capabilities: reverse arguments to security_capable
    capabilities: remove the task from capable LSM hook entirely
    selinux: sparse fix: fix several warnings in the security server cod
    selinux: sparse fix: fix warnings in netlink code
    selinux: sparse fix: eliminate warnings for selinuxfs
    selinux: sparse fix: declare selinux_disable() in security.h
    selinux: sparse fix: move selinux_complete_init
    selinux: sparse fix: make selinux_secmark_refcount static
    SELinux: Fix RCU deref check warning in sel_netport_insert()

    Manually fix up a semantic mis-merge wrt security_netlink_recv():

    - the interface was removed in commit fd7784615248 ("security: remove
    the security_netlink_recv hook as it is equivalent to capable()")

    - a new user of it appeared in commit a38f7907b926 ("crypto: Add
    userspace configuration API")

    causing no automatic merge conflict, but Eric Paris pointed out the
    issue.

    Linus Torvalds
     

13 Jan, 2012

1 commit


11 Jan, 2012

1 commit

  • * 'for-linus' of git://selinuxproject.org/~jmorris/linux-security: (32 commits)
    ima: fix invalid memory reference
    ima: free duplicate measurement memory
    security: update security_file_mmap() docs
    selinux: Casting (void *) value returned by kmalloc is useless
    apparmor: fix module parameter handling
    Security: tomoyo: add .gitignore file
    tomoyo: add missing rcu_dereference()
    apparmor: add missing rcu_dereference()
    evm: prevent racing during tfm allocation
    evm: key must be set once during initialization
    mpi/mpi-mpow: NULL dereference on allocation failure
    digsig: build dependency fix
    KEYS: Give key types their own lockdep class for key->sem
    TPM: fix transmit_cmd error logic
    TPM: NSC and TIS drivers X86 dependency fix
    TPM: Export wait_for_stat for other vendor specific drivers
    TPM: Use vendor specific function for status probe
    tpm_tis: add delay after aborting command
    tpm_tis: Check return code from getting timeouts/durations
    tpm: Introduce function to poll for result of self test
    ...

    Fix up trivial conflict in lib/Makefile due to addition of CONFIG_MPI
    and SIGSIG next to CONFIG_DQL addition.

    Linus Torvalds
     

09 Jan, 2012

1 commit


07 Jan, 2012

1 commit


06 Jan, 2012

1 commit

  • The capabilities framework is based around credentials, not necessarily the
    current task. Yet we still passed the current task down into LSMs from the
    security_capable() LSM hook as if it was a meaningful portion of the security
    decision. This patch removes the 'generic' passing of current and instead
    forces individual LSMs to use current explicitly if they think it is
    appropriate. In our case those LSMs are SELinux and AppArmor.

    I believe the AppArmor use of current is incorrect, but that is wholely
    unrelated to this patch. This patch does not change what AppArmor does, it
    just makes it clear in the AppArmor code that it is doing it.

    The SELinux code still uses current in it's audit message, which may also be
    wrong and needs further investigation. Again this is NOT a change, it may
    have always been wrong, this patch just makes it clear what is happening.

    Signed-off-by: Eric Paris

    Eric Paris
     

04 Jan, 2012

1 commit