]> Pileus Git - ~andy/linux/commitdiff
Merge tag 'v3.6-rc7' into next
authorJames Morris <james.l.morris@oracle.com>
Fri, 28 Sep 2012 03:37:32 +0000 (13:37 +1000)
committerJames Morris <james.l.morris@oracle.com>
Fri, 28 Sep 2012 03:37:32 +0000 (13:37 +1000)
Linux 3.6-rc7

Requested by David Howells so he can merge his key susbsystem work into
my tree with requisite -linus changesets.

1  2 
security/yama/yama_lsm.c

diff --combined security/yama/yama_lsm.c
index 01d3b44b62c14860be5bdccc9028fab4f66de5bd,0cc99a3ea42d65c81188c302626681fae6044473..b4c29848b49d2ab2741ade9f1aece147ac02e6a3
@@@ -100,7 -100,7 +100,7 @@@ static void yama_ptracer_del(struct tas
   * yama_task_free - check for task_pid to remove from exception list
   * @task: task being removed
   */
 -static void yama_task_free(struct task_struct *task)
 +void yama_task_free(struct task_struct *task)
  {
        yama_ptracer_del(task, task);
  }
   * Return 0 on success, -ve on error.  -ENOSYS is returned when Yama
   * does not handle the given option.
   */
 -static int yama_task_prctl(int option, unsigned long arg2, unsigned long arg3,
 +int yama_task_prctl(int option, unsigned long arg2, unsigned long arg3,
                           unsigned long arg4, unsigned long arg5)
  {
        int rc;
                if (arg2 == 0) {
                        yama_ptracer_del(NULL, myself);
                        rc = 0;
 -              } else if (arg2 == PR_SET_PTRACER_ANY) {
 +              } else if (arg2 == PR_SET_PTRACER_ANY || (int)arg2 == -1) {
                        rc = yama_ptracer_add(NULL, myself);
                } else {
                        struct task_struct *tracer;
@@@ -243,7 -243,7 +243,7 @@@ static int ptracer_exception_found(stru
   *
   * Returns 0 if following the ptrace is allowed, -ve on error.
   */
 -static int yama_ptrace_access_check(struct task_struct *child,
 +int yama_ptrace_access_check(struct task_struct *child,
                                    unsigned int mode)
  {
        int rc;
        }
  
        if (rc) {
-               char name[sizeof(current->comm)];
                printk_ratelimited(KERN_NOTICE
                        "ptrace of pid %d was attempted by: %s (pid %d)\n",
-                       child->pid,
-                       get_task_comm(name, current),
-                       current->pid);
+                       child->pid, current->comm, current->pid);
        }
  
        return rc;
   *
   * Returns 0 if following the ptrace is allowed, -ve on error.
   */
 -static int yama_ptrace_traceme(struct task_struct *parent)
 +int yama_ptrace_traceme(struct task_struct *parent)
  {
        int rc;
  
        }
  
        if (rc) {
-               char name[sizeof(current->comm)];
                printk_ratelimited(KERN_NOTICE
                        "ptraceme of pid %d was attempted by: %s (pid %d)\n",
-                       current->pid,
-                       get_task_comm(name, parent),
-                       parent->pid);
+                       current->pid, parent->comm, parent->pid);
        }
  
        return rc;
  }
  
 +#ifndef CONFIG_SECURITY_YAMA_STACKED
  static struct security_operations yama_ops = {
        .name =                 "yama",
  
        .task_prctl =           yama_task_prctl,
        .task_free =            yama_task_free,
  };
 +#endif
  
  #ifdef CONFIG_SYSCTL
  static int yama_dointvec_minmax(struct ctl_table *table, int write,
@@@ -386,17 -378,13 +380,17 @@@ static struct ctl_table yama_sysctl_tab
  
  static __init int yama_init(void)
  {
 +#ifndef CONFIG_SECURITY_YAMA_STACKED
        if (!security_module_enable(&yama_ops))
                return 0;
 +#endif
  
        printk(KERN_INFO "Yama: becoming mindful.\n");
  
 +#ifndef CONFIG_SECURITY_YAMA_STACKED
        if (register_security(&yama_ops))
                panic("Yama: kernel registration failed.\n");
 +#endif
  
  #ifdef CONFIG_SYSCTL
        if (!register_sysctl_paths(yama_sysctl_path, yama_sysctl_table))