kernel - Fix numerous procfs/ptrace issues (3)
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 16 Aug 2012 01:17:43 +0000 (18:17 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 21 Aug 2012 03:59:02 +0000 (20:59 -0700)
* Add a safety spin-lock around adjustments to p_stops so it hopefully
  interacts better with the event processing side of things.

sys/vfs/procfs/procfs_vnops.c

index f3b79bd..8974479 100644 (file)
@@ -302,10 +302,14 @@ procfs_ioctl(struct vop_ioctl_args *ap)
 
        switch (ap->a_command) {
        case PIOCBIS:
+         spin_lock(&procp->p_spin);
          procp->p_stops |= *(unsigned int*)ap->a_data;
+         spin_unlock(&procp->p_spin);
          break;
        case PIOCBIC:
+         spin_lock(&procp->p_spin);
          procp->p_stops &= ~*(unsigned int*)ap->a_data;
+         spin_unlock(&procp->p_spin);
          break;
        case PIOCSFL:
          /*