]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - security/smack/smack_lsm.c
Merge branches 'for-4.11/upstream-fixes', 'for-4.12/accutouch', 'for-4.12/cp2112...
[mirror_ubuntu-artful-kernel.git] / security / smack / smack_lsm.c
index 1723bd370e3a4099d82e68ba12295d41af69b6ac..60b4217b9b685db86521239a272773f9a0aa985a 100644 (file)
@@ -2301,25 +2301,6 @@ static int smack_task_kill(struct task_struct *p, struct siginfo *info,
        return rc;
 }
 
-/**
- * smack_task_wait - Smack access check for waiting
- * @p: task to wait for
- *
- * Returns 0
- */
-static int smack_task_wait(struct task_struct *p)
-{
-       /*
-        * Allow the operation to succeed.
-        * Zombies are bad.
-        * In userless environments (e.g. phones) programs
-        * get marked with SMACK64EXEC and even if the parent
-        * and child shouldn't be talking the parent still
-        * may expect to know when the child exits.
-        */
-       return 0;
-}
-
 /**
  * smack_task_to_inode - copy task smack into the inode blob
  * @p: task to copy from
@@ -3680,7 +3661,6 @@ static int smack_getprocattr(struct task_struct *p, char *name, char **value)
 
 /**
  * smack_setprocattr - Smack process attribute setting
- * @p: the object task
  * @name: the name of the attribute in /proc/.../attr
  * @value: the value to set
  * @size: the size of the value
@@ -3690,8 +3670,7 @@ static int smack_getprocattr(struct task_struct *p, char *name, char **value)
  *
  * Returns the length of the smack label or an error code
  */
-static int smack_setprocattr(struct task_struct *p, char *name,
-                            void *value, size_t size)
+static int smack_setprocattr(const char *name, void *value, size_t size)
 {
        struct task_smack *tsp = current_security();
        struct cred *new;
@@ -3699,13 +3678,6 @@ static int smack_setprocattr(struct task_struct *p, char *name,
        struct smack_known_list_elem *sklep;
        int rc;
 
-       /*
-        * Changing another process' Smack value is too dangerous
-        * and supports no sane use case.
-        */
-       if (p != current)
-               return -EPERM;
-
        if (!smack_privileged(CAP_MAC_ADMIN) && list_empty(&tsp->smk_relabel))
                return -EPERM;
 
@@ -4727,7 +4699,6 @@ static struct security_hook_list smack_hooks[] = {
        LSM_HOOK_INIT(task_getscheduler, smack_task_getscheduler),
        LSM_HOOK_INIT(task_movememory, smack_task_movememory),
        LSM_HOOK_INIT(task_kill, smack_task_kill),
-       LSM_HOOK_INIT(task_wait, smack_task_wait),
        LSM_HOOK_INIT(task_to_inode, smack_task_to_inode),
 
        LSM_HOOK_INIT(ipc_permission, smack_ipc_permission),