Print this page
OS-5373 lx_proc panic while reading /proc/<pid>/exe link
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
OS-3820 lxbrand ptrace(2): the next generation
OS-3685 lxbrand PTRACE_O_TRACEFORK race condition
OS-3834 lxbrand 64-bit strace(1) reports 64-bit process as using x32 ABI
OS-3794 lxbrand panic on init signal death
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Bryan Cantrill <bryan@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/proc/prsubr.c
          +++ new/usr/src/uts/common/fs/proc/prsubr.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright (c) 2013, Joyent, Inc. All rights reserved.
       24 + * Copyright 2016, Joyent, Inc.
  25   25   */
  26   26  
  27   27  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  28   28  /*        All Rights Reserved   */
  29   29  
  30   30  #include <sys/types.h>
  31   31  #include <sys/t_lock.h>
  32   32  #include <sys/param.h>
  33   33  #include <sys/cmn_err.h>
  34   34  #include <sys/cred.h>
↓ open down ↓ 159 lines elided ↑ open up ↑
 194  194                          case PR_REQUESTED:
 195  195                                  if (t->t_dtrace_stop && t_dtrace == NULL)
 196  196                                          t_dtrace = t;
 197  197                                  else if (t_req == NULL)
 198  198                                          t_req = t;
 199  199                                  break;
 200  200                          case PR_SYSENTRY:
 201  201                          case PR_SYSEXIT:
 202  202                          case PR_SIGNALLED:
 203  203                          case PR_FAULTED:
      204 +                        case PR_BRAND:
 204  205                                  /*
 205  206                                   * Make an lwp calling exit() be the
 206  207                                   * last lwp seen in the process.
 207  208                                   */
 208  209                                  if (t_istop == NULL ||
 209  210                                      (t_istop->t_whystop == PR_SYSENTRY &&
 210  211                                      t_istop->t_whatstop == SYS_exit))
 211  212                                          t_istop = t;
 212  213                                  break;
 213  214                          case PR_CHECKPOINT:     /* can't happen? */
↓ open down ↓ 313 lines elided ↑ open up ↑
 527  528                  cv_broadcast(&pcp->prc_wait);
 528  529                  mutex_exit(&pcp->prc_mutex);
 529  530                  for (; vp != NULL; vp = pnp->pr_next) {
 530  531                          pnp = VTOP(vp);
 531  532                          pcp = pnp->pr_common;
 532  533                          pcp->prc_datamodel = model;
 533  534                          pcp->prc_tid = tid;
 534  535                          pcp->prc_tslot = tslot;
 535  536                  }
 536  537          }
      538 +
      539 +        /*
      540 +         * There may be threads waiting for the flag change blocked behind the
      541 +         * pr_pid_cv as well.
      542 +         */
      543 +        cv_signal(&pr_pid_cv[p->p_slot]);
 537  544  }
 538  545  
 539  546  /*
 540  547   * Called from a hook in relvm() just before freeing the address space.
 541  548   * We free all the watched areas now.
 542  549   */
 543  550  void
 544  551  prrelvm(void)
 545  552  {
 546  553          proc_t *p = ttoproc(curthread);
↓ open down ↓ 3784 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX